Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions si-units/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
- Added `ATM` and `POISE` as additional units for pressure and viscosity.
- Added `sum` for `SIObject`s that can be summed. [#111](https://github.com/itt-ustutt/quantity/pull/111)

### Fixed
- Fixed the String representation of non-scalar mass quantities. [#111](https://github.com/itt-ustutt/quantity/pull/111)
Expand Down
5 changes: 5 additions & 0 deletions si-units/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,11 @@ impl PySIObject {
}
}

fn sum(&self, py: Python) -> PyResult<Self> {
let value = self.value.call_method0(py, "sum")?;
Ok(Self::new(value, self.unit))
}

#[getter]
fn unit(&self) -> [i8; 7] {
self.unit.0
Expand Down
Loading