-
Notifications
You must be signed in to change notification settings - Fork 243
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
Improve the units API #1684
Improve the units API #1684
Conversation
This is very convenient when coding API against Quantity variables without knowing their type; otherwise, one must needlessly special case.
I don't love the |
As an aside, it is a shame that the OME codebase could not adopt a standard units library. We will need to create an integration layer to bridge OME units to and from SciJava units. See scifio/scifio-ome-xml#23 |
OK, I see that there are a bunch of new |
I'd prefer to see 17300c4 reverted, but the other changes read fine. |
@melissalinkert Are there ever two fields in OME-XML that use the same quantity but different units? If so, I will purge the commit. But if not, what's the harm? If we do eliminate that commit, I would still like to see shorter API calls to create new quantities. As things stand, it is a little verbose to write |
|
17300c4
to
d16899c
Compare
Thanks @melissalinkert, I purged 17300c4 from the branch. |
Thanks. All reads OK now, just waiting on inclusion in the merge builds. |
Specifically, this branch makes the
Quantity
superclass nicer to work with, and adds some helpful constructors with default unit specifications, to avoid errors when converting downstream code to the new API.See here for an example where these changes would be helpful.
/cc @qidane
--no-rebase