Skip to content

feat: default timespan #174

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

Merged
merged 6 commits into from
Jun 3, 2025
Merged

feat: default timespan #174

merged 6 commits into from
Jun 3, 2025

Conversation

pgierz
Copy link
Member

@pgierz pgierz commented Jun 2, 2025

Closes #171

Still needs to be tested (for now manually), and I have no idea how to write tests for this...

Copy link
Member Author

@pgierz pgierz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many of the changes in this PR are cosmetic, I have commented the important parts.

@pgierz
Copy link
Member Author

pgierz commented Jun 2, 2025

Seems to work with the basic example from the workshop. After specifying nothing at all in the user config file, you can see in the log that it will try to use 1YS as a file timespan:

Processing basic.yaml
...
ENABLE_DASK: 'yes'
ENABLE_FLOX: 'yes'
ENABLE_OUTPUT_SUBDIRS: 'no'
FILE_TIMESPAN: 1YS
PARALLEL: 'yes'
PARALLEL_BACKEND: dask
...

The produced files also seem to have correct timestamps:

❯ ls
basic.yaml          tas_Amon_AWI-AWI-CM-1-1-HR_piControl_r1i1p1f1_gn_185001-185012.nc  tas_Amon_AWI-AWI-CM-1-1-HR_piControl_r1i1p1f1_gn_185501-185512.nc
logs                tas_Amon_AWI-AWI-CM-1-1-HR_piControl_r1i1p1f1_gn_185101-185112.nc  tas_Amon_AWI-AWI-CM-1-1-HR_piControl_r1i1p1f1_gn_185601-185612.nc
pymor-basic.slurm   tas_Amon_AWI-AWI-CM-1-1-HR_piControl_r1i1p1f1_gn_185201-185212.nc  tas_Amon_AWI-AWI-CM-1-1-HR_piControl_r1i1p1f1_gn_185701-185712.nc
pymor_report.log    tas_Amon_AWI-AWI-CM-1-1-HR_piControl_r1i1p1f1_gn_185301-185312.nc  tas_Amon_AWI-AWI-CM-1-1-HR_piControl_r1i1p1f1_gn_185801-185812.nc
slurm-17386524.out  tas_Amon_AWI-AWI-CM-1-1-HR_piControl_r1i1p1f1_gn_185401-185412.nc  tas_Amon_AWI-AWI-CM-1-1-HR_piControl_r1i1p1f1_gn_185901-185912.nc

Also internally:

❯ ncdump -h tas_Amon_AWI-AWI-CM-1-1-HR_piControl_r1i1p1f1_gn_185001-185012.nc
netcdf tas_Amon_AWI-AWI-CM-1-1-HR_piControl_r1i1p1f1_gn_185001-185012 {
dimensions:
        time = UNLIMITED ; // (12 currently)
        lat = 360 ;
        lon = 720 ;
variables:
        double lat(lat) ;
                lat:_FillValue = NaN ;
        double lon(lon) ;
                lon:_FillValue = NaN ;
        double time(time) ;
                time:standard_name = "time" ;
                time:long_name = "time" ;
                time:axis = "T" ;
                time:units = "days since 1850-01-01 00:00:00.000000" ;
data:

 time = 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 ;
}

Can be reviewed. If anyone wants to try inventing unit tests, please :-)

@pgierz pgierz marked this pull request as ready for review June 2, 2025 07:06
@pgierz
Copy link
Member Author

pgierz commented Jun 2, 2025

@JanStreffing, I also added you as reviewer since it was your feature request. If you want to try this out, get the branch feat/default_timespan and try re-running some of the workshop examples.

@pgierz pgierz requested a review from siligam June 3, 2025 06:19
@pgierz pgierz added documentation Improvements or additions to documentation enhancement New feature or request labels Jun 3, 2025
@pgierz pgierz self-assigned this Jun 3, 2025
@siligam siligam merged commit 950e427 into main Jun 3, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New default output file split frequency
2 participants