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

Use dash instead of underscore in variable name in file name #53

Open
bouweandela opened this issue May 12, 2020 · 1 comment
Open

Use dash instead of underscore in variable name in file name #53

bouweandela opened this issue May 12, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@bouweandela
Copy link
Member

The filenames generated by era5cli look like this:

era5_temperature_1990_hourly.nc
era5_temperature_of_snow_layer_1990_hourly.nc

The usual convention for filenames, in e.g. the CMIP5 and CMIP6 projects, is to use underscores between the different facets and dashes if a space is needed inside a facet. This makes it easier to extract the different facets from the filename. Therefore, it would be more convenient if era5cli filenames looked like

era5_temperature_1990_hourly.nc
era5_temperature-of-snow-layer_1990_hourly.nc

because then people would be able to use a glob like

ls era5_temperature_*_hourly.nc

to find just the temperature variables instead of any kind of variable that starts with temperature.

@BSchilperoort
Copy link
Member

PR #148 implements an optional kwarg to be able to use dashes in the variable name of the file name.

The pros of the dash are:

  • The filename is more readable
  • It makes it easier to extract the different facets from the filename.

The cons are:

  • It would represent a change in behavior of era5cli
  • The CDS API uses underscored names.
    • Note that this does not align with the full names OR netCDF variable names.*
  • Users input the variables they want with an underscore.
    • Would we also change this? Or just allow both as input.

* From some experimentation it seems that the cds api variables are the all-lowercase long_name, with spaces replaced by underscores.

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

No branches or pull requests

2 participants