BAMWelDX / weldx

The welding data exchange format
https://www.bam.de/weldx
BSD 3-Clause "New" or "Revised" License
19 stars 9 forks source link

tests failing with pint 0.21 #872

Closed braingram closed 1 year ago

braingram commented 1 year ago

I noticed the weldx tests failing in the ASDF downstream CI for a recent PR: https://github.com/asdf-format/asdf/actions/runs/4862963112/jobs/8673553574#step:10:526

I ran some of the tests with ASDF 2.15 and a fresh development install of weldx and saw similar errors (traceback for one test below). They appear to be related to the newly release pint 0.21.

I think this is related to: https://github.com/hgrecco/pint/pull/1594 not handling list inputs (like is used in the weldx geometry submodule).

____________________________ test_shape_reflection _____________________________
weldx/tests/test_geometry.py:1735: in test_shape_reflection
    shape_reflection_test_case([2, 1], np.linalg.norm([2, 1]))
weldx/tests/test_geometry.py:1679: in shape_reflection_test_case
    shape = default_test_shape()
weldx/tests/test_geometry.py:1472: in default_test_shape
    arc_segment = geo.ArcSegment.construct_with_points(
../../../.pyenv/versions/3.10.6/envs/weldx_numpy_error/lib/python3.10/site-packages/pint/registry_helpers.py:362: in wrapper
    return func(*args, **kwargs)
weldx/geometry.py:671: in construct_with_points
    return cls(points, arc_winding_ccw)
../../../.pyenv/versions/3.10.6/envs/weldx_numpy_error/lib/python3.10/site-packages/pint/registry_helpers.py:362: in wrapper
    return func(*args, **kwargs)
weldx/geometry.py:572: in __init__
    series = self._update_internals_and_get_series()
weldx/geometry.py:627: in _update_internals_and_get_series
    sign = -1 if np.cross([1, 0], diff) < 0 else 1
<__array_function__ internals>:200: in cross
    ???
../../../.pyenv/versions/3.10.6/envs/weldx_numpy_error/lib/python3.10/site-packages/pint/facets/numpy/quantity.py:64: in __array_function__
    return numpy_wrap("function", func, args, kwargs, types)
../../../.pyenv/versions/3.10.6/envs/weldx_numpy_error/lib/python3.10/site-packages/pint/facets/numpy/numpy_func.py:1004: in numpy_wrap
    return handled[name](*args, **kwargs)
../../../.pyenv/versions/3.10.6/envs/weldx_numpy_error/lib/python3.10/site-packages/pint/facets/numpy/numpy_func.py:772: in implementation
    a = _base_unit_if_needed(a)
../../../.pyenv/versions/3.10.6/envs/weldx_numpy_error/lib/python3.10/site-packages/pint/facets/numpy/numpy_func.py:734: in _base_unit_if_needed
    if a._is_multiplicative:
E   AttributeError: 'list' object has no attribute '_is_multiplicative'
CagtayFabry commented 1 year ago

thank you for the heads up @braingram 👍

I noticed this in our pypi build as well, hopefully it is easy to fix

CagtayFabry commented 1 year ago

the downstream tests run against master here, right @braingram ? Can you please run this again?

braingram commented 1 year ago

@CagtayFabry Success! https://github.com/asdf-format/asdf/actions/runs/4937705427/jobs/8826649280

CagtayFabry commented 1 year ago

great, thank you for the update @braingram