Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent test results in github vs legend-base #327

Closed
jasondet opened this issue Jul 26, 2022 · 13 comments
Closed

Inconsistent test results in github vs legend-base #327

jasondet opened this issue Jul 26, 2022 · 13 comments
Assignees
Labels
bug Something isn't working dsp Digital Signal Processing raw Decoding DAQ files

Comments

@jasondet
Copy link
Collaborator

github is happy passing all tests. however in legend-base on the lngs server, the tests die on importing orca_packet with:

raw/orca/orca_packet.py:15
ERROR test_orca_packet.py - TypeError: 'numpy._DTypeMeta' object is not subscriptable

I suspect we are missing a required version dependency for annotations?

@gipert
Copy link
Member

gipert commented Jul 26, 2022

Might be due to an incompatible numpy version... Will check and fix once I'm back online.

We had to disable testing with the container because our image is too heavy to be downloaded on the GitHub action runners

@gipert gipert added bug Something isn't working raw Decoding DAQ files labels Aug 1, 2022
@gipert
Copy link
Member

gipert commented Aug 1, 2022

DSP tests are failing in the container:

$ pytest tests/dsp
ImportError while loading conftest '/tmp/pygama/tests/dsp/conftest.py'.
tests/dsp/conftest.py:3: in <module>
    import pygama.dsp.processors  # noqa: F401
/user/.local/lib/python3.9/site-packages/pygama/dsp/__init__.py:20: in <module>
    from .build_dsp import build_dsp
/user/.local/lib/python3.9/site-packages/pygama/dsp/build_dsp.py:21: in <module>
    from pygama.dsp.processing_chain import build_processing_chain
/user/.local/lib/python3.9/site-packages/pygama/dsp/processing_chain.py:23: in <module>
    from pygama.math.units import Quantity, Unit
/user/.local/lib/python3.9/site-packages/pygama/math/units.py:1: in <module>
    from pint import Measurement, Quantity, Unit, UnitRegistry, set_application_registry
/user/.local/lib/python3.9/site-packages/pint/__init__.py:16: in <module>
    from .context import Context
/user/.local/lib/python3.9/site-packages/pint/context.py:20: in <module>
    from .definitions import Definition, UnitDefinition
/user/.local/lib/python3.9/site-packages/pint/definitions.py:16: in <module>
    from .converters import Converter, LogarithmicConverter, OffsetConverter, ScaleConverter
/user/.local/lib/python3.9/site-packages/pint/converters.py:12: in <module>
    from .compat import HAS_NUMPY, exp, log  # noqa: F401
/user/.local/lib/python3.9/site-packages/pint/compat.py:163: in <module>
    from xarray import DataArray, Dataset, Variable
/opt/anaconda3/lib/python3.9/site-packages/xarray/__init__.py:1: in <module>
    from . import testing, tutorial, ufuncs
/opt/anaconda3/lib/python3.9/site-packages/xarray/testing.py:8: in <module>
    from xarray.core import duck_array_ops, formatting, utils
/opt/anaconda3/lib/python3.9/site-packages/xarray/core/duck_array_ops.py:24: in <module>
    from . import dask_array_compat, dask_array_ops, dtypes, npcompat, nputils
/opt/anaconda3/lib/python3.9/site-packages/xarray/core/dask_array_compat.py:5: in <module>
    from .pycompat import dask_version
/opt/anaconda3/lib/python3.9/site-packages/xarray/core/pycompat.py:55: in <module>
    dsk = DuckArrayModule("dask")
/opt/anaconda3/lib/python3.9/site-packages/xarray/core/pycompat.py:22: in __init__
    duck_array_version = LooseVersion(duck_array_module.__version__)
/opt/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/version.py:53: in __init__
    warnings.warn(
E   DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.

and seems to be related to Pint.

CC @iguinn

@gipert gipert added the dsp Digital Signal Processing label Aug 1, 2022
@gipert
Copy link
Member

gipert commented Aug 1, 2022

The issue has been fixed in xarray since a while now: pydata/xarray#6092. The xarray installation in legend-base seems too old. Running pip install --upgrade xarray in the container fixes the issue.

@oschulz can you reproduce this with the current pygama main? Can you have a look into this?

@oschulz
Copy link

oschulz commented Aug 1, 2022

can you reproduce this with the current pygama

Do you mean reproduce with the current container, or an updated one with a current xarray?

@gipert
Copy link
Member

gipert commented Aug 1, 2022

I mean with the latest container and the latest pygama commit (on main). You would need to first pip install .[test] and then pytest.

@oschulz
Copy link

oschulz commented Aug 2, 2022

I can make that part of the container build, I think.

@gipert
Copy link
Member

gipert commented Aug 4, 2022

I can make that part of the container build, I think.

Ok, so the test suite runs just fine? Can we close this?

@oschulz
Copy link

oschulz commented Aug 4, 2022

Haven't run it yet, have to rebuild the containers first the next days.

@oschulz
Copy link

oschulz commented Oct 24, 2022

pygama tests pass now in the legend-software container and are part of the container build.

@oschulz oschulz closed this as completed Oct 24, 2022
@gipert
Copy link
Member

gipert commented Oct 25, 2022

@oschulz why ignoring the deprecation warning?

https://github.com/legend-exp/legendexp_legend-software_img/blob/master/provisioning/install-sw-scripts/pygama-setup.sh#L20

I think the right solution would be to get a more recent xarray version, as I mentioned earlier in this thread: #327 (comment). Isn't it possible?

@oschulz
Copy link

oschulz commented Oct 26, 2022

Well, it would be nice to be able to go with regular Anaconda releases in general, and not always have to do specific updates for individual packages. Will this xarray thing result in reduced performance or is it just a pure deprecation warning?

As far as I know, ignore::DeprecationWarning is not uncommon in Python production testing.

@gipert
Copy link
Member

gipert commented Oct 26, 2022

No, it's not a big issue. I agree we should stick to Anaconda stable releases, even if I don't like suppressing indiscriminately all deprecation warnings...

Let's hope it will go away by itself at some point.

@oschulz
Copy link

oschulz commented Oct 26, 2022

Ok :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dsp Digital Signal Processing raw Decoding DAQ files
Projects
None yet
Development

No branches or pull requests

3 participants