Skip to content

Numpy 2.4.0 release breaks wavelength calibration #81

@bmiszalski

Description

@bmiszalski

Hi all,
Just to let you know that after updating a Docker image I use to run the pipeline, I came across this error under Python 3.11 that breaks the wavelength calibration step. I also got a similar one with Python 13.3.

It turns out the culprit is numpy 2.4.0. Downgrading to numpy 2.3.0 resolved this issue, but it may be a good idea to understand this going forward so a fix can be incorporated.

Best regards,
Brent.

multiprocessing.pool.RemoteTraceback:
"""
TypeError: only 0-dimensional arrays can be converted to Python scalars

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/lib/python3.11/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pywifes/multiprocessing_utils.py", line 27, in _unwrap_and_run
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pywifes/wifes_wsol.py", line 1699, in run_slice
new_x, new_y, new_r = find_lines_and_guess_refs(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pywifes/wifes_wsol.py", line 509, in find_lines_and_guess_refs
mid_fit_centers = quick_arcline_fit(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pywifes/wifes_wsol.py", line 397, in quick_arcline_fit
next_ctrs = _get_arc_fit(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pywifes/wifes_wsol.py", line 320, in _get_arc_fit
return _get_gauss_arc_fit(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pywifes/wifes_wsol.py", line 306, in _get_gauss_arc_fit
line_center_pairs = [fit_function(job) for job in jobs]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pywifes/wifes_wsol.py", line 306, in
line_center_pairs = [fit_function(job) for job in jobs]
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pywifes/wifes_wsol.py", line 217, in _mpfit_gauss_line
my_fit = mpfit(err_gauss_line, functkw=fa, parinfo=parinfo, quiet=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pywifes/mpfit.py", line 899, in init
xall = xall.astype(float)
^^^^^^^^^^^^^^^^^^
ValueError: setting an array element with a sequence.
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/code/dev/reference_data/../reduction_scripts/reduce_data.py", line 202, in run_arm_indiv
func(
File "/usr/local/lib/python3.11/dist-packages/pywifes/wifes_utils.py", line 205, in wrapper
result = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pywifes/recipes/wave_soln.py", line 120, in _run_wave_soln
wifes_wsol.derive_wifes_wave_solution(wsol_in_fn, gargs['wsol_out_fn'],
File "/usr/local/lib/python3.11/dist-packages/pywifes/wifes_wsol.py", line 2108, in derive_wifes_wave_solution
derive_wifes_optical_wave_solution(inimg, out_file, **args)
File "/usr/local/lib/python3.11/dist-packages/pywifes/wifes_wsol.py", line 1860, in derive_wifes_optical_wave_solution
results = map_tasks(tasks, max_processes=max_processes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pywifes/multiprocessing_utils.py", line 64, in map_tasks
results = list(lazy_results)
^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/multiprocessing/pool.py", line 873, in next
raise value
ValueError: setting an array element with a sequence.
Loading configuration file: /usr/local/lib/python3.11/dist-packages/pywifes/pipeline_params/blue/params_B3000.json5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions