Skip to content

test-input and example data and it's path and availabilityΒ #655

@mathause

Description

@mathause

We currently have coarse-grid cmip6 data at tests/test-data/calibrate-coarse-grid/cmip6-ng/. This is fine for the tests but we also use it in the examples and there are several issues with this.

  1. the path is awkward and too long (even when relative)
  2. constructing the path is cumbersome (see below)
  3. the data is not available without cloning the repo, i.e. cannot run examples when the package is installed from pypi or conda. (However, the examples are also not available...)
  4. We need to check the license of the data and if we are allowed to distribute it πŸ™

Suggestion

  • move cmip6-ng folder into the ./data folder
  • we make the example data path available from the top level

Questions

  • What is a good name?
    • mesmer.paths.cmip6_ng
    • mesmer.example_data.cmip6_ng
    • mesmer.tutorial.cmip6_ng_path
    • mesmer.cmip6_ng_coarse_grid
    • ???
  • Should we rename the resolution folder (currently g025) because we regridded it again? (Unfortunately we have a different lon & lat resolution πŸ€·β€β™‚)
  • Should we make the data available via automatic download if it's not?
    • I think we would do this via pooch and have every file individually. So to download we have to loop over them. A tar-archive would be much simpler but would double the required disk space and would probably double it every time we have to add a new file. pooch should be able to handle subfolders.

  • We construct the path using importlib.resources - need to add some sanity checks but can use this as starting point (from Add Example for several ScenariosΒ #521):
    # mesmer provides example data under "tests/test-data"
    data_path = importlib.resources.files("mesmer").parent / "tests" / "test-data"
    
    # make `data_path` relative to the current working directory
    # this leads to slightly nicer paths but is not really necessary
    data_path = data_path.relative_to(pathlib.Path.cwd(), walk_up=True)
    
    cmip_path = data_path / "calibrate-coarse-grid" / "cmip6-ng"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions