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 index k. 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 that noll2nm(nm2noll(k)) = k for any k >= 1
Old tests
The previous tests and this new test succesfully pass on the following configurations:
[x] Python 3.9 on Windows
[x] Python 3.8 on Linux in Windows Subsystem for Linux
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.
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:
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.