gafusion / omas

Ordered Multidimensional Array Structure
http://gafusion.github.io/omas
MIT License
32 stars 15 forks source link

omas_core:ODS.time fixed for highly inhomogeneous and multidimensional times #99

Closed smithsp closed 4 years ago

smithsp commented 4 years ago

This fixes https://github.com/gafusion/OMFIT-source/issues/4478

The ODS with problems is found on iris at /cluster-scratch/smithsp/gh_4478/OMFITpickled_6ff3516709 and the problem can be demonstrated with

OMFIT['ods'] = OMFITpickle('/cluster-scratch/smithsp/gh_4478//OMFITpickled_6ff3516709')
OMFIT['ods']['ic_antennas'].time()

which produces

Error in "OMFIT command box #1" at line  2
    t=OMFIT['ods']['ic_antennas'].time()
ValueError: operands could not be broadcast together with shapes (5,2000) (1000,) 

This pull request fixes the issue by detecting the odd shaping and returning None.

codecov[bot] commented 4 years ago

Codecov Report

Merging #99 into master will decrease coverage by 0.04%. The diff coverage is 42.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #99      +/-   ##
==========================================
- Coverage   79.85%   79.81%   -0.05%     
==========================================
  Files          45       45              
  Lines        7869     7872       +3     
==========================================
- Hits         6284     6283       -1     
- Misses       1585     1589       +4     
Impacted Files Coverage Δ
omas/omas_core.py 85.78% <42.85%> (-0.36%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3f6c1b7...dbdcbb2. Read the comment docs.