-
Notifications
You must be signed in to change notification settings - Fork 100
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
Dsl units #3129
Conversation
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.
--depends-on ome/bioformats#1379 |
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. |
The adjustment to the upgrade scripts makes sense to me. |
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. |
Removing the breaking label. |
Closing in favor of gh-3099 now that I'm back. |
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