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

Dsl units #3129

Closed
wants to merge 23 commits into from
Closed

Dsl units #3129

wants to merge 23 commits into from

Conversation

jburel
Copy link
Member

@jburel jburel commented Oct 22, 2014

This PR replaces gh-3099 so it can be taken out of breaking. Few commits added to fix update scripts.
cc @joshmoore @qidane @mtbc @sbesson

joshmoore and others added 22 commits October 8, 2014 18:02
This commit introduces the ome.model.unit.Time class
which contains a double value and a string unit for
representing time durations. The only location which
makes use of this is PlaneInfo.exposureTime. "ms" is
hard-coded until the xsd-fu unit support is in place.
Also adds the TimeI implementation for the Python and C++
language bindings, including object factories and IceMapper code.
The Java implementation is also an implementor of `ModelBased` so
that IceMapper can convert back and forth to ome.model.units
instances.

For the next unit implementation (i.e. `Length`), it will likely
be better to introduce code generation of the `ome.model.units`
implementations rather than hand-writing them.

Note: a workaround was needed for the generation of unique
constant names in Ice since constants must vary in more than just
capitalization which fails for SI prefixes like M and m.
This commit adds an implicit dependency on the updated schema.
Since there planeInfo.deltaT and pixels.timeIncrement have been
modified to type Time, that takes place here as well.

Note: this runs into an issue with hibernate (HHH-4329) in which
the nice foreign key naming for embedded objects has to be
removed. I'll attempt fixing that elsewhere.

--depends-on ome/bioformats#1265
The few unit types are now corrected by hand since there
is currently no way to code generate them. The map types
were also missing properly named FKs, but these could be
handled by the introduction of a new annotation.

Note: a check has now been added to travis-build which
should prevent generated FK constraint names from being
included in a schema.
Java's FileReader and FileWriter use the default local
encoding which led to some .ice files being created with
latin1 encoding. Ice then understandably couldn't handle
the micro symbol failing the build.

See:
http://stackoverflow.com/questions/6998905/java-bufferedwriter-object-with-utf-8
Ant's `<copy>` task uses the default encoding as well,
meaning that the splitting of the combined file which
DSLTask created with UTF-8 converted back to LATIN1
when the locale was C or similar. Further, charAt was
not sufficient for detecting the micro symbol under C
and so codePointAt is now used.
Exceptions were being thrown on the unloaded Time and UnitsTime
objects in the Images graph. These will now need to be actively
load by users.
Workaround for odd Hibernate issue in which
complex plate/well/acquisition graphs with
several PlaneInfo's reusing the same units
failed to import.
4 tests were failing due to the addition of the Time
elements on planeInfo. This is a deeper Hibernate issue
which will require further investigation.
@jburel
Copy link
Member Author

jburel commented Oct 22, 2014

--depends-on ome/bioformats#1379

@jburel
Copy link
Member Author

jburel commented Oct 22, 2014

adding breaking label so we can test the new infrastructure for breaking i.e. mainly tests that the update scripts do not corrupt the DB.

@mtbc
Copy link
Member

mtbc commented Oct 23, 2014

The adjustment to the upgrade scripts makes sense to me.

@mtbc
Copy link
Member

mtbc commented Oct 23, 2014

Works fine on trout breaking. Tried with pre-FS and post-FS images, with images with no interesting metadata, and with images with exposure time and δt set, all looked good.

@jburel
Copy link
Member Author

jburel commented Oct 24, 2014

Removing the breaking label.

@jburel jburel removed the breaking label Oct 24, 2014
@joshmoore
Copy link
Member

Closing in favor of gh-3099 now that I'm back.

@joshmoore joshmoore closed this Oct 27, 2014
@jburel jburel deleted the dsl-units branch October 29, 2014 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants