Skip to content

Commit

Permalink
DOC: Update annotations, release history
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwthompson committed Sep 30, 2024
1 parent 95b051c commit 2cace3f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/releasehistory.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Please note that all releases prior to a version 1.0.0 are considered pre-releas
* Several classes and methods which were deprecated in the 0.3 line of releases are now removed.
* Previously-deprecated examples are removed.
* `ProperTorsionKey` no longer accepts an empty tuple as atom indices.
* Fixes a regression in which some `ElectrostaticsCollection.charges` properties did not return cached values.

## 0.3.30 - 2024-08

Expand Down
4 changes: 2 additions & 2 deletions openff/interchange/common/_nonbonded.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ class ElectrostaticsCollection(_NonbondedCollection):
# _charges: dict[Any, _ElementaryChargeQuantity] = PrivateAttr(default_factory=dict)
_charges_cached: bool = PrivateAttr(default=False)

@computed_field
@computed_field # type: ignore[misc]
@property
def charges(
self,
) -> dict[TopologyKey | LibraryChargeTopologyKey | VirtualSiteKey, _ElementaryChargeQuantity]:
"""Get the total partial charge on each atom, including virtual sites."""
if len(self._charges) == 0 or self._charges_cached is False:
if len(self._charges) == 0 or self._charges_cached is False: # type: ignore[has-type]
self._charges = self._get_charges(include_virtual_sites=False)
self._charges_cached = True

Expand Down
2 changes: 1 addition & 1 deletion openff/interchange/components/potentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
if has_package("jax"):
from jax import Array
else:
Array = Any
Array = Any # type: ignore


class Potential(_BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion openff/interchange/smirnoff/_nonbonded.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def _charges_without_virtual_sites(
"""Get the total partial charge on each atom, excluding virtual sites."""
return self._get_charges(include_virtual_sites=False)

@computed_field
@computed_field # type: ignore[misc]
@property
def charges(
self,
Expand Down

0 comments on commit 2cace3f

Please sign in to comment.