Skip to content

Remove matplotlib dependency#264

Merged
troyraen merged 1 commit intomainfrom
raen/spherex/reduce-dependencies
Feb 26, 2026
Merged

Remove matplotlib dependency#264
troyraen merged 1 commit intomainfrom
raen/spherex/reduce-dependencies

Conversation

@troyraen
Copy link
Copy Markdown
Contributor

The environment created by conda-sphere_sdt.yml for the SPHEREx source discovery tool is about 1.2G. That's pretty large, which makes it more cumbersome to work with. I looked into whether we could reduce the size and found that matplotlib is being installed but not used. Removing it reduces the size of the environment by about a third, down to 770M.

I tested this on fornax and see no difference in the source discovery tool notebook when running in an environment built by the current conda-sphere_sdt.yml vs the one in this PR that removes matplotlib. I'm checking with @afaisst to make sure I'm not missing something.

@troyraen troyraen requested a review from afaisst February 26, 2026 04:26
@troyraen troyraen added maintenance General maintenance of the content and/or infrastructure content: spherex Content related issues/PRs for notebooks with SPHEREx relevance labels Feb 26, 2026
@troyraen troyraen self-assigned this Feb 26, 2026
@troyraen
Copy link
Copy Markdown
Contributor Author

@afaisst confirmed that matplotlib isn't actually used and thinks it can safely be removed. He's away on travel for a couple weeks. Can you review the PR @bsipocz, or would you like me to ask someone else?

@troyraen troyraen requested a review from bsipocz February 26, 2026 08:29
Copy link
Copy Markdown
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

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

Looks good, though you may want to experiment a little bit with the base package and see how badly the installs are bloated

- bokeh
- ipykernel
- ipywidgets
- matplotlib
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yes, this sounds reasonable. OTOH, I'm not sure if the users of this tool would need mpl for their work that would be beyond running the notebook as is.

A compromise could be to use the base package (called matplotlib-base) that doesn't install optional dependencies.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think users can install that if they want it. I'd prefer to keep this file limited to what's needed by the notebook.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

sounds good for now.

The downside of leaving basic installs to the users is the bloated overall size -- e.g. if most of them install mpl then it would be more optimal to provide it centrally than having it take up space in most of the users directories.

@troyraen troyraen merged commit 79c59c7 into main Feb 26, 2026
8 checks passed
@troyraen troyraen deleted the raen/spherex/reduce-dependencies branch February 26, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

content: spherex Content related issues/PRs for notebooks with SPHEREx relevance maintenance General maintenance of the content and/or infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants