-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update test environment * Update to use new annotated types * Fix type-checking * Slightly simplify diff * Use `macos-latest` * Bump codecov/codecov-action from 4 to 5 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4 to 5. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@v4...v5) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Update .github/workflows/ci.yaml * Apply suggestions from code review Co-authored-by: Josh A. Mitchell <yoshanuikabundi@gmail.com> * Cleanup * Relax RDKit pin, trust toolkit metadata? * Add Python 3.12 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Josh A. Mitchell <yoshanuikabundi@gmail.com>
- Loading branch information
1 parent
5df8662
commit 6e820fc
Showing
11 changed files
with
117 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
"""Type annotations of quantity dimensionality not yet provided by upstreams.""" | ||
|
||
from typing import Annotated | ||
|
||
from openff.interchange._annotations import ( | ||
_dimensionality_validator_factory, | ||
_DimensionlessQuantity, | ||
_DistanceQuantity, | ||
quantity_json_serializer, | ||
quantity_validator, | ||
) | ||
from openff.toolkit import Quantity | ||
from pydantic import AfterValidator, WrapSerializer, WrapValidator | ||
|
||
__all__ = ( | ||
"_InverseDistanceQuantity", | ||
"_DistanceQuantity", | ||
"_DimensionlessQuantity", | ||
"_kJMolNanometerQuantity", | ||
) | ||
|
||
( | ||
_is_inverse_distance, | ||
_is_kj_mol_nanometer, | ||
) = ( | ||
_dimensionality_validator_factory(unit=_unit) | ||
for _unit in [ | ||
"nanometer ** -1", | ||
"kilojoules_per_mole * nanometer ** -1", | ||
] | ||
) | ||
|
||
_InverseDistanceQuantity = Annotated[ | ||
Quantity, | ||
WrapValidator(quantity_validator), | ||
AfterValidator(_is_inverse_distance), | ||
WrapSerializer(quantity_json_serializer), | ||
] | ||
|
||
_kJMolNanometerQuantity = Annotated[ | ||
Quantity, | ||
WrapValidator(quantity_validator), | ||
AfterValidator(_is_kj_mol_nanometer), | ||
WrapSerializer(quantity_json_serializer), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.