Skip to content

gwpy.io.nds2 fails to load on Python 3.11

When attempting to test on Python 3.11 I get this:

>>> import gwpy.io.nds2
/home/duncan/git/gwpy/gwpy/plot/gps.py:28: MatplotlibDeprecationWarning: The matplotlib.docstring module was deprecated in Matplotlib 3.6 and will be removed two minor releases later.
  from matplotlib import (ticker, docstring)
ValueError: 3 is not a valid Nds2ChannelType

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/duncan/git/gwpy/gwpy/io/nds2.py", line 403, in <module>
    sample_rate=None, type=Nds2ChannelType.any(),
                           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/duncan/git/gwpy/gwpy/io/nds2.py", line 120, in any
    return reduce(operator.or_, cls).value
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/duncan/opt/mambaforge/envs/py311/lib/python3.11/enum.py", line 1481, in __or__
    return self.__class__(value | other)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/duncan/opt/mambaforge/envs/py311/lib/python3.11/enum.py", line 695, in __call__
    return cls.__new__(cls, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/duncan/opt/mambaforge/envs/py311/lib/python3.11/enum.py", line 1119, in __new__
    raise exc
  File "/home/duncan/opt/mambaforge/envs/py311/lib/python3.11/enum.py", line 1096, in __new__
    result = cls._missing_(value)
             ^^^^^^^^^^^^^^^^^^^^
  File "/home/duncan/opt/mambaforge/envs/py311/lib/python3.11/enum.py", line 1416, in _missing_
    pseudo_member = (__new__ or cls._member_type_.__new__)(cls, value)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: _Nds2Enum.__new__() missing 1 required positional argument: 'nds2name'