Conversation
rowleya
left a comment
There was a problem hiding this comment.
This looks helpful, but it would also be useful if setup.py had an optional dependency on matplotlib, as otherwise it will be force-required. Some information on this here: https://setuptools.pypa.io/en/latest/userguide/dependency_management.html#optional-dependencies
|
I’ve now added |
|
This sounds good... do you need to push this still? |
|
Yes, I just need to push the branch so the PR includes the changes. Once pushed, plotting support will be installable via pip install csa[plot]. |
mdjurfeldt
left a comment
There was a problem hiding this comment.
Hi @sanchalitorpe-source, before making a decision on whether the form of this change is a good idea, you need to commit the changes to setup.py. Also, please use the same formatting style as in the rest of the code, i.e. for example foo (a1, ...). However, you are correct that there shouldn't be a space between an array and its subscript, so g[i] is the correct formatting.
|
Hi @mdjurfeldt, Please let me know if this looks good now. |
rowleya
left a comment
There was a problem hiding this comment.
I can approve from my side given the changes to setup.py
|
All requested changes have been implemented: setup.py now marks matplotlib as optional via extras_require, code formatting is aligned, and plotting functions raise a clear error only when used. This PR is ready to merge. |
This PR makes plotting optional by deferring matplotlib imports and raising a clear error only when plot functions are used.
This allows installing and using CSA in environments without matplotlib (e.g. CI, minimal installs), addressing issue #11.