sdss / lvmdrp

Local Volume Mapper (LVM) Data Reduction Pipeline
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

lvmdrp failing #27

Closed kslong closed 11 months ago

kslong commented 11 months ago

The current main branvch commit 140db509cd37e1bbe3d1cb4562d71de48cbb0ec9 (HEAD -> master, origin/master, origin/HEAD)

fails both on regenerating hte meta data and processing data. The error in both cases is below

(lvmdrp) rainbow:lco long$ drp metadata regenerate -m 60143
[ERROR]: Traceback (most recent call last):
  File "/Users/long/anaconda3/envs/lvmdrp/bin/drp", line 7, in <module>
    exec(compile(f.read(), __file__, 'exec'))
  File "/Users/long/SDSS/lvmdrp/bin/drp", line 10, in <module>
    from lvmdrp.functions.run_drp import run_drp, get_config_options, reduce_file
  File "/Users/long/SDSS/lvmdrp/python/lvmdrp/functions/__init__.py", line 3, in <module>
    from . import (
  File "/Users/long/SDSS/lvmdrp/python/lvmdrp/functions/imageMethod.py", line 83, in <module>
    def _nonlinearity_correction(ptc_params: None | numpy.ndarray, nominal_gain: float, quadrant: Image, iquad: int) -> Image:
TypeError: unsupported operand type(s) for |: 'NoneType' and 'type

There is no problem with commit 6e56ca9120e4479150eafbb19754c9c22275f25f

where it looks like the call is a bit different.

def _nonlinearity_correction(nl_table: Table, gain_value: float, data: Image, iquad: int) -> Image:
ajmejia commented 11 months ago

The issue is the | operator in None | numpy.ndarray that was implemented in python 3.10. You're probably running python < 3.10. I'll add backwards compatibility for this feature.

kslong commented 11 months ago

I am using 3.10.10. And by the way the documentation says 3.8

kslong commented 11 months ago

I take that back, even though when in the lvmdrp enviroment, when I say python -version it gives 3.10.10. It looks like the drp is running 3.8. I don't understans that really.