Skip to content
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

Same Units considered different #3

Closed
3 tasks done
keilw opened this issue Aug 6, 2017 · 15 comments
Closed
3 tasks done

Same Units considered different #3

keilw opened this issue Aug 6, 2017 · 15 comments

Comments

@keilw
Copy link
Member

keilw commented Aug 6, 2017

See unitsofmeasurement/uom-se#164

@keilw keilw changed the title Same units considered different Same Units considered different Aug 6, 2017
@keilw
Copy link
Member Author

keilw commented Aug 19, 2017

Related to #4

@keilw keilw added this to the 2.0 milestone Dec 28, 2017
@andi-huber
Copy link
Member

UnitConverters PiMultiplierConverter and PiDivisorConverter can be consolidated into a single PiPowerConverter, that is similar to the existing PowerConverter but uses Math.PI as base.
This would simplify the composition table and also allow for simpler composition implementation.

@keilw
Copy link
Member Author

keilw commented Apr 22, 2018

I would not see them as extensions to PowerConverter but PiMultiplierConverter does a lot similar to MultiplyConverter.

@andi-huber
Copy link
Member

@keilw yes, these converters all represent multiplication. However, PiMultiplierConverter and PiDivisorConverter do know how to properly handle multiplication of BigDecimal with PI or 1/PI, which the MultiplyConverter does not.

To clarify what I'm aiming for is that composition of these Pi converters can be simplified eg
PI_MUL * PI_MUL * PI_MUL -> PI^3
PI_DIV * PI_DIV * PI_DIV -> PI^-3
PI_MUL * PI_MUL * PI_DIV * PI_DIV -> PI^0 = IDENTITY

@keilw
Copy link
Member Author

keilw commented Apr 23, 2018

Unfortunately 40 tests are failing, I disabled the class in question, because the Indriya build on master should not constantly fail. I personally don't have a problem with a name like PiPowerConverter, but the JavaDoc should say more about the "power" aspect, if it just reads "multiply by Pi" the name seems misleading.

@andi-huber
Copy link
Member

Started a wiki page to document the background required for solving this issue.
https://github.com/unitsofmeasurement/indriya/wiki/Unit-Equivalence

@keilw
Copy link
Member Author

keilw commented Apr 27, 2018

Great, thanks. Some of that may eventually go either into the Spec or UoM Guide Book.

@andi-huber
Copy link
Member

Extending the corresponding wiki page with thoughts on Simplification Rules
https://github.com/unitsofmeasurement/indriya/wiki/Unit-Equivalence#simplification-rules

I conclude 2 things:

  1. We need some kind of an 'intermediate normal-form' that keeps all information of the original transformations used for a composition, without loss of precision, so that we can do further compositions and simplifications properly. (That's the state of the current implementation, it yields such an intermediate normal-form.)
  2. We need a 'fully simplified normal-form' for actual calculus and test for equivalence. (Also applying simplification-rules as mentioned above.)

@keilw
Copy link
Member Author

keilw commented Jun 8, 2018

Some of it may be subject to a Spec chapter.

@keilw keilw removed the to do label Jul 6, 2018
@andi-huber
Copy link
Member

@keilw
Copy link
Member Author

keilw commented Apr 13, 2019

@andi-huber Is there any more work here or are the other bullet points also done?

@andi-huber
Copy link
Member

We have implemented Unit.equals in RI according to the write-up https://github.com/unitsofmeasurement/indriya/wiki/Unit-Equivalence.

The other bullet points are not done, not by me.

@keilw
Copy link
Member Author

keilw commented Apr 14, 2019

The part about the Specification is on the critical path towards 2.0 (https://www.bipm.org/en/about-us/ shows, there will be a critical maintenance of the site between April 19 and 23, I bet it has something to do with SI reforms and it's good to wait until after that before we finalize the sped and possibly update links that may have changed)

The other tasks may also happen later if necessary.

@keilw
Copy link
Member Author

keilw commented May 12, 2019

Anything still open here?

@keilw
Copy link
Member Author

keilw commented Jul 7, 2019

Created unitsofmeasurement/uom-guide#5 for item 2, closing this.

@keilw keilw closed this as completed Jul 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants