Skip to content

Basic routines for internal to cartesian coordinate conversion #1311

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

Merged
merged 1 commit into from
Jun 9, 2023

Conversation

bradakta
Copy link
Contributor

@bradakta bradakta commented Jun 8, 2023

I hope there is agreement as to how something like this could be useful. I included a test to show how you can place atoms based on internal coordinates using a Z-matrix-like entry.

I hope there is agreement as to how something like this could be useful.
I included a test to show how you can place atoms based on internal
coordinates using a Z-matrix-like entry.
u /= sqrt(np.dot(u, u))
return u

# Skipping type annotations for Atom bc it causes a circular import
Copy link
Contributor

Choose a reason for hiding this comment

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

At the bottom of the file you can do this:

if TYPE_CHECKING:  # must be imported from typing
    from .topologyobjects import Atom

Then you can use strings as type hints:

def local_axes(atom1: "Atom", atom2: "Atom", atom3: "Atom") -> np.ndarray:

@swails
Copy link
Contributor

swails commented Jun 9, 2023

There are a number of places where it'd be useful to do Zmat to cartesian transformations (e.g., CHARMM RTF files).

I'm good adding this.

@swails swails merged commit 6e7332a into ParmEd:master Jun 9, 2023
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.

2 participants