Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a variable re-use issue in the power spectrum calculation by renaming intermediate variables during the particle folding process and updates the corresponding docstrings. Key changes include:
- Introducing new temporary variables (e.g. x_pos_scaled) in deposit to avoid re-using the original coordinate variables.
- Updating the docstrings for deposit and deposit_parallel to clarify the scaling of the positions.
- Removing extraneous characters from the parameter descriptions.
Comments suppressed due to low confidence (4)
swiftsimio/visualisation/power_spectrum.py:40
- The docstring for parameter 'y' incorrectly references 'box_x'. Please update it to 'box_y' to accurately reflect the scaling for y-positions.
array of y-positions of the particles. Scaled by box_x by this function, so ensure they have the same units.
swiftsimio/visualisation/power_spectrum.py:43
- The docstring for parameter 'z' incorrectly references 'box_x'. Please update it to 'box_z' to accurately reflect the scaling for z-positions.
array of z-positions of the particles. Scaled by box_x by this function, so ensure they have the same units.
swiftsimio/visualisation/power_spectrum.py:123
- In the deposit_parallel docstring, parameter 'y' should reference 'box_y' instead of 'box_x' for clarity and correctness in unit scaling.
array of y-positions of the particles. Scaled by box_x by this function, so ensure they have the same units.
swiftsimio/visualisation/power_spectrum.py:126
- In the deposit_parallel docstring, parameter 'z' should reference 'box_z' instead of 'box_x' for clarity and correctness in unit scaling.
array of z-positions of the particles. Scaled by box_x by this function, so ensure they have the same units.
There was a problem hiding this comment.
Is "same units" required? Or is "compatible units" enough? cosmo_array should be clever enough now for the latter. Might want to check that mixed physical & comoving inputs give intuitive outputs, do you want to explicitly coerce the box size to match the comoving flag of the coordinates?
There was a problem hiding this comment.
This function explicitly asks for numpy arrays because of numba acceleration (value arrays; that's also what is passed by calling functions) so all unit coercion should be done before touching it.
* Fixes SWIFTSIM#218 * Add HDF5 to gitignore
Fixes #218