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

tests:Add new test for failing to load error_upper in h5 file #216

Merged
merged 3 commits into from
Nov 8, 2022

Conversation

smithsp
Copy link
Member

@smithsp smithsp commented Oct 17, 2022

This is an attempt to isolate https://github.com/gafusion/OMFIT-source/issues/6191 to an error in the omas library.
Mention @bechtt
This should fail on test_omas_core for test_load_error_upper:

======================================================================
ERROR: test_load_error_upper (omas.tests.test_omas_core.TestOmasCore)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/smithsp/omas/omas/tests/test_omas_core.py", line 420, in test_load_error_upper
    ods = load_omas_h5(f'{imas_json_dir}/../samples/ods_with_error_upper.h5')
  File "/home/smithsp/omas/omas/omas_h5.py", line 136, in load_omas_h5
    ods.consistency_check = consistency_check
  File "/home/smithsp/omas/omas/omas_core.py", line 645, in consistency_check
    self.getraw(item).consistency_check = consistency_value_propagate
  File "/home/smithsp/omas/omas/omas_core.py", line 645, in consistency_check
    self.getraw(item).consistency_check = consistency_value_propagate
  File "/home/smithsp/omas/omas/omas_core.py", line 645, in consistency_check
    self.getraw(item).consistency_check = consistency_value_propagate
  [Previous line repeated 3 more times]
  File "/home/smithsp/omas/omas/omas_core.py", line 629, in consistency_check
    value, txt = consistency_checker(location, self.getraw(item), info, consistency_value, self.imas_version)
  File "/home/smithsp/omas/omas/omas_core.py", line 138, in consistency_checker
    raise ValueError(txt)
ValueError: equilibrium.time_slice.0.constraints.bpol_probe.0.measured is of type <class 'numpy.ndarray'> must be a scalar of type FLT_0D

Note that when I started working, I was on the inhomo_multi_dim_time branch, specifically commit dbdcbb2 . I can run a git bisect if needed, but thought I would let @orso82 see if there was something easy that stands out first before I put in the effort.

@orso82
Copy link
Member

orso82 commented Oct 17, 2022

Thank you @smithsp I'll take a look

@orso82 orso82 merged commit fbfe902 into master Nov 8, 2022
@orso82 orso82 deleted the fail_load_error_upper branch November 8, 2022 06:52
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 this pull request may close these issues.

None yet

2 participants