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

svgutils 0.3.2 breaks compose_view (possibly others) #595

Closed
effigies opened this issue Jan 5, 2021 · 4 comments · Fixed by #599
Closed

svgutils 0.3.2 breaks compose_view (possibly others) #595

effigies opened this issue Jan 5, 2021 · 4 comments · Fixed by #599

Comments

@effigies
Copy link
Member

effigies commented Jan 5, 2021

MRIQC release 0.16.0 was held up by a CI failure:

  File "/usr/local/miniconda/lib/python3.7/site-packages/niworkflows/viz/utils.py", line 360, in compose_view
    fig = SVGFigure(width, heights[:nsvgs].sum())
  File "/usr/local/miniconda/lib/python3.7/site-packages/svgutils/transform.py", line 242, in __init__
    self._width = width.value
AttributeError: 'numpy.int64' object has no attribute 'value'

Opened an issue at btel/svg_utils#57 to see what the correct fix is, but the short term fix is to pin svgutils 0.3.1.

mgxd added a commit to mgxd/niworkflows that referenced this issue Jan 6, 2021
@effigies
Copy link
Member Author

effigies commented Jan 7, 2021

Looks like the fix for 0.3.2 is to use Unit objects provided by svgutils: https://github.com/btel/svg_utils/pull/58/files#diff-e8aa6d811244eff36276b6f2042973e5b5b30db429f997288e45bf0ce5be717dR55

@mgxd
Copy link
Contributor

mgxd commented Jan 11, 2021

After the fix btel/svg_utils#58, there is still a piece that needs to be updated within our code:

The FigureElement.moveto scale parameter has been extracted into scale_x and scale_y parameters. I think we should be fine just adjusting scale_x and leaving scale_y as None.

EDIT: relevant line

r.moveto(0, yoffset, scale=scales[i])

@effigies
Copy link
Member Author

Agree, though we'll then need to depend on >=0.3.3 or try/except to allow a wider range of versions. Frustrating that they broke their API on a patch release.

@oesteban
Copy link
Member

oesteban commented Jan 11, 2021

We hit this problem in dMRIPrep already (nipreps/dmriprep#144 (comment)), I don't know what @slimnsour did, whether he reported this or not.

EDIT: I see you guys have all figured out :D

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 a pull request may close this issue.

3 participants