Skip to content

Conversation

@zachtheyek
Copy link

This PR contains the following changes:

  1. In examples/voyager.ipynb and tutorial/blimpy_voyager_tour.ipynb, moved %matplotlib inline call to after the blimpy import.
  • This was motivated by the observation that blimpy resets the matplotlib backend to agg on import. To verify, in a fresh kernel, run:
%matplotlib inline
import matplotlib
print("Backend right after magic:", matplotlib.get_backend())

import blimpy     
print("Backend after importing blimpy:", matplotlib.get_backend())
  • This is important, since agg is a non-interactive, file-only renderer. In other words, it prevents plots from being displayed to the notebook/screen.
  • %matplotlib inline resets the backend to module://matplotlib_inline.backend_inline, but the previous sequencing was in the wrong order.
  1. In examples/voyager.ipynb and tutorial/blimpy_voyager_tour.ipynb, changed the "get data" portions to first check whether the data exists, and if not, download it to the CWD.
  • Pretty straightforward change aimed at blimpy beginners by making quality of life better when running the notebooks out-of-the-box.
  1. Added an environment.yml file containing the same dependencies listed in requirements.txt, alongside setup instructions in README.md.
  • Doesn't affect core functionality, just gives users another option for setting up blimpy.

…py import to avoid matplotlib backend override. (2) Added more robust data checking before downloading voyager data
@zachtheyek
Copy link
Author

zachtheyek commented Sep 30, 2025

edit: i suspect the %matplotlib inline change (#1) is related to #279

imo if there's no reason to reset the matplotlib backend, a longer-term solution would be to remove that behavior from the core blimpy functionality altogether. perhaps it was unintentionally set to agg somewhere where figures are saved / loaded into memory? just a hunch

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