-
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
Complete support for Python Xarray embedding. #1534
Comments
@davidfillmore while doing some other work, I prototyped a "read_xarray_python.py" script based on the "read_numpy_python.py" script already in MET. You can view that script on kiowa:/home/dadriaan/projects/remote/read_xarray_python.py. There's also some information in kiowa:/home/dadriaan/projects/remote/remote_demo.py near the bottom where I conform the attributes of the Xarray DataArray object to the MET standards which may be useful and is related to #1470. |
write_pickle_dataplane.py fails on system module imort |
write_pickle_dataplane is run by the user's python, |
Added read_ascii_xarray to met/scripts/python. |
* Added sample script to read ascii data and create an xarray. * Disabled use_xarray exit for testing. * Get attrs from DataArray if using xarray. * Removing commented out code. * Minor fix to error message. * Added plot_dataplane unit test for xarray. * Fixed letter numpy and xarray unit tests. * Modified Makefile.am to install read_ascii_xarray.py in share/met/python. * Fixed unit_python.xml xarray letter test. * Update read_ascii_xarray.py Removing commented out code to avoid future confusion. * More cleanup. * Per #1534, fixing the issue that I introduced in this python script.' Co-authored-by: David Fillmore <fillmore@kiowa.rap.ucar.edu> Co-authored-by: johnhg <johnhg@ucar.edu>
MET PR #1614 for Issue #1534 changed the output of the NB. And the NB on 20210107 failed as expected with the errors listed below: ERROR: folder MET-develop-ref/test_output missing 2 files python/letter_numpy.ps python/letter_xarray.ps ERROR: folder MET-develop/test_output missing 1 files python/letter.ps Updated the develop-ref branch to get past these differences.
Describe the Problem
I am splitting issue MET #1472 down into 2 pieces: 1 bugfix (#1472) and 1 enhancement (this issue). By the time we work on this issue, #1472 should have already been resolved.
Here:
MET/met/src/libcode/vx_data2d_python/python_dataplane.cc
Line 437 in 2c9ae44
we exit(1) without printing an error message to the user! We should issue a bug fix to print an error message, and then implement the support for this section (Xarray Python embedding with pickling) for v10.0.
Expected Behavior
I expect a warning message instead of MET silently exiting and producing no output.
Environment
Describe your runtime environment:
*1. Machine: kiowa
To Reproduce
To force pickling, set the MET_PYTHON_EXE environment variable. This can be set to any version of Python I think, which just forces invocation of the pickling logic in MET which is necessary to reproduce the error.
export MET_PYTHON_EXE=/path/to/python
Call a test script I wrote for Xarray Python embedding
/usr/local/met-9.1/bin/plot_data_plane PYTHON_XARRAY testXR.ps 'name="/home/dadriaan/projects/remote/read_ascii_xarray.py /home/dadriaan/git/met/met/data/python/fcst.txt FCST";' -title "Testing" -v 10
Relevant Deadlines
NONE
Funding Source
2791541
Define the Metadata
Assignee
Labels
Projects and Milestone
Define Related Issue(s)
Consider the impact to the other METplus components.
Bugfix Checklist
See the METplus Workflow for details.
Branch name:
bugfix_<Issue Number>_master_<Version>_<Description>
Pull request:
bugfix <Issue Number> master_<Version> <Description>
Branch name:
bugfix_<Issue Number>_develop_<Description>
Pull request:
bugfix <Issue Number> develop <Description>
The text was updated successfully, but these errors were encountered: