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

added Matplotlib data saver #526

Merged
merged 2 commits into from
Nov 11, 2023
Merged

added Matplotlib data saver #526

merged 2 commits into from
Nov 11, 2023

Conversation

zilto
Copy link
Collaborator

@zilto zilto commented Nov 9, 2023

Added a DataSaver to save matplotlib objects of type matplotlib.figure.Figure, i.e., resulting from plt.figure() and plt.subplots().

Changes

Added a matplotlib_extensions.py with the DataSaver class and added it to the registry

How I tested this

Added a test to check the DataSaver properly writes to a file. I manually validated that the output file was correct.

Notes

  • The Matplotlib and the Plotly DataSaver accept as path argument objects of type IO (i.e., in-memory files, streams, etc.) which may fail when hamilton.io.utils.get_file_metadata() is called.

Checklist

  • PR has an informative and human-readable title (this will be pulled into the release notes)
  • Changes are limited to a single goal (no scope creep)
  • Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future TODOs are captured in comments
  • Project documentation has been updated if adding/changing functionality.

@zilto zilto requested a review from skrawcz November 9, 2023 22:27
@zilto zilto added the enhancement New feature or request label Nov 9, 2023
Copy link
Contributor

sweep-ai bot commented Nov 9, 2023

Apply Sweep Rules to your PR?

  • Apply: All new business logic should have corresponding unit tests.
  • Apply: Refactor large functions to be more modular.

@skrawcz
Copy link
Collaborator

skrawcz commented Nov 9, 2023

E AttributeError: module 'matplotlib' has no attribute 'artist'

?

@skrawcz skrawcz merged commit 8463800 into main Nov 11, 2023
@skrawcz skrawcz deleted the feature/matplotlib_datasaver branch November 11, 2023 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants