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

Make 'info' output yamllint compatible #26

Merged
merged 1 commit into from
Feb 12, 2019
Merged

Conversation

dominikl
Copy link
Member

@dominikl dominikl commented Feb 8, 2019

Fixes #19

Makes the 'info' command output yamllint compatible.

Test:
./omero render info --style yaml Image:123 > test.yml
Then yamllint test.yml shouldn't report any errors/warnings.

Copy link
Member

@sbesson sbesson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using this branch, tested against a public IDR image

(render) sbesson@ls30630:render $ ~/Downloads/OMERO.py-5.4.7-ice36-b93/bin/omero login public@idr.openmicroscopy.org
ERROR:omero.gateway:No Pillow installed, line plots and split channel will fail!
Password:
Created session for public@idr.openmicroscopy.org:4064. Idle timeout: 10 min. Current group: Public
(render) sbesson@ls30630:render $ ~/Downloads/OMERO.py-5.4.7-ice36-b93/bin/omero render info  Image:4007801
ERROR:omero.gateway:No Pillow installed, line plots and split channel will fail!
Using session for public@idr.openmicroscopy.org:4064. Idle timeout: 10 min. Current group: Public
rdefv1: model=color, z=494, t=265
tiles: False
ch0: active=True,color=00FF00,label=H2B-eGFP,min=0.0,start=0.0,end=1093.0,max=65535.0
ch1: active=True,color=FF0000,label=myr-tdTomato,min=0.0,start=0.0,end=439.0,max=65535.0

(render) sbesson@ls30630:render $ ~/Downloads/OMERO.py-5.4.7-ice36-b93/bin/omero render info  Image:4007801 --style yaml
ERROR:omero.gateway:No Pillow installed, line plots and split channel will fail!
Using session for public@idr.openmicroscopy.org:4064. Idle timeout: 10 min. Current group: Public
---
channels:
    1:
        active: true
        color: 00FF00
        end: 1093.0
        label: H2B-eGFP
        max: 65535.0
        min: 0.0
        start: 0.0
    2:
        active: true
        color: FF0000
        end: 439.0
        label: myr-tdTomato
        max: 65535.0
        min: 0.0
        start: 0.0
greyscale: false
t: 266
version: 2
z: 495
(render) sbesson@ls30630:render $ ~/Downloads/OMERO.py-5.4.7-ice36-b93/bin/omero render info  Image:4007801 --style yaml > out.yml
ERROR:omero.gateway:No Pillow installed, line plots and split channel will fail!
Using session for public@idr.openmicroscopy.org:4064. Idle timeout: 10 min. Current group: Public
(render) sbesson@ls30630:render $ bin/yamllint out.yml 
(render) sbesson@ls30630:render $ cat out.yml 
---
channels:
    1:
        active: true
        color: 00FF00
        end: 1093.0
        label: H2B-eGFP
        max: 65535.0
        min: 0.0
        start: 0.0
    2:
        active: true
        color: FF0000
        end: 439.0
        label: myr-tdTomato
        max: 65535.0
        min: 0.0
        start: 0.0
greyscale: false
t: 266
version: 2
z: 495
(render) sbesson@ls30630:render $ ~/Downloads/OMERO.py-5.4.7-ice36-b93/bin/omero render info  Image:4007801 --style json
ERROR:omero.gateway:No Pillow installed, line plots and split channel will fail!
Using session for public@idr.openmicroscopy.org:4064. Idle timeout: 10 min. Current group: Public
{"channels": {"1": {"end": 1093.0, "min": 0.0, "color": "00FF00", "max": 65535.0, "label": "H2B-eGFP", "start": 0.0, "active": true}, "2": {"end": 439.0, "min": 0.0, "color": "FF0000", "max": 65535.0, "label": "myr-tdTomato", "start": 0.0, "active": true}}, "greyscale": false, "version": 2, "z": 495, "t": 266}

As opposed to

(omeropy) sbesson@ls30630:~ $ ~/Downloads/OMERO.py-5.4.7-ice36-b93/bin/omero render info  Image:4007801 --style yaml > /tmp/out.yml
ERROR:omero.gateway:No Pillow installed, line plots and split channel will fail!
Using session for public@idr.openmicroscopy.org:4064. Idle timeout: 10 min. Current group: Public
(omeropy) sbesson@ls30630:~ $ ~/venvs/flake8/bin/yamllint /tmp/out.yml 
/tmp/out.yml
  1:1       warning  missing document start "---"  (document-start)
  2:81      error    line too long (88 > 80 characters)  (line-length)
  3:5       error    wrong indentation: expected 6 but found 4  (indentation)
  4:81      error    line too long (81 > 80 characters)  (line-length)
  5:5       error    wrong indentation: expected 6 but found 4  (indentation)
  7:1       error    too many blank lines (1 > 0)  (empty-lines)

(omeropy) sbesson@ls30630:~ $ cat /tmp/out.yml 
channels:
  0: {active: true, color: 00FF00, end: 1093.0, label: H2B-eGFP, max: 65535.0, min: 0.0,
    start: 0.0}
  1: {active: true, color: FF0000, end: 439.0, label: myr-tdTomato, max: 65535.0,
    min: 0.0, start: 0.0}
greyscale: false

with the current version.

I have extensions to the info --style integration tests to compare the output but I propose to merge this and open as a follow-up PR before cutting a patch release unless you would rather combine the code and the tests here.

@sbesson sbesson merged commit 06ebc7a into ome:master Feb 12, 2019
@sbesson sbesson added this to the 0.4.1 milestone Feb 12, 2019
@sbesson
Copy link
Member

sbesson commented Feb 13, 2019

Now released as https://pypi.org/project/omero-cli-render/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants