We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8be740a commit 2c6801dCopy full SHA for 2c6801d
stagpy/stagyyparsers.py
@@ -652,7 +652,11 @@ def _get_field(xdmf_file, data_item):
652
"""Extract field from data item."""
653
shp = _get_dim(data_item)
654
h5file, group = data_item.text.strip().split(':/', 1)
655
- icore = int(group.split('_')[-2]) - 1
+ # Field on yin is named <var>_XXXXX_YYYYY, on yang is <var>2XXXXX_YYYYY.
656
+ # This splitting is done to protect against that and <var> possibly
657
+ # containing a 2.
658
+ numeral_part = group.split('2')[-1]
659
+ icore = int(numeral_part.split('_')[-2]) - 1
660
fld = None
661
try:
662
fld = _read_group_h5(xdmf_file.parent / h5file, group).reshape(shp)
0 commit comments