-
Notifications
You must be signed in to change notification settings - Fork 283
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
um_stash_source attribute causes ValueError if not in msi format #4029
Comments
Hey @jonseddon, thanks for raising this issue. Clearly you have a very specific use case here... so given that, I'm assuming that you as a users would want to hold onto the troublesome |
Also, we're going to be transitioning to |
This came up in an internal discussion on Yammer. The attribute could be discarded, but I'm just always keen to not throw away stuff unnecessarily as in this case there is information inside it. Logging would be an great improvement on a warning. Whether this should be at debug, info or warning should be carefully considered. Some users do rely on the STASH attribute and so if it's not going to be there then I'd opt for an info or warning level. What's the ETA, or is there a branch/PR for the move to logging? I'm happy to do the work on this. I've had a look through and I think that I can see how to check that the STASH is valid in the pyke rules. I'll create a draft PR as soon as poss. |
@jonseddon I suspect that we may be releasing an If you wanted to jump on this, then that would be fantastic and really helpful. I suggest that you target your pull-request on the For the moment raise a suitable Happy with that as a plan and way forward? This means this fix will be available to the community as part of the forthcoming |
Note that the So don't worry if you push a pull-request on |
Closed by #4035 |
🐛 Bug Report
If a variable in a netCDF file contains a
um_stash_source
attribute that is not in MSI formatmXXsXXiXXX
(for example(28.97/48.0)*m01s34i001
) then ValueError is raised when loading.How To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
ValueError seems excessive here. If the STASH code isn't in the correct format then perhaps a warning and storing the attribute value in
cube.attributes
would be nicer to users.Environment
(but behaviour is probably OS and version independent)
Additional context
Fix probably needs to go into https://github.com/SciTools/iris/blob/master/lib/iris/fileformats/_pyke_rules/fc_rules_cf.krb#L1014 but I'm not sure how to handle an execption in Pyke myself.
The text was updated successfully, but these errors were encountered: