Skip to content

Commit

Permalink
Updates for pint >=0.21 (#562)
Browse files Browse the repository at this point in the history
* MAINT: Pint updates

* MAINT: Add CodeCov token
  • Loading branch information
mattwthompson authored Aug 9, 2024
1 parent 80d4670 commit c8c476a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ jobs:
- name: Code coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
2 changes: 1 addition & 1 deletion devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies:
- foyer

# Shim
- pint =0.20.1
- pint >=0.21,<0.25

# Standard dependencies
- openff-toolkit >=0.14.3
Expand Down
4 changes: 3 additions & 1 deletion openff/evaluator/forcefield/gradients.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,6 @@ def __eq__(self, other):
)


pint.compat.upcast_types.append(ParameterGradient)
pint.compat.upcast_type_map[
"openff.evaluator.forcefield.gradients.ParameterGradient"
] = ParameterGradient
8 changes: 6 additions & 2 deletions openff/evaluator/utils/observables.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,5 +872,9 @@ def bootstrap(
)


pint.compat.upcast_types.append(Observable)
pint.compat.upcast_types.append(ObservableArray)
pint.compat.upcast_type_map.update(
{
"openff.evaluator.utils.observables.Observable": Observable,
"openff.evaluator.utils.observables.ObservableArray": ObservableArray,
}
)

0 comments on commit c8c476a

Please sign in to comment.