Skip to content

Conversation

@mattwthompson
Copy link
Member

@mattwthompson mattwthompson commented Nov 17, 2025

Resolves #2092 while attempting to be minimally invasive

This overlaps somewhat with #2121 and whichever is merged first should be accounted for in the other

  • Add back "OpenEye = True" and "RDKit/AmberTools = True" elements of CI matrix
  • Fix some minor typing issues
  • Fix/update some docstrings

@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.16%. Comparing base (7febf6d) to head (0e515f0).
⚠️ Report is 2 commits behind head on main.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines -31 to -32
- openeye: true
python-version: "3.11"
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the primary culprit; we need to double-check the CI matrix after removing old Python versions (or run more combinations on multiple version)

Comment on lines +5655 to +5658
raise ValueError("The graph must be a NetworkX graph.")

atom_nums = list(dict(graph.nodes(data="atomic_number", default=1)).values())
atom_nums: list[int] = [atomic_number for (_, atomic_number) in graph.nodes(data="atomic_number", default=1)]
Copy link
Member Author

Choose a reason for hiding this comment

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

This change is motivated in part by how hard it was to figure out what was going on at first; it reads like the type would be list[dict[?, ?]] but in fact the iterator in the middle returns a sequence of 2-length tuples:

In [6]: [*Molecule.from_smiles("CCO").to_networkx().nodes(data="atomic_number", default=1)]
Out[6]: [(0, 6), (1, 6), (2, 8), (3, 1), (4, 1), (5, 1), (6, 1), (7, 1), (8, 1)]

of which we only care about the second in each. Casting to dict and then only getting the values is an okay way to extract the numbers we want, but I think iterating over the tuples directly and throwing away the first value is more explicit (can use a helpful variable name atomic_number inside) and direct (skips a step)

Comment on lines -1767 to +1770
offmol.add_default_hierarchy_schemes()
offmol.add_default_hierarchy_schemes() # type: ignore[operator]
Copy link
Member Author

Choose a reason for hiding this comment

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

This method if properly defined, but something in the writing was getting crossed and add_default_hierarchy_schemes was inferred to be a list[HierarchyElement]. That's not a function, so ()-ing it is an error

@mattwthompson mattwthompson marked this pull request as ready for review November 17, 2025 20:43
@mattwthompson mattwthompson marked this pull request as draft November 18, 2025 17:41
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

- nglview
- parmed =4
- mypy =1.15
- mypy =1.18
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the most recent version; if there's a reason to downpin I am happy to update

Comment on lines -835 to +838
def angles(self) -> Generator[tuple["Atom", ...], None, None]:
def angles(self) -> Generator[tuple[AtomLike, AtomLike, AtomLike], None, None]:
Copy link
Member Author

Choose a reason for hiding this comment

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

This changes are intentional

  • Having it cover Atom | _SimpleAtom is intentional
  • Being length-3 (length-4 below) is important; tuple[x, ...] can be a tuple of any length but containing only X (docs)

@mattwthompson mattwthompson marked this pull request as ready for review November 18, 2025 22:37
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.

"True-True" CI not running

3 participants