Changing the Dimensions and BaseUnit for the FuelEfficiency - #1489
Conversation
- BaseUnit changed from LiterPer100Kilometers (defaults to +Infinity) to KilometersPerLiter (defaults to 0) - added the MeterPerCubicMeter (m/m³) unit - updated the relevant tests
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
lipchev
commented
Jan 3, 2025
I was also going to include this as part of the "Length.Kilometer = FuelEfficiency.KilometerPerLiter * Volume.Liter -- NoInferredDivision",but ended up reverting the change (not that it didn't work or anything). Here is how this would affect the two quantities: publicreadonlypartialstructFuelEfficiency:IArithmeticQuantity<FuelEfficiency,FuelEfficiencyUnit>,
#if NET7_0_OR_GREATERIMultiplyOperators<FuelEfficiency,Volume,Length>,
#endifpublicreadonlypartialstructVolume:IArithmeticQuantity<Volume,VolumeUnit>,
#if NET7_0_OR_GREATERIMultiplyOperators<Volume,Molarity,AmountOfSubstance>,IMultiplyOperators<Volume,ReciprocalLength,Area>,IDivisionOperators<Volume,Length,Area>,IMultiplyOperators<Volume,Length,AreaMomentOfInertia>,IDivisionOperators<Volume,VolumeFlow,Duration>,IMultiplyOperators<Volume,EnergyDensity,Energy>,IMultiplyOperators<Volume,FuelEfficiency,Length>,IMultiplyOperators<Volume,ReciprocalArea,Length>,IDivisionOperators<Volume,Area,Length>,IMultiplyOperators<Volume,Density,Mass>,IMultiplyOperators<Volume,MassConcentration,Mass>,IDivisionOperators<Volume,SpecificVolume,Mass>,IDivisionOperators<Volume,Mass,SpecificVolume>,IDivisionOperators<Volume,Duration,VolumeFlow>,
#endifHere are the pros and cons to consider:
@angularsen A lot of important decisions for you to make in this PR 😄 PS Of course we could just close this PR: I don't care much either way, I had the |
Uh oh!
There was an error while loading. Please reload this page.
lipchev
commented
Jan 19, 2025
@angularsen Ok, I've removed the I've also updated the summary of the related issue: #1463, have a look at the remaining tasks.. |
angularsen
commented
Jan 19, 2025
I'm not sure I follow, how is this worse than binding to other quantities? Is it because you consider this a less-widely-used quantity? Regarding extensibility and splitting up into packages, this is tricky with static typed stuff that we primarily deal with, but I have some ideas in #1500
If the inferred operators don't make sense, then yes, we always have the option of manually adding them. |
lipchev
commented
Jan 20, 2025
Yes, I'd say that the minimal quantity set (e.g. |
angularsen
commented
Jan 20, 2025
Alright, I fear it will be tough to split up into two packages where one cannot depend on the other, but maye there is such a cut. |
Changing the
DimensionsandBaseUnitfor theFuelEfficiency:BaseUnitchanged fromLiterPer100Kilometers(defaults to+Infinity) toKilometersPerLiter(defaults to0)Dimensionsof"L": -2(was previously treated as a dimensionless quantity)