Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor: Optional output zmat after modify_coords #405

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oscarwumit
Copy link
Contributor

@oscarwumit oscarwumit commented Jun 17, 2020

Zmat contains important connectivity information that xyz does not. Giving the option to output zmat instead of xyz after coordinates modification is useful to ensure connectivity information is preserved.

Zmat is particularly useful when modify_coords is called multiple times such as changing two dihedrals of a species by calling the function twice. Using xyz in this case may cause bugs as ARC needs to perceive connectivity from xyz twice, and the perceived connectivity might be inconsistent.

@codecov
Copy link

codecov bot commented Jun 17, 2020

Codecov Report

Merging #405 into master will decrease coverage by 0.02%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #405      +/-   ##
==========================================
- Coverage   54.06%   54.03%   -0.03%     
==========================================
  Files          35       35              
  Lines       11921    11923       +2     
  Branches     3696     3697       +1     
==========================================
- Hits         6445     6443       -2     
- Misses       4505     4508       +3     
- Partials      971      972       +1     
Impacted Files Coverage Δ
arc/species/converter.py 73.96% <33.33%> (-0.19%) ⬇️
arc/parser.py 85.29% <0.00%> (-0.37%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c216de6...5d9e424. Read the comment docs.

Copy link
Contributor

@xiaoruiDong xiaoruiDong left a comment

Choose a reason for hiding this comment

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

@oscarwumit, thank you for your contribution, and I agree with this edition.

@@ -884,6 +886,8 @@ def modify_coords(coords: Dict[str, tuple],

Returns:
dict: The respective cartesian (xyz) coordinates reflecting the desired modification.
Returns:
dict: The internal (zmat) coordinates reflecting the desired modification.
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: @alongd, I am not familiar with the convention. Do we write separate Returns, or we merge them together?

Copy link
Member

Choose a reason for hiding this comment

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

We should have just one returned type, it could be a composite type, e.g., https://github.com/ReactionMechanismGenerator/ARC/blob/master/arc/species/conformers.py#L739

if output_zmat:
return zmat
else:
return new_xyz
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: I suggest to put line 952 into the else section.

@oscarwumit
Copy link
Contributor Author

oscarwumit commented Jun 19, 2020

Thanks for the suggestions. Please take another look. This PR is rebased. @xiaoruiDong

@alongd
Copy link
Member

alongd commented Jun 30, 2020

@oscarwumit, can you look at the tests?

@alongd
Copy link
Member

alongd commented Sep 12, 2020

@oscarwumit , what's the status of this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants