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

DM-14356: Add matplotlib.figure.Figure storage to PosixStorage. #92

Merged
merged 2 commits into from May 26, 2018

Conversation

TallJimbo
Copy link
Member

Matplotlib figures cannot be retrieved using the butler, but 'put' should now work.

Note that this storage actually only requires that the object being saved have a savefig method with the same behavior as matplotlib's.

Raises
------
ValueError
Raised if the file
Copy link
Contributor

Choose a reason for hiding this comment

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

Trailing sentence. I also don't see a raise below.

Copy link
Member Author

Choose a reason for hiding this comment

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

I just removed the whole section; I don't know what I was thinking.

# default.
ext = None
obj.savefig(logLoc.locString(), format=ext)
return
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the return meant to be indented to within the with SafeFilename here?

Copy link
Contributor

Choose a reason for hiding this comment

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

The empty return here serves no purpose, and should be removed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup, this is a copy-paste relic. I'll go remove the returns I cargo-culted too.

logLoc = LogicalLocation(locationString, additionalData)
# SafeFilename appends a random suffix, which corrupts the extension
# matplotlib uses to guess the file format.
# Instead, we strip off the extension from the original location
Copy link

Choose a reason for hiding this comment

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

I would say "extract the extension".
"strip off the extension" implies it's removed from the location name.

Copy link

@wmwv wmwv left a comment

Choose a reason for hiding this comment

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

LGTM

Matplotlib figures cannot be retrieved using the butler,
but 'put' should now work.

Note that this storage actually only requires that the object
being saved have a `savefig` method with the same behavior
as matplotlib's.
@TallJimbo TallJimbo merged commit 1e7c341 into master May 26, 2018
@ktlim ktlim deleted the tickets/DM-14356 branch August 25, 2018 06:14
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.

None yet

4 participants