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

Test failure with pint>=0.20 #263

Closed
hassec opened this issue Aug 15, 2023 · 2 comments · Fixed by #265
Closed

Test failure with pint>=0.20 #263

hassec opened this issue Aug 15, 2023 · 2 comments · Fixed by #265

Comments

@hassec
Copy link
Contributor

hassec commented Aug 15, 2023

make test_physics will throw the below error if using pint >= 0.20

======================================================================
ERROR: test_handle_units (test_omas_physics.TestOmasPhysics)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/chasse/omas/omas/tests/test_omas_physics.py", line 463, in test_handle_units
    ods['equilibrium.time_slice[0].constraints.diamagnetic_flux.time_measurement'] = 8.0 * ureg.milliseconds
  File "/home/chasse/omas/omas/omas_core.py", line 1057, in __setitem__
    self.getraw(key[0])[key[1:]] = pass_on_value
  File "/home/chasse/omas/omas/omas_core.py", line 1057, in __setitem__
    self.getraw(key[0])[key[1:]] = pass_on_value
  File "/home/chasse/omas/omas/omas_core.py", line 1057, in __setitem__
    self.getraw(key[0])[key[1:]] = pass_on_value
  [Previous line repeated 2 more times]
  File "/home/chasse/omas/omas/omas_core.py", line 964, in __setitem__
    and isinstance(value, pint.quantity._Quantity)
AttributeError: module 'pint' has no attribute 'quantity'

----------------------------------------------------------------------

This is because the pint.quantity submodule no longer exists.

@orso82
Copy link
Member

orso82 commented Aug 16, 2023

Thank you for reporting @hassec !

Are you familiar with Pint and know where 'quantity' went in the latest versions of the package?

I even wonder if anybody actually uses the units feature in OMAS or if it should be removed...

@hassec
Copy link
Contributor Author

hassec commented Aug 16, 2023

@orso82 I think #265 is all we would need to fix the current problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants