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

Optional matplotlib dependency #311

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

axelstudios
Copy link

@axelstudios axelstudios commented Mar 18, 2025

This PR refactors all matplotlib imports to be lazily imported with graceful error-handling to separate core functionality from visualization.

Pygfunction can now be installed with optional matplotlib support:

  • pip install pygfunction
  • pip install pygfunction[plot]

Attempting to call a function like borefield.visualize_field() without the plot extra will result in the error:

ImportError: Matplotlib is required for plotting. Install it with pip install pygfunction[plot]

It also fixes a small handful of typos, and updates the minimum matplotlib version for compatibility with NumPy 2.0.

@axelstudios axelstudios force-pushed the task/refactor-matplotlib branch from 8e96aff to 3555f72 Compare March 28, 2025 14:20
@axelstudios axelstudios changed the title Remove matplotlib dependency overhead Optional matplotlib dependency Mar 28, 2025
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.

1 participant