quality of life fix for pip users#1289
Open
James11222 wants to merge 2 commits into
Open
Conversation
added 2 commits
March 27, 2026 23:14
Collaborator
|
Thanks for the PR! I think it's a great idea to allow this selection of packages. I have not reviewed the code yet so just two quick comments:
Once #1290 is merged I'll come back to this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds quality-of-life support for pip users by adding optional dependency groups in
pyccl, making it easier for users to install only the packages they need for specific functionalities (e.g., Boltzmann codes, perturbation theory, emulators). It updates the documentation to explain these new installation options, improves error handling for missing optional dependencies, and sets the default transfer function based on installed packages.Existing Issue this Fixes: when you install the base package via pip, Boltzmann codes are not installed but the default
transfer_functioninccl.Cosmology()is'boltzmann_camb'. This creates a problem when you go to use the cosmology object in components of the halo model for example. Now with these changes, I've made the default behavior be that if the Boltzmann codes are not installed,'eisenstein_hu'is the default, otherwise camb is the default (I believe the default behavior in the conda installation).Dependency management and installation:
boltzmann,pt,emulators,full) topyproject.tomlfor easier installation of extra features.README.mdandreadthedocs/source/installation.rstto document the new extras and clarify default behaviors depending on installed packages. [1] [2] [3] [4] [5]Default behavior and configuration:
transfer_functionis now set based on whethercambis installed:'boltzmann_camb'if available, otherwise'eisenstein_hu'. [1] [2]Error handling improvements:
pyccl/boltzmann.pyto raise aCCLErrorwith clear installation instructions if a required optional dependency (CAMB, CLASS/classy, ISiTGR) is missing, instead of a genericImportError. [1] [2] [3]CCLErrorwhen optional dependencies are missing.