Repository navigation
Preserve module name of jitted class - #8659
Merged
Merged
Conversation
Member
|
@neilflood thank you for the pull-request. I have labelled it as "Ready for Review" and it will hopefully bes assigned a reviewer at the dev meeting next Tuesday. As a heads up, the Numba team is very busy with end of year tasks so it is unlikely that this will receive any more attention before mid January 2023. Thank you in advance for your patience! PS: I can note at this stage however, that adding an explicit test will most definitely be required and is not optional. |
Contributor
Author
|
@esc Thanks for that. Very good, I will work out a suitable test and add to test_jitclasses.py. :-) |
Member
|
Congrats on getting your first contribution to Numba! |
Contributor
Author
|
Thank you! :-) |
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.
A normal Python class has a
__module__attribute which tells what module it comes from. However, when a class is decorated with@jitclass, this changes to benumba.experimental.jitclass.base, and so the class looks like it has been imported from some other module.Documentation tools such as the Python
help()function, or Sphinx, will omit classes which are not from the module being processed, and so documentation for@jitclassclasses is skipped.The proposed change carries the module name over from the Python class to the
@jitclassversion, and thus allows such documentation tools to include them. This will also be consistent with functions decorated with@jit, as they keep their module name unchanged.I ran the full test suite with this change, using pre-built binaries (0.56.3) from conda, and it does not seem to affect anything. I was unable to set up a full test environment using conda (apparently because of glibc version conflicts??), so could not test with the current HEAD, but am hopeful that nothing else will be affected.
It was not clear if this change would be worth an explicit test, but happy to try and think of something if reviewers think it important to do so.