gafusion/omas

Test failure with `pint>=0.20`

Closed this issue · 2 comments

hassec commented

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 commented

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 commented

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