-
Notifications
You must be signed in to change notification settings - Fork 24
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
Feature #2525 fill value at dataplane #2557
Conversation
@hsoh-u is there a specific reason I think Maybe there is a case I am not considering? |
The min_value and max_value was added for plot_data_plane which does not have min/max value configuration. I think it's OK without it. Let me know this should be excluded.
|
@hsoh-u sorry for the delay in responding on this. I agree with @DanielAdriaansen. I don't see the need for adding the I just tested to confirm that this does work with python embedding, and it does:
![]() @hsoh-u, if I'm correct in assuming that Thanks! |
…value_at_dataplane
…enter/MET into feature_2525_fill_value_at_dataplane
@hsoh-u can you rebuild MET on seneca here: I am getting lots of " hs DEBUG" in my output but I don't see that in the source and I want to make sure I am using the latest compilation from this branch for testing. It looks like the binaries have a date of 6 June on them. Thanks. |
It was re-built. |
@hsoh-u for the MET_PYTHON_EXE case, if the user does not have a When I do this: I get this error:
Command on Seneca: |
Python NetCDF API does not allow to set None to the global/variable attributes (both by using setattr or dictionatry). I will filter out attributes with None.
|
Thanks @hsoh-u. For the purpose of documentation, can you please confirm that
|
Yes, but no need to set the attribute to None (which is ignored). |
So in the case of no user fill value, should we encourage the user to not set |
The fill_value is optional. My vote is not to set None. |
OK. The documentation currently says all I will add a new section for "Optional attributes for Dataplane" where |
@hsoh-u can you please confirm values respected without setting
|
NaN and Inf values are converted to -9999 with/without attrs['fill_value']. |
OK thanks. It also seems like -9999 and -9999.0 also work if either of those happen to be the user fill value (i.e. user_fill_value = met_fill_value). So -9999, -9999., Inf, NaN need no |
That's correct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hsoh-u this looks good and I ran several tests and was able to verify the behavior.
I need to add documentation now, but I made a few comments and suggestions to the code in the meantime while I add documentation.
@hsoh-u in the documentation here: I do not mention masked arrays. Is it true that a user can also supply Or is it better to just tell the user to use N-D array or DataArray to avoid confusion since maybe MaskedArray is only used under the hood? |
I approve. I tested with various combinations of MET_PYTHON_EXE, PYTHON_NUMPY, PYTHON_XARRAY, MET fill values combined with user defined fill values, NaN with user defined fill values, user defined fill values only, etc. Thanks for making these changes @hsoh-u! |
Expected Differences
The python embedding for the dataplane supports user-defined fill_value, min_value and max_value. MET does post processing for MET data from the user's python script. This is an internal processing by MET. The same behavior is expected without setting "fill_value", "min_value", or "max_value" attribute setting. One exception is the NaN or Inf values from user's python script. They will be converted to MET missing value (-9999.0).
Do these changes introduce new tools, command line arguments, or configuration file options? [No]
If yes, please describe:
Do these changes modify the structure of existing or add new output data types (e.g. statistic line types or NetCDF variables)? [No]
If yes, please describe:
Pull Request Testing
Run the following command with some changed at : /d1/personal/hsoh/git/features/feature_2525_fill_value_at_dataplane/MET/share/met/python/examples/read_ascii_numpy.py and /d1/personal/hsoh/git/features/feature_2525_fill_value_at_dataplane/MET/share/met/python/examples/read_ascii_xarraypy
Add following lines to scripts/python/examples/read_ascii_numpy.py or combination of three attributes
Add following lines to scripts/python/examples/read_ascii_xarray.py or combination of three attributes
Tes NaN or Inf cases if you have the sample data
Do these changes include sufficient documentation updates, ensuring that no errors or warnings exist in the build of the documentation? [No]
Do these changes include sufficient testing updates? [No]
Will this PR result in changes to the test suite? [No]
If yes, describe the new output and/or changes to the existing output:
Please complete this pull request review by [Fill in date].
Pull Request Checklist
See the METplus Workflow for details.
Select: Reviewer(s)
Select: Organization level software support Project or Repository level development cycle Project
Select: Milestone as the version that will include these changes