Open angularsen opened 1 year ago
Add System.Text.Json support https://github.com/angularsen/UnitsNet/pull/966
Decide on a naming and abbreviation convention for imperial/UK units and US units; like gallon, ounces, cup etc.
It is a bit of a mess right now:
I personally like "UK", since it is shorter and better matches "US". Wolfram also uses US gallon and UK gallon.
Some conventions for imperial gallons: https://en.wikipedia.org/wiki/Gallon#:~:text=the%20imperial%20gallon%20(imp%20gal,American%20and%20Caribbean%20countries%3B%20and
Today the abbreviation convention is gal (U.S.)
and gal (imp.)
.
Depending on landing on UK or imperial naming, we could go with one of these pairs:
US gal
and UK gal
US gal
and imp gal
gal (US)
and gal (UK)
We can support multiple of these plus the old ones, but the primary form should be standardized across the different units.
Do not throw ArgumentException on NaN, Inf+ or Inf- or give a way to configure the behavior globally.
Context: https://github.com/angularsen/UnitsNet/issues/1268#issuecomment-1630856242
I think UnitsNet should be more extensible. Perhaps there could be a base package, but separate NuGet packages for US measurements, Imperial, UK, etc. Alternatively, customizable abbreviations could be a solution. I would never expect me or my users to see "gal (US)" instead of "gal". This would also help the debate here.
UPDATE:
Custom abbreviations already exist: UnitAbbreviationsCache.Default.MapUnitToDefaultAbbreviation(HowMuchUnit.Some, "sm");
I think UnitsNet should be more extensible.
Conceptually, I agree.
Customizable abbreviations is already supported as you found, and we support custom quantities and units with some limited functionality: https://github.com/angularsen/UnitsNet/wiki/Extending-with-Custom-Units
Splitting up in packages is not so easy though. Things like Torque = Force * Length
becomes problematic when types exist in different packages and they can't have circular dependencies. Imperial is even worse, splitting some units of a quantity to different packages. The main problem is static typing, which is also one of the main features of UnitsNet.
One benefit of splitting up in packages is smaller binary size to only bring in what you need. Some prototyping here: #1181
I was requested to give a list of units with the wrong plural form (see #1330 )
I checked the .json-file with the speed units and only MetersPerMinute has a wrong plural form, all other Speed units seem to have the correct plural form.
@Markussp256
I was requested to give a list of units with the wrong plural form (see #1330 )
I checked the .json-file with the speed units and only MetersPerMinute has a wrong plural form, all other Speed units seem to have the correct plural form.
Some more fixes were made recently in
This issue serves as a place to discuss what to include in this version, since major version bumps allow us to make breaking changes we think are necessary or worth it.
The wishlist keeps track of the items to include, but items may be added or removed at any time.
As changes are completed, they are added to https://github.com/angularsen/UnitsNet/wiki/Upgrading-from-5.x-to-6.x
Wishlist
Speed.MeterPerMinute
UnitAbbreviationsCache.ctor()
should create empty cache, not load default abbreviationsUnitParser.ctor(UnitAbbreviationsCache)
should not fallback to built-in units if givennull
AbsorbedDoseOfIonizingRadiation
toRadiationAbsorbedDose
https://github.com/angularsen/UnitsNet/pull/1352#issuecomment-1879666525[Obsolete]
in code and add to this listEquals
overloads https://github.com/angularsen/UnitsNet/pull/1396#issuecomment-2171563287