Skip to content

Basic routines for internal to cartesian coordinate conversion#1311

Merged
swails merged 1 commit into
ParmEd:masterfrom
bradakta:ic_geom
Jun 9, 2023
Merged

Basic routines for internal to cartesian coordinate conversion#1311
swails merged 1 commit into
ParmEd:masterfrom
bradakta:ic_geom

Conversation

@bradakta

@bradakta bradakta commented Jun 8, 2023

Copy link
Copy Markdown
Contributor

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.
Comment thread parmed/geometry.py
u /= sqrt(np.dot(u, u))
return u

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

Copy link
Copy Markdown
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

swails commented Jun 9, 2023

Copy link
Copy Markdown
Contributor

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