-
Notifications
You must be signed in to change notification settings - Fork 386
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
Changing the Dimensions and BaseUnit for the FuelEfficiency #1489
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
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: public readonly partial struct FuelEfficiency :
IArithmeticQuantity<FuelEfficiency, FuelEfficiencyUnit>,
#if NET7_0_OR_GREATER
IMultiplyOperators<FuelEfficiency, Volume, Length>,
#endif public readonly partial struct Volume :
IArithmeticQuantity<Volume, VolumeUnit>,
#if NET7_0_OR_GREATER
IMultiplyOperators<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>,
#endif Here 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 |
…sing the old spelling)
@angularsen Ok, I've removed the I've also updated the summary of the related issue: #1463, have a look at the remaining tasks.. |
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. |
Yes, I'd say that the minimal quantity set (e.g. |
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
Dimensions
andBaseUnit
for theFuelEfficiency
:BaseUnit
changed fromLiterPer100Kilometers
(defaults to+Infinity
) toKilometersPerLiter
(defaults to0
)Dimensions
of"L": -2
(was previously treated as a dimensionless quantity)