-
Notifications
You must be signed in to change notification settings - Fork 17
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
#59: Added missing units and updated number of units in test #75
Conversation
// public static final Unit<Level<?>> NEPER = addUnit(new ProductUnit<Level<?>>(ONE.multiply(Math.log(1)))); | ||
// public static final Unit<Level<?>> BEL = addUnit(new ProductUnit<Level<?>>(ONE.multiply(Math.log10(1)))); | ||
|
||
// public static final Unit<Level<Pressure>> BEL_SOUND = addUnit( |
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 start saying that this block is wrong, but I didn't know exactly how to make them, if I just use values, quantities (as some of them is in a weird unit as this one 2lg(2 10*-5.Pa)
), and they can't be produced because I can't cast a TransformedUnit in a ProductUnit, I'll see it later. The other complication I had is when I have a multiplication by a number between 2 and 10, I have to use this unit ONE
and keep multiplying it all over the place, isn't it a good idea to create something more flexible?
@@ -723,8 +738,11 @@ public static UCUM getInstance() { | |||
// OTHER LEGACY UNITS: UCUM 4.5 §43 // | |||
// //////////////////////////////////// | |||
/** As per <a href="http://unitsofmeasure.org/">UCUM</a> standard. */ | |||
public static final Unit<Temperature> FAHRENHEIT = addUnit(KELVIN | |||
.multiply(5).divide(9).shift(459.67)); |
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.
@keilw, I didn't understand why you inverted this, any specific reason?
// SECTIONS §44-§46 skipped; implement later if needed // | ||
// /////////////////////////////////////////////////////// | ||
|
||
//////////////////////////////////////////// |
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 note that the other (historical) comments put a space after the first //
. Totally inconsequential! I just noticed it. Less than trivial.
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.
hahaha, yeeah, you're right.. I'm trying to not use any formatter for this project as everything would be a mess on diff. And because of that I forget some little things like this.
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.
Honestly no idea where it first came up. It is not in JScience 5, so could be a formatting tool trying to expand or reduce the number of characters. This can be fixed wherever you spot it. Already did for most of the other unit systems like SI or implementation classes ;-)
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 haven't compared this to the actual UCUM specification, but overall the code looks good I think. @keilw can answer your specific questions, because he's the expert in this area.
Yes, happy to help where I can. I requested a few UCUM units to be added over the past 7 years and some are now in the catalog. |
Note that the units are in comments because, or we don't have a specific unit for that, or I didn't know how to implement (the case I asked your opinion), or there's no definition yet, which is good to at least keep there as comment. |
Some units e.g. @dautelle defined as |
Okay.. that might be helpful, thank you. |
I'll have to look it up in the ISO80k vault, but e.g. |
I just created #76 for including the terms of use somehow in the UCUM bundle (probably as additional license beside BSD for the actual code) We may have to be careful to watch e.g.
but I assume if there are two identical UCUM codes like "litre" and you must expose them by a unique name in Java, there is a slight freedom of adding e.g. "LITRE_A" and "LITRE_B" backed by the exact unchanged values to resolve such redundancies?;-) |
Merge worked, thanks. |
I use tab characters to indent instead of spaces, and if you see something changed on indentation is because there are things like this in the code:
I use the formatter for Globalmentor, I apply it only to when I edit, but if you have that you like you can just provide me a link and I'll use it to this project, whatever you prefer. |
I pushed it again, this time formatting based on an Eclipse setting called MicroProfile |
Oh and I added |
I never tried that And thank you about the units, I said that it was in a block of comments because I wasn't sure of how to implement that, but after that I think I'm ready to make some more units available. |
No description provided.