-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redesign UnitSystem to support non-SI systems and configurable default units #709
base: master
Are you sure you want to change the base?
Commits on Sep 28, 2019
-
Create QuantityType -> UnitInfo associations (DefaultUnits) in UnitSy…
…stem - UnitSystem holds the list of default units for each (compatible?) quantity type and a method (GetDefaultUnitInfo) that provides the corresponding UnitInfo given a QuantityType - All methods in Quantity that use a UnitSystem now use the new GetDefaultUnitInfo - Added a method (in UnitSystem) for creating derived unit systems(WithDefaultUnit), providing a new QuantityType->UnitInfo association and optionally a new BaseUnits definition (as currently used by Equals and visible in public ctor- otherwise obsolete?)
Configuration menu - View commit details
-
Copy full SHA for 33d5a51 - Browse repository at this point
Copy the full SHA 33d5a51View commit details
Commits on Sep 29, 2019
-
Added tests for the new public methods in UnitSystem
- updated the comments and invalid arguments checks - added a few tests for those cases a few question marks remain (marked with TODOs)
Configuration menu - View commit details
-
Copy full SHA for 75175e7 - Browse repository at this point
Copy the full SHA 75175e7View commit details -
- renamed some tests, added comments here and there - WithDefaultUnit : added a check for the compatibility between QuantityType and UnitInfo passed in (also added a test for this)
Configuration menu - View commit details
-
Copy full SHA for 4dcc1ac - Browse repository at this point
Copy the full SHA 4dcc1acView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0b69e3b - Browse repository at this point
Copy the full SHA 0b69e3bView commit details
Commits on Oct 5, 2019
-
UnitSystem in UnitDefinition schema (for Volume)
- added an association (1:0..1) between UnitSystem and Unit (kept the name 'BaseUnit' instead of the previously considered 'DefaultUnit') - added an association (1:0..n) between Unit and UnitSystem- this would be used to generate list of units for a quantity in a particular unit system (not an exhaustive list, needs a review)
Configuration menu - View commit details
-
Copy full SHA for ff000d4 - Browse repository at this point
Copy the full SHA ff000d4View commit details
Commits on Nov 11, 2019
-
- refactored the UnitSystem- moving the BaseUnits to BaseUnitSystem (SI derived from BaseUnitSystem), extended the unit mappings with the UnitSystemInfo class (containing both default and common/derived units) - updated the JsonTypes and created the UnitSystemInfoGenerator (TODO WRC) - updated existing UnitSystemTests that tested for equality/BaseUnits (almost all in fact) to use the BaseUnitSystem instead (as the IEquatble/BaseUnits interface was pushed down) - added several more unit-system mappings to the UnitDefinitions (Acceleration, AmountOfSubstance, Area, Energy & Length) - commented (temporary) part of the Ctor_WithValueAndSIUnitSystem_ReturnsQuantityWithSIUnitOrThrowsArgum test (testing for support SI support)
Configuration menu - View commit details
-
Copy full SHA for d71900e - Browse repository at this point
Copy the full SHA d71900eView commit details
Commits on Oct 5, 2020
-
UnitSystem equality, BaseUnits for BaseUnitSystem + tests
- UnitSystem/BaseUnitSystem Equality contract based on the base (default) unit for each quantity - BaseUnits for BaseUnitSystem created from the provided unit associations - added unit system associations for all SI base types (Length, Mass, Duration etc.) - tests for the UnitSystem construction/derivation
Configuration menu - View commit details
-
Copy full SHA for d88e2e7 - Browse repository at this point
Copy the full SHA d88e2e7View commit details -
updated the Astronomical unit system
- updated the default units (as per https://en.wikipedia.org/wiki/Astronomical_system_of_units) - fixed the docstring
Configuration menu - View commit details
-
Copy full SHA for b844f26 - Browse repository at this point
Copy the full SHA b844f26View commit details -
added static acess variables for all UnitSystems
in order to avoid breaking the namespace (UnitSystem.SI) all static instances were added to the UnitSystem.Definition (partial class)
Configuration menu - View commit details
-
Copy full SHA for 6ef823f - Browse repository at this point
Copy the full SHA 6ef823fView commit details -
added tests for supported unit systems (Ctor/As/ToUnit)
- fixed typo in unit system for Length - Ctor_UnitSystem_ThrowsArgumentExceptionIfNotSupported - Ctor_WithNullUnitSystem_ThrowsArgumentNullException - As_UnitSystem_ThrowsArgumentExceptionIfNotSupported - As_WithNullUnitSystem_ThrowsArgumentNullException - To_UnitSystem_ThrowsArgumentExceptionIfNotSupported - ToUnit_WithNullUnitSystem_ThrowsNullException
Configuration menu - View commit details
-
Copy full SHA for a8f022d - Browse repository at this point
Copy the full SHA a8f022dView commit details
Commits on Oct 6, 2020
-
merged upstream & fixed issues with nullable ref types
- merged all upstream modifications - fixed nullability issues in UnitSystem - the Lazy<..> BaseUnits constructor was made protected - marked all tests that rely solely on BaseUnits as Obsolete (with error=false) - removed some obsolete tests from MassConcentration (tesing for default unit system units)
Configuration menu - View commit details
-
Copy full SHA for 784ef10 - Browse repository at this point
Copy the full SHA 784ef10View commit details
Commits on Mar 7, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 9d5c86f - Browse repository at this point
Copy the full SHA 9d5c86fView commit details -
removed SupportsSIUnitSystem in favor of the As_UnitSystem_ThrowsArgu…
…mentExceptionIfNotSupported tests
Configuration menu - View commit details
-
Copy full SHA for e45efe8 - Browse repository at this point
Copy the full SHA e45efe8View commit details
Commits on Apr 27, 2021
-
Configuration menu - View commit details
-
Copy full SHA for e027e7c - Browse repository at this point
Copy the full SHA e027e7cView commit details -
Configuration menu - View commit details
-
Copy full SHA for cbdbe19 - Browse repository at this point
Copy the full SHA cbdbe19View commit details
Commits on Apr 29, 2021
-
Configuration menu - View commit details
-
Copy full SHA for c3585da - Browse repository at this point
Copy the full SHA c3585daView commit details
Commits on May 1, 2021
-
Configuration menu - View commit details
-
Copy full SHA for cb3c603 - Browse repository at this point
Copy the full SHA cb3c603View commit details
Commits on Aug 13, 2022
-
- fixed the test for WithDefaultUnit_GivenNullForDerivedUnits_Returns…
…UnitSystemWithOldDerivedUnits_IncludingTheNewBaseUnit
Configuration menu - View commit details
-
Copy full SHA for dfe0bd2 - Browse repository at this point
Copy the full SHA dfe0bd2View commit details