Conversation
|
|
|
With the last commit, the Unrelated to this, the tests are quite slow to run which does not help troubleshooting. I might try to have a go at profiling where most of the time is spent to see if we can speed up things. |
src/omero_cli_render.py
Outdated
| rangelist = [] | ||
| colourlist = [] | ||
| for (i, c) in newchannels.iteritems(): | ||
| i += 1 |
There was a problem hiding this comment.
I am still unclear why this offset is necessary. Looking at IDR/idr0047-neuert-yeastmrna#11 (comment), could the confusion come from the assumption that the channels loaded from the YAML/JASON files are 0-indexed?
There was a problem hiding this comment.
Ah, so that's why the export via 'info' command import via 'set' didn't work. Ok, maybe it's better in that case to not increase by one, but fix the output of the 'info' command.
|
Removed the General remark: With this PR |
src/omero_cli_render.py
Outdated
| else: | ||
| cindices.append(i) | ||
| rangelist.append([c.min, c.max]) | ||
| rangelist.append([c.start, c.end]) |
There was a problem hiding this comment.
Addtionally checking here for c.min and c.max here, could make the changes of this PR backward compatible. The question then is, what should be done if min/max and start/end are specified:
- min/max overrides start/end
- start/end take precedence
- throw an error
There was a problem hiding this comment.
I think we will have to handle previous versions of the YML files especially since we extensively used this format in IDR.
My understanding is that below are the proposed behaviors for the two format versions:
- version 1 (current): channel
min/maxsets the channel window start/end, channelstart/endignored (or maybe simply not part of the render YML/JSON specification?) - version 2 (current): channel
start/endsets the channel window start/end,min/maxis now either a no-op or not present for the YML/JSON specification
One way we might consider to make this unambiguous would be to start introduce a version: 2 field in the YAML/JSON specification. The question now remains: what would happen when such version field is absent? Options are:
- always default to
version: 1. This means that a YML file withstart/endwithoutversion: 2would probably not behave as expeced. - as suggested above, detect and error if
start/endandmin/maxare both found in the format. A potential implication is that a YML file with onlystart/endand noversionshould be auto-detected as version 2 while a YML file with onlymin/maxand noversionwould be autodetected as version 1.
There was a problem hiding this comment.
I'd vote for the last option. Add a version field. If it's not specified start/end implies version 2, min/max implies version 1, if both specified error.
|
Shall I go ahead with option "Add a version field. If it's not specified start/end implies version 2, min/max implies version 1, if both specified error." ? |
The 'version' field enables backwards compatibility; 1-indexed output makes a it possible to export via info command and import via set command.
|
That is weird... if I move the failed test (which can't have anything to do with the PR actually) to the beginning, it passes. |
|
It's probably not critical yet, but moving forward if we want to do this more often, I'd imagine separating out the logic for each version into a helper will help us from breaking older versions (even at the cost of slightly higher duplication) cF hdfstorageV1 vs hdfstorageV2 |
sbesson
left a comment
There was a problem hiding this comment.
A few inline comments. Happy to discuss them over voice. Otherwise, 👍 for integrating these changes as the tests are green.
Thinkinof the next steps before omero-cli-render 0.4.0 is released, we will need:
- a freeze of the specification for version 2 of the rendering format
- a review of the CLI command helps and the
info/setround-tripping - possibly a review of the test coverage
| """ | ||
|
|
||
| # Current version for specifying rendering settings | ||
| currentSpecVersion = 2 |
There was a problem hiding this comment.
maybe capitalize this e.g. SPEC_VERSION
|
|
||
| # Previously min/max was used to set the channel window start/end | ||
| # From version 2 on start/end will be used. | ||
| if 'version' not in data: |
There was a problem hiding this comment.
Up for discussion, the alternative to handling the versioning in the command would be to move this logic up to ChannelObject.init_from_dict() i.e. serialize to a unified ChannelObject representation independently of the input version.
This might lead us to considerations along the lines of #15 (comment) i.e. start have versioned loaders.
There was a problem hiding this comment.
I can write json-schema if it's helpful ;)
|
Briefly discussed with @dominikl and @joshmoore. Merging this and tagging as |
|
Pre-release now available as https://pypi.org/project/omero-cli-render/0.4.0a1/ |
This PR fixes some bugs I noticed while trying to export ('render info') and apply ('render set') the rendering settings of idr0044:
set_active_channelsmethod. I added a workround earlier, which is not buggy (afaik) but I changed it a bit, so its clearer and safer.Test: With this PR it should now be possible to adjust the rendering settings of an image in OMERO.web. Then export them with
./omero render info --style yaml Image:ID > renderingsettings.ymlAnd then reapply them with./omero render set Image:ID renderingsettings.yml. The renderings settings should then be the same.This PR adds support for a 'version' field in the yml/json. If rendering settings specify start/end and min/max you have to add the version, otherwise it's not clear which values to use for the channel window start/end. Earlier versions used min/max, but with this version (version 2) start/end will be used.