-
Notifications
You must be signed in to change notification settings - Fork 24
feat: Migrate to raysect v0.9
#486
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
feat: Migrate to raysect v0.9
#486
Conversation
…aysect version to 0.9.1.*
…umpy versions, and upgrade Raysect to 0.9.*
…and targettedpixel modules
Mateasek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pushing this @munechika-koyo. To me it seems good to go, but let's wait for @jacklovell to look at it.
|
@munechika-koyo , I just realised you didn't add the chages into the changelog, could you please add it? Thank you |
|
@Mateasek, I added some. |
|
Dear @munechika-koyo, thanks for this contribution. The dependency update is definitely useful and will improve installation experience greatly. I do appreciate your effort put into the required changes. Generally, I think that the dependency changes should be implemented ASAP. Therefore, I would really encourage you to focus only on code changes related to the main aim and creating additional PRs for the other. Alternatively, you could create a new lightweight PR with only the dependency changes. Should the version number be increased also for this minimal change? (1.6.0.dev2 ?) I do have some more specific comments regarding the other proposed changes. I would suggest to try minimising the formatting changes that do not improve readability, like spaces or import reordering (only those requiring reasonable amount of effort to remove). In my opinion it is ok to keep some, even though they are unrelated to dependency update. I would also keep changes like Regarding proposed change from targetted to targeted, I am strongly opposed to make this change as part of this PR. Firstly, in my opinion, this change will not improve the code significantly enough to justify new major version itself. Secondly, it seems unrelated to the topic of this PR. However, I am open to discuss this change as part of a new major release. I would suggest to create a new PR separating this change or definitely wait for @jacklovell to comment on this issue. |
|
Another approach would be to also create descendant classes with old names (targetted) and add a deprecation warning to them. This would allow to have both new and old naming and also clearly indicate to users that a change is coming, eventually. |
|
@skuba31 Thank you for your helpful suggestions! Regarding the lint/format, I will suggest using a unified management tool like Regarding breaking changes, like an API name change, I think it is ok to handle them in a minor version update as well if we follow other package rules ( |
|
I like the idea of keeping both |
|
Although it might be better to have it in a single PR instead of breaking it in two. |
|
@munechika-koyo thank you for incorporating the suggested changes. I think that this PR is ready to go now. I leave to your consideration whether you would merge #487 back to this PR as @Mateasek suggested. I am fine with both options. Combination would make sense as the change is motivated by transition to Raysect 0.9 but it could lead to additional discussion prolonging the processing of this PR. |
jacklovell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks good. Some minor changes requested and then I think it's good to go.
I agree about limiting the scope of this PR to just dependency updates: other changes should be dealt with in separate PRs (and some should really have TMC discussions first too).
| run: python -m pip install --prefer-binary setuptools cython~=3.1 numpy>=2 scipy matplotlib "pyopencl[pocl]>=2022.2.4" | ||
| - name: Install Raysect from pypi | ||
| run: pip install raysect==0.8.1.* | ||
| run: pip install raysect==0.9.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's a need any longer to install raysect separate from the rest of the dependencies. A long time ago it had to come from Github sometimes and PyPI other times, so made sense to deal with it differently, but it's about time this was cleaned up. Put it in the "Install Python dependencies" step.
Also, should be raysect==0.9.1 since that's what we explicitly depend on in pyproject.toml and setup.py.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with you.
Moreover, we might be better off utilizing the dependency info that is configured in only one place (such as setup.py in this case).
Should we use the following command?:
python -m pip install -e ".[opencl]"| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| numpy-version: ["oldest-supported-numpy", "'numpy<2'"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should continue supporting (and therefore testing against) the oldest Numpy available for each Python version. Not all environments (HPC or other experiment analysis clusters for example) may be amenable to upgrading numpy, possibly due to other packages, so Cherab should where possible not require features in very recent Numpy versions. Testing against old versions is to guard against accidentally using new Numpy functions where they're not always required.
oldest-supported-numpy was a convenient way of doing this, but for now the matrix should be updated with the oldest numpy version supported by each Python release. Awkward the first time, but should be quick to modify on each new Python release.
|
Good job @munechika-koyo, thank you for implementing this change, I think it is really needed. I'm happy to merge this if others (@jacklovell, @skuba31 ) have no further comments. |
I agree, I have no further comments. |
|
Since there are no more requests and comments I'm merging this. |
Summary
I applied some changes to migrate
cherabintoraysectv0.9 andnumpyv2Key changes
Rename "targetted" into "targeted"Add a deprecation warning for APIs related to the "targetted" name.raysect,numpy, andcythonNote
This PR might have breaking changes based on module, class renaming, so we probably need to consider bumping up the
cherab's version as well.