Skip to content

Conversation

alongd
Copy link
Member

@alongd alongd commented Aug 21, 2023

Added a method for generating TS structures from atom mapped reactants and products.
The method works for unimolecular reactions, and at present is only implemented for isomerization reactions.

@codecov
Copy link

codecov bot commented Aug 22, 2023

Codecov Report

Attention: Patch coverage is 87.93103% with 35 lines in your changes are missing coverage. Please review.

Project coverage is 73.97%. Comparing base (3631196) to head (cbec920).

Current head cbec920 differs from pull request most recent head 69759f8

Please upload reports for the commit 69759f8 to get more accurate results.

Files Patch % Lines
arc/job/adapters/ts/linear.py 75.63% 18 Missing and 11 partials ⚠️
arc/mapping/engine.py 86.66% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #695      +/-   ##
==========================================
+ Coverage   73.80%   73.97%   +0.17%     
==========================================
  Files          99      101       +2     
  Lines       27352    27596     +244     
  Branches     5718     5746      +28     
==========================================
+ Hits        20187    20415     +228     
- Misses       5738     5745       +7     
- Partials     1427     1436       +9     
Flag Coverage Δ
unittests 73.97% <87.93%> (+0.17%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alongd alongd force-pushed the linear_ts branch 5 times, most recently from 8825e9f to cbec920 Compare May 15, 2024 07:02
@alongd alongd marked this pull request as ready for review May 15, 2024 09:26
from arc.plotter import save_geo
from arc.species.converter import order_xyz_by_atom_map, zmat_to_xyz
from arc.species.species import ARCSpecies, TSGuess, colliding_atoms
from arc.species.zmat import check_ordered_zmats, get_atom_order, update_zmat_by_xyz, xyz_to_zmat

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'get_atom_order' is not used.

Copilot Autofix

AI 7 months ago

To fix the problem, we need to remove the unused import statement for get_atom_order from the file arc/job/adapters/ts/linear.py. This will clean up the code and remove unnecessary dependencies, making the code easier to read and maintain.

Suggested changeset 1
arc/job/adapters/ts/linear.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/arc/job/adapters/ts/linear.py b/arc/job/adapters/ts/linear.py
--- a/arc/job/adapters/ts/linear.py
+++ b/arc/job/adapters/ts/linear.py
@@ -18,3 +18,3 @@
 from arc.species.species import ARCSpecies, TSGuess, colliding_atoms
-from arc.species.zmat import check_ordered_zmats, get_atom_order, update_zmat_by_xyz, xyz_to_zmat
+from arc.species.zmat import check_ordered_zmats, update_zmat_by_xyz, xyz_to_zmat
 
EOF
@@ -18,3 +18,3 @@
from arc.species.species import ARCSpecies, TSGuess, colliding_atoms
from arc.species.zmat import check_ordered_zmats, get_atom_order, update_zmat_by_xyz, xyz_to_zmat
from arc.species.zmat import check_ordered_zmats, update_zmat_by_xyz, xyz_to_zmat

Copilot is powered by AI and may make mistakes. Always verify output.
H -0.53390611 -2.06386676 -0.83047533
H -0.42088759 -4.06846526 -2.17670487
H 1.36205133 -3.75009763 -2.57288841""")])
cls.rxn_1.determine_family(rmg_database=cls.rmgdb)

Check failure

Code scanning / CodeQL

Wrong name for an argument in a call Error

Keyword argument 'rmg_database' is not a supported parameter name of
method ARCReaction.determine_family
.

Copilot Autofix

AI 7 months ago

To fix the problem, we need to ensure that the keyword argument used in the method call matches the parameter name expected by the determine_family method. We should check the method definition of determine_family in the ARCReaction class to find the correct parameter name and update the method call accordingly.

The best way to fix the problem without changing existing functionality is to replace the incorrect keyword argument rmg_database with the correct parameter name. This change should be made in the file arc/job/adapters/ts/linear_test.py on line 77 and line 101.

Suggested changeset 1
arc/job/adapters/ts/linear_test.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/arc/job/adapters/ts/linear_test.py b/arc/job/adapters/ts/linear_test.py
--- a/arc/job/adapters/ts/linear_test.py
+++ b/arc/job/adapters/ts/linear_test.py
@@ -76,3 +76,3 @@
                                                              H       1.36205133   -3.75009763   -2.57288841""")])
-        cls.rxn_1.determine_family(rmg_database=cls.rmgdb)
+        cls.rxn_1.determine_family(rmgdb=cls.rmgdb)
 
@@ -100,3 +100,3 @@
                                                              H       0.27058353   -0.73979548    1.43184405""")])
-        cls.rxn_2.determine_family(rmg_database=cls.rmgdb)
+        cls.rxn_2.determine_family(rmgdb=cls.rmgdb)
 
EOF
@@ -76,3 +76,3 @@
H 1.36205133 -3.75009763 -2.57288841""")])
cls.rxn_1.determine_family(rmg_database=cls.rmgdb)
cls.rxn_1.determine_family(rmgdb=cls.rmgdb)

@@ -100,3 +100,3 @@
H 0.27058353 -0.73979548 1.43184405""")])
cls.rxn_2.determine_family(rmg_database=cls.rmgdb)
cls.rxn_2.determine_family(rmgdb=cls.rmgdb)

Copilot is powered by AI and may make mistakes. Always verify output.
H -1.41423043 0.87863077 0.42354512
H 1.02430791 0.21530309 0.12674144
H 0.27058353 -0.73979548 1.43184405""")])
cls.rxn_2.determine_family(rmg_database=cls.rmgdb)

Check failure

Code scanning / CodeQL

Wrong name for an argument in a call Error

Keyword argument 'rmg_database' is not a supported parameter name of
method ARCReaction.determine_family
.

Copilot Autofix

AI 7 months ago

To fix the problem, we need to ensure that the correct parameter name is used when calling the determine_family method. This involves checking the method definition of determine_family in the ARCReaction class to find the correct parameter name and updating the call accordingly.

  • First, identify the correct parameter name expected by the determine_family method.
  • Update the call to determine_family on line 101 to use the correct parameter name.
Suggested changeset 1
arc/job/adapters/ts/linear_test.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/arc/job/adapters/ts/linear_test.py b/arc/job/adapters/ts/linear_test.py
--- a/arc/job/adapters/ts/linear_test.py
+++ b/arc/job/adapters/ts/linear_test.py
@@ -100,3 +100,3 @@
                                                              H       0.27058353   -0.73979548    1.43184405""")])
-        cls.rxn_2.determine_family(rmg_database=cls.rmgdb)
+        cls.rxn_2.determine_family(rmgdb=cls.rmgdb)
 
EOF
@@ -100,3 +100,3 @@
H 0.27058353 -0.73979548 1.43184405""")])
cls.rxn_2.determine_family(rmg_database=cls.rmgdb)
cls.rxn_2.determine_family(rmgdb=cls.rmgdb)

Copilot is powered by AI and may make mistakes. Always verify output.
Returns:
float: The reaction weight.
"""
reactants, products = rxn.get_reactants_and_products(arc=True, return_copies=False)

Check failure

Code scanning / CodeQL

Wrong name for an argument in a call Error

Keyword argument 'arc' is not a supported parameter name of
method ARCReaction.get_reactants_and_products
.

Copilot Autofix

AI about 2 months ago

The best fix is to remove the unsupported keyword argument arc=True from the call to rxn.get_reactants_and_products on line 407 in arc/job/adapters/ts/linear.py. The parameter return_copies=False should remain if it is valid. No imports or new method definitions are needed. The change should be made only to line 407, leaving the rest of the functionality and file untouched.

Suggested changeset 1
arc/job/adapters/ts/linear.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/arc/job/adapters/ts/linear.py b/arc/job/adapters/ts/linear.py
--- a/arc/job/adapters/ts/linear.py
+++ b/arc/job/adapters/ts/linear.py
@@ -404,7 +404,7 @@
     Returns:
         float: The reaction weight.
     """
-    reactants, products = rxn.get_reactants_and_products(arc=True, return_copies=False)
+    reactants, products = rxn.get_reactants_and_products(return_copies=False)
     r_e0 = [r.e0 for r in reactants]
     p_e0 = [p.e0 for p in products]
     ts_e0 = rxn.ts_species.e0
EOF
@@ -404,7 +404,7 @@
Returns:
float: The reaction weight.
"""
reactants, products = rxn.get_reactants_and_products(arc=True, return_copies=False)
reactants, products = rxn.get_reactants_and_products(return_copies=False)
r_e0 = [r.e0 for r in reactants]
p_e0 = [p.e0 for p in products]
ts_e0 = rxn.ts_species.e0
Copilot is powered by AI and may make mistakes. Always verify output.
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant