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

load_omas_imas breaks if data_error_{upper, lower} not filled correctly #56

Closed
jsferreira opened this issue Jan 31, 2019 · 2 comments
Closed

Comments

@jsferreira
Copy link
Member

Dear All,

I was trying to read a set of IDS which contains data_error_{upper, lower} nodes that are not filled correctly. When OMAS tries to build an uarray (uncertainties) it will throw na exception NegativeStdDev: The standard deviation cannot be negative
breaking the load process. Could we add an option to just give a warning in those cases. Errors would be ignored. Actually this should be the default behaviour otherwise it can be a bummer for the user.
I am using omas version 0.29

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/afs/gw/switm/omfit/atom/omas/omas/omas_imas.py", line 456, in load_omas_imas
    data = uarray(data,stdata)
  File "/gw/switm/omfit/atom/miniconda2/lib/python2.7/site-packages/uncertainties/unumpy/core.py", line 287, in uarray
    (nominal_values, std_devs))
  File "/gw/switm/omfit/atom/miniconda2/lib/python2.7/site-packages/numpy/lib/function_base.py", line 2576, in __call__
    return self._vectorize_call(func=func, args=vargs)
  File "/gw/switm/omfit/atom/miniconda2/lib/python2.7/site-packages/numpy/lib/function_base.py", line 2652, in _vectorize_call
    outputs = ufunc(*inputs)
  File "/gw/switm/omfit/atom/miniconda2/lib/python2.7/site-packages/uncertainties/unumpy/core.py", line 286, in <lambda>
    lambda v, s: uncert_core.Variable(v, s), otypes=[object])
  File "/gw/switm/omfit/atom/miniconda2/lib/python2.7/site-packages/uncertainties/core.py", line 2585, in __init__
    self.std_dev = std_dev  # Assignment through a Python property
  File "/gw/switm/omfit/atom/miniconda2/lib/python2.7/site-packages/uncertainties/core.py", line 2606, in std_dev
    raise NegativeStdDev("The standard deviation cannot be negative")
uncertainties.core.NegativeStdDev: The standard deviation cannot be negative
@orso82 orso82 closed this as completed in ee2ce4d Jan 31, 2019
@jsferreira
Copy link
Member Author

@orso82, thanks for the quick fix.

@orso82
Copy link
Member

orso82 commented Feb 1, 2019

You are welcome! Glad to see OMAS is getting used! 👍

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

No branches or pull requests

2 participants