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

Would "dachar" work better as a stand-alone library if fixes were language agnostic? #22

Open
agstephens opened this issue Apr 1, 2020 · 4 comments
Assignees

Comments

@agstephens
Copy link
Contributor

  • dachar version: *
  • Python version: 3.7
  • Operating System: Linux

Description

We have created fixes that are specific to our daops library, e.g.:

{
    "post_processors": [
        {
            "args": null,
            "func": "daops.data_utils.coord_utils.squeeze_dims",
            "kwargs": {
                "dims": ["lev"]
            }
        }
    ]
}

An alternative would be to define all fixes in a language-agnostic form, such as:

{ 
  "fixes": [
     {
         "operation": "squeeze singleton dimensions",
         "operands": {
               "dimensions": ["lev"]
      }
  ]
} 

The reason for taking this approach would be that the dachar library would exist as a stand-alone component that was entirely independent of any implementation of fixes.

Benefits of this approach would be:

  1. Any external tools using the information generated by dachar could use the fix definitions.
  2. dachar does not hard-code specific implementations.

Drawbacks of this approach would be:

  1. An extra language/encoding of the fixes is required - this must be written by the project. (There might be existing standards/approaches we could use).
  2. Our daops library will need to define mappings from the language-agnostic form to our own daops functions.

@cehbrecht and @huard: what are your thoughts on this issue?

@agstephens agstephens self-assigned this Apr 1, 2020
@huard
Copy link

huard commented Apr 1, 2020

Agree with the benefits.
For the drawbacks:

  1. Could you consider an extension to NcML that could become NcML-2.3 or NcML-3.0 ?
  2. daops.mappings would essentially be xarray.open_ncml, and I think you'd get community support.
    read ncml files to create multifile datasets pydata/xarray#2697
    keep track of xarray ncml progress pangeo-data/esgf2xarray#2

@agstephens
Copy link
Contributor Author

@huard, thanks for your response. We will have to look into it. NcML is certainly an option - rather than making up our own bespoke approach.

@huard
Copy link

huard commented Apr 1, 2020

Sorry to harp on this, I'll be happy to be proved wrong on this.

@agstephens
Copy link
Contributor Author

@huard, I might be happy for you to be proved right :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants