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

Tr/minor tempest regridder changes #140

Merged
merged 3 commits into from
Dec 17, 2024

Conversation

imreddyTeja
Copy link
Contributor

@imreddyTeja imreddyTeja commented Dec 11, 2024

Purpose

  • Make TempestRegridder support multiple vars (maybe) This is likely not needed. It should be its own PR if we ever decide it is needed, and the implementation/interface requires planning to reflect the design of InterpolatonsRegridder
  • Make outfile_root a kwarg for TempestRegridder Just remove it.
  • improve on read_available_dates
  • Add tests for TempestRegridder and read_available_dates
  • Replace yyyymmdd_to_datetime with Dates built in parsing

To-do

Content


  • I have read and checked the items on the review checklist.

@@ -72,10 +72,10 @@ function Regridders.TempestRegridder(
input_file::AbstractString;
regrid_dir::AbstractString,
mono::Bool = true,
outfile_root::AbstractString = "cgll",
Copy link
Member

Choose a reason for hiding this comment

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

Why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no real need for this to be a kwarg, or outfile_root to be changed in general.

Files saved during Regridding currently have a name structure as

hd_outfile_root * "_" * varname * "_" * string(time) * ".hdf5"

but hd_outfile_root is automatically set to varname, so the path becomes

varname * "_" * varname * "_" * string(time) * ".hdf5"

, which seems odd to me. The changes/potential changes in this PR came up in this PR

Copy link
Member

Choose a reason for hiding this comment

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

Ah okay! I guess we can directly removed the hd_outfile_root then

Copy link
Member

Choose a reason for hiding this comment

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

I agree it's okay to remove it. It would be good to have an organized naming of regridded files when/if we support regridding a file that contains multiple variables. But that can be accomplished using regrid_dir rather than outfile_root.

@imreddyTeja imreddyTeja force-pushed the tr/minor-tempest-regridder-changes branch 3 times, most recently from 24a4192 to 16eaf38 Compare December 16, 2024 20:27
@imreddyTeja imreddyTeja marked this pull request as ready for review December 16, 2024 23:11
Copy link
Member

@Sbozzolo Sbozzolo left a comment

Choose a reason for hiding this comment

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

Thank you!

This was automatically set to `varname`, which resulted
in save paths of the form
varname_varname_time.hdf5. This path is never exposed
to the user, so there is no interface change.
Add very simple TempestRegridder test

Add test for read_available_dates
The functionality of the `yyyymmdd_to_datetime` function
is already contained in the Dates package.
@imreddyTeja imreddyTeja force-pushed the tr/minor-tempest-regridder-changes branch from 16eaf38 to 991b2df Compare December 17, 2024 17:40
@imreddyTeja imreddyTeja merged commit 38c70f1 into main Dec 17, 2024
27 checks passed
@imreddyTeja imreddyTeja deleted the tr/minor-tempest-regridder-changes branch December 17, 2024 18:13
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

Successfully merging this pull request may close these issues.

3 participants