Skip to content
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

Improve documentation for Xarray Python embedding #1468

Closed
7 of 18 tasks
DanielAdriaansen opened this issue Aug 25, 2020 · 4 comments · Fixed by #1784
Closed
7 of 18 tasks

Improve documentation for Xarray Python embedding #1468

DanielAdriaansen opened this issue Aug 25, 2020 · 4 comments · Fixed by #1784
Assignees
Labels
component: documentation Documentation issue MET: Python Embedding priority: low Low Priority requestor: NCAR/RAL NCAR Research Applications Laboratory type: enhancement Improve something that it is currently doing
Milestone

Comments

@DanielAdriaansen
Copy link
Contributor

DanielAdriaansen commented Aug 25, 2020

Describe the Enhancement

More specifics would be helpful on how to use Xarray with Python embedding in MET. Specifically:

  1. Currently only DataArray objects are supported
  2. The "attrs" associated with the DataArray must conform to MET standards. The documentation should more clearly define the expected types and templates for each supported attribute item, rather than simply a "sample" attributes dictionary.
  3. Dataset objects can be used, but include an example of how to subset them and retain the necessary attrs MET requires

Time Estimate

4 hours

Relevant Deadlines

NONE

Funding Source

2790541

Define the Metadata

Assignee

  • Select engineer(s) or no engineer required
  • Select scientist(s) or no scientist required

Labels

  • Select component(s)
  • Select priority
  • Select requestor(s)

Projects and Milestone

  • Review projects and select relevant Repository and Organization ones
  • Select milestone

Define Related Issue(s)

Consider the impact to the other METplus components.

Enhancement Checklist

See the METplus Workflow for details.

  • Complete the issue definition above.
  • Fork this repository or create a branch of develop.
    Branch name: feature_<Issue Number>_<Description>
  • Complete the development and test your changes.
  • Add/update unit tests.
  • Add/update documentation.
  • Push local changes to GitHub.
  • Submit a pull request to merge into develop and link the pull request to this issue..
    Pull request: feature <Issue Number> <Description>
  • Iterate until the reviewer(s) accept and merge your changes.
  • Delete your fork or branch.
  • Close this issue.
@DanielAdriaansen DanielAdriaansen added type: enhancement Improve something that it is currently doing component: documentation Documentation issue component: python interface alert: NEED ACCOUNT KEY Need to assign an account key to this issue labels Aug 25, 2020
@DanielAdriaansen DanielAdriaansen added this to the MET 10.0 milestone Aug 25, 2020
@DanielAdriaansen DanielAdriaansen added this to To do in MET-10.0.0-beta1 (10/22/20) via automation Aug 25, 2020
@DanielAdriaansen DanielAdriaansen self-assigned this Aug 25, 2020
@DanielAdriaansen DanielAdriaansen added priority: low Low Priority requestor: NCAR National Center for Atmospheric Research labels Aug 25, 2020
@DanielAdriaansen
Copy link
Contributor Author

DanielAdriaansen commented Aug 25, 2020

Is there a way to check if the object is a DataArray prior to MET trying to access it? I.e., is there C++ code to identify an Xarray DataArray object? Or should this be for the user to enforce?

@DanielAdriaansen
Copy link
Contributor Author

Segmentation fault returned if Dataset object passed. Likely because there are multiple variables in a Dataset and not just a single ndarray.

If a user has a Dataset (ds) object, they can subset it to a single DataArray (da) object and retain the attributes associated with the Dataset like this:
da = xr.DataArray(ds.varname,attrs=ds.attrs)

@DanielAdriaansen DanielAdriaansen added requestor: NCAR/RAL NCAR Research Applications Laboratory and removed requestor: NCAR National Center for Atmospheric Research labels Aug 25, 2020
@DanielAdriaansen
Copy link
Contributor Author

See here: #1470 (comment) for required attributes and their C++ formats for Python embedding.

@JohnHalleyGotway JohnHalleyGotway added the alert: NEED CYCLE ASSIGNMENT Need to assign to a release development cycle label Sep 10, 2020
@JohnHalleyGotway JohnHalleyGotway added this to To do in MET-10.0.0-beta3 (1/27/21) via automation Nov 5, 2020
@JohnHalleyGotway JohnHalleyGotway removed the alert: NEED CYCLE ASSIGNMENT Need to assign to a release development cycle label Nov 5, 2020
@JohnHalleyGotway JohnHalleyGotway added this to To do in MET-10.0.0-beta4 (3/2/21) via automation Jan 25, 2021
@TaraJensen TaraJensen removed the alert: NEED ACCOUNT KEY Need to assign an account key to this issue label Jan 27, 2021
@JohnHalleyGotway JohnHalleyGotway added this to To do in MET-10.0.0-rc1 (5/10/21) via automation Feb 16, 2021
@JohnHalleyGotway
Copy link
Collaborator

@DanielAdriaansen can you please take a look at this issue to see if the work is done? And if so, please close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: documentation Documentation issue MET: Python Embedding priority: low Low Priority requestor: NCAR/RAL NCAR Research Applications Laboratory type: enhancement Improve something that it is currently doing
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants