You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current glob syntax for locating MAS data files of a specific variable (e.g. t001.hdf t002.hdf, etc.) will match with unwanted stuff, such as a random file called test.txt or tmas and then the call to read the variable (e.g. t = mas_output['t']) will crash ungracefully complaining about coordinates.
Also, if there are multiple variables matching one of the variable prefixes (e.g. t and te) then reading t would read any t and te files silently without warning.
Perhaps this issue showed up with the switch to 3 or 6 digit sequence numbers.
I suspect a fix would be to be more stringent about the format, looking for either 3 digit or 6 digit HDF files separately and choosing one or the other (e.g. first look for f"{var}[0-9][0-9][0-9].h*" and if there are no matches then look for f"{var}[0-9][0-9][0-9][0-9][0-9][0-9].h*") but I'm not experienced enough with PsiPy IO to implement this knowing it won't cause side effects.
The text was updated successfully, but these errors were encountered:
The current glob syntax for locating MAS data files of a specific variable (e.g. t001.hdf t002.hdf, etc.) will match with unwanted stuff, such as a random file called
test.txt
ortmas
and then the call to read the variable (e.g.t = mas_output['t']
) will crash ungracefully complaining about coordinates.Also, if there are multiple variables matching one of the variable prefixes (e.g. t and te) then reading t would read any t and te files silently without warning.
Perhaps this issue showed up with the switch to 3 or 6 digit sequence numbers.
I believe this is the line at issue:
PsiPy/psipy/io/mas.py
Line 29 in f291894
And maybe this one might need to be checked/revised for 3 vs 6 issues too:
PsiPy/psipy/io/mas.py
Line 119 in f291894
I suspect a fix would be to be more stringent about the format, looking for either 3 digit or 6 digit HDF files separately and choosing one or the other (e.g. first look for
f"{var}[0-9][0-9][0-9].h*"
and if there are no matches then look forf"{var}[0-9][0-9][0-9][0-9][0-9][0-9].h*"
) but I'm not experienced enough with PsiPy IO to implement this knowing it won't cause side effects.The text was updated successfully, but these errors were encountered: