-
Notifications
You must be signed in to change notification settings - Fork 384
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
Add/rename electric quantities #1444
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this was ready to review yet, but a few minor comments about the texts.
Rearranged some of the electrical units, all with the prefix "Electric", and labeled the following classes as obsolete: * ApparentEnergy -> ElectricApparentEnergy * ApparentPower -> ElectricApparentPower * Capacitance -> ElectricCapacitance * ReactiveEnergy -> ElectricReactiveEnergy * ReactivePower -> ElectricReactivePower Added classes for ElectricReactance and ElectricSusceptance. Labeled ElectricPotentialAc and ElectricPotentialDc as obsolete per discussion. Labeled ElectricAdmittance as obsolete due to it being a complex number. Decided against adding ElectricImpedance for the same reason. Added math to ElectricCurrent.extra.cs and ElectricPotential.extra.cs to support ElectricApparentPower Added math for ElectricApparentPower.extra.cs Minor correction to formula in comment of Power.extra.cs
Revised ObsoleteText messages to be more useful. Added correct testing code. Added ElectricImpedance class; even though it's a complex number, it "rounds out" the other five units of: * Admittance * Conductance * Reactance * Resistance * Susceptance Removed excess multiplication operators for ElectricApparentPower.
Should I make a second PR against default/v6, or would the code change here be merged into the next version as well? |
@McNeight It will eventually be merged into v6 when syncing master into v6, but it is very helpful if you coulg do a separate PR for v6 simply to reduce the amount of merge conflicts 🙏 Let's hold until this is merged though, is it ready to review now? |
Not a problem! I believe it's ready to review for v5, if you want to mark ElectricPotentialAc and Dc as obsolete in v5. If you wanted to save the breaking change for v6, then I'll need to rework the commits a pull requests, but the content should be ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking pretty good now, my only remaining comments are regarding ElectricAdmittance
and ElectricImpedance
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the Joule
an applicable / useful unit for this quantity? If yes- then it would allow us to have an SI unit for #1463
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I actually meant to comment on #1467 but got my tabs confused..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively VoltampereReactiveSecond
would also do the trick, if you think it's a better fit (note, we don't have any rules about it- if you think neither units make sense, we could just [Skip] the tests and deal with it later).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll merge this now, we can still add this unit later if it makes sense.
# Conflicts: # Common/UnitEnumValues.g.json # UnitsNet.Tests/GeneratedCode/TestsBase/ElectricAdmittanceTestsBase.g.cs # UnitsNet.Tests/GeneratedCode/TestsBase/ElectricConductanceTestsBase.g.cs # UnitsNet.Tests/GeneratedCode/TestsBase/ElectricResistanceTestsBase.g.cs
Thanks @McNeight ! Nuget should be out shortly. Release UnitsNet/5.65.0 · angularsen/UnitsNet Please see the remaining question above regarding SI unit. Other than that, we should be ready for the v6 PR next. |
@McNeight Just a heads up regarding v6 PR:
|
Renamed quantities to have prefix "Electric", marking old name as obsolete and adding new duplicate quantities:
ApparentEnergy
->ElectricApparentEnergy
ApparentPower
->ElectricApparentPower
Capacitance
->ElectricCapacitance
ReactiveEnergy
->ElectricReactiveEnergy
ReactivePower
->ElectricReactivePower
ElectricPotentialAc
ElectricPotentialDc
ElectricAdmittance
(obsolete due to being a complex number, not supported by UnitsNet, recommendingElectricReactance
andElectricSusceptance
instead)Decided against adding
ElectricImpedance
, also being a complex number.New:
ElectricReactance
ElectricSusceptance
EletricCurrent = ElectricApparentPower / ElectricPotential
ElectricPotential = ElectricApparentPower / ElectricCurrent
ElectricAdmittance
:ElectricConductance
:EletricResistance
: