File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
1111### Added
1212- Added ` ATM ` and ` POISE ` as additional units for pressure and viscosity.
13+ - Added ` sum ` for ` SIObject ` s that can be summed. [ #111 ] ( https://github.com/itt-ustutt/quantity/pull/111 )
1314
1415### Fixed
1516- Fixed the String representation of non-scalar mass quantities. [ #111 ] ( https://github.com/itt-ustutt/quantity/pull/111 )
Original file line number Diff line number Diff line change @@ -297,6 +297,11 @@ impl PySIObject {
297297 }
298298 }
299299
300+ fn sum ( & self , py : Python ) -> PyResult < Self > {
301+ let value = self . value . call_method0 ( py, "sum" ) ?;
302+ Ok ( Self :: new ( value, self . unit ) )
303+ }
304+
300305 #[ getter]
301306 fn unit ( & self ) -> [ i8 ; 7 ] {
302307 self . unit . 0
You can’t perform that action at this time.
0 commit comments