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

upstream-dev pint tests are failing #338

Closed
dcherian opened this issue Jun 3, 2022 · 1 comment · Fixed by #341
Closed

upstream-dev pint tests are failing #338

dcherian opened this issue Jun 3, 2022 · 1 comment · Fixed by #341
Labels
help wanted Extra attention is needed

Comments

@dcherian
Copy link
Contributor

dcherian commented Jun 3, 2022

https://github.com/xarray-contrib/cf-xarray/runs/6729119063?check_suite_focus=true

________________ ERROR collecting cf_xarray/tests/test_units.py ________________
cf_xarray/tests/test_units.py:11: in <module>
    from ..units import units as ureg
cf_xarray/units.py:81: in <module>
    pint.unit.UnitDefinition("percent", "%", (), pint.converters.ScaleConverter(0.01))
E   AttributeError: module 'pint' has no attribute 'unit'
________________ ERROR collecting cf_xarray/tests/test_units.py ________________
cf_xarray/tests/test_units.py:11: in <module>
    from ..units import units as ureg
cf_xarray/units.py:81: in <module>
    pint.unit.UnitDefinition("percent", "%", (), pint.converters.ScaleConverter(0.01))
E   AttributeError: module 'pint' has no attribute 'unit'
=================================== FAILURES ===================================
_________________________ test_coordinates_quantified __________________________
[gw1] linux -- Python 3.10.4 /usr/share/miniconda/envs/cf_xarray_test/bin/python
    @requires_pint
    def test_coordinates_quantified():
        # note: import order is important
>       from .. import units  # noqa
cf_xarray/tests/test_accessor.py:222: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cf_xarray/units.py:17: in <module>
    def short_formatter(unit, registry, **options):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
func = <function short_formatter at 0x7f990adb84c0>
    def wrapper(func):
        if name in _FORMATTERS:
>           raise ValueError(f"format {name:!r} already exists")  # or warn instead
E           ValueError: Invalid format specifier
/usr/share/miniconda/envs/cf_xarray_test/lib/python3.10/site-packages/pint/formatting.py:160: ValueError
@dcherian dcherian added the help wanted Extra attention is needed label Jun 3, 2022
@keewis
Copy link
Contributor

keewis commented Jun 7, 2022

both UnitDefinition and ScaleConverter are now in pint.facets.plain, but I'm not sure what is public API and what isn't.

As for the second failing test: I have no idea. What is the type of name?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants