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.
Hello!
Thank you for sharing this code.
Goal
This pull request is just meant to improve code readability. In the
rhotab
creation part I introduced a function that converts a(n, m)
indices pair into a Noll's indexk
. The explicit definition of such a function makes your code much shorter and clearer, in my opinion.Following the convention in
noll2nm
, I made the indices start at 1, in order to keep the code consistent, so thatnoll2nm(nm2noll(k)) = k
for anyk >= 1
Old tests
The previous tests and this new test succesfully pass on the following configurations:
I didn't run any tests with Python 2.
New tests
I added one test to assert correctness for this new function up to the 4th radial order. No need to test above the 4th radial order since the ordering only depends on n modulo 4.
Don't hesitate to ask if you have any issue.