askap-craco / CELEBI

The CRAFT Effortless Localisation and Enhanced Burst Inspection Pipeline
MIT License
4 stars 2 forks source link

Unexpected keyword argument 'period' #461

Closed marcinglowacki closed 1 year ago

marcinglowacki commented 1 year ago

In calculating the polarisation angle, Nextflow was tripped up by a version issue:

_"Calculating Polarisation Angle

Command error:

The following have been reloaded with a version change: 1) cython/0.29.16-python-3.7.4 => cython/0.29.21-python-3.7.4 2) numpy/1.18.2-python-3.7.4 => numpy/1.19.2-python-3.7.4

The following have been reloaded with a version change: 1) cython/0.29.21-python-3.7.4 => cython/0.29.16-python-3.7.4 2) numpy/1.19.2-python-3.7.4 => numpy/1.18.2-python-3.7.4

Traceback (most recent call last): File "/fred/oz002/askap/craft/craco/CELEBI/craco_postproc/pipelines/../beamform//polcal.py", line 877, in _main() File "/fred/oz002/askap/craft/craco/CELEBI/craco_postproc/pipelines/../beamform//polcal.py", line 233, in _main pa, pa_fit = fit_pol_ang(freqs, U_noisesub, Q_noisesub) File "/fred/oz002/askap/craft/craco/CELEBI/craco_postproc/pipelines/../beamform//polcal.py", line 588, in fit_pol_ang pol_ang = np.unwrap(np.arctan2(U, Q) / 2, period=np.pi) File "<__array_function__ internals>", line 4, in unwrap TypeError: _unwrapdispatcher() got an unexpected keyword argument 'period'"

It turned out 'period' is a newer part of numpy 1.21, while the ozstar version was 1.18.

Fixed by making this step compatible with all numpy versions.