Skip to content

Commit

Permalink
Merge pull request #1628 from dlakaplan/fixpairpar
Browse files Browse the repository at this point in the history
Fix `.value()` for `pairParameters`
  • Loading branch information
abhisrkckl authored Aug 28, 2023
2 parents 7943e1a + 304ac52 commit a831d85
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ the released changes.
### Added
### Fixed
- Fixed RTD by specifying theme explicitly.
- `.value()` now works for pairParameters
- Setting `model.PARAM1 = model.PARAM2` no longer overrides the name of `PARAM1`
### Removed
3 changes: 3 additions & 0 deletions src/pint/models/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,9 @@ def _get_value(self, quan):
return None
elif isinstance(quan, (float, np.longdouble)):
return quan
elif isinstance(quan, list):
# for pairParamters
return [x.to(self.units).value for x in quan]
else:
return quan.to(self.units).value

Expand Down

0 comments on commit a831d85

Please sign in to comment.