Skip to content

Commit

Permalink
Fix start_date
Browse files Browse the repository at this point in the history
It was not working with AtmosCache
  • Loading branch information
Sbozzolo authored and AlexisRenchon committed Oct 28, 2024
1 parent ef31693 commit d703b29
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
8 changes: 7 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# NEWS

v0.2.10
-------
## Bug fixes

Fixed broken `start_date` feature.

v0.2.9
-------

## Features

### Add a `start_date` attribute to NetCDFWriter PR [#94](https://github.com/CliMA/ClimaDiagnostics.jl/pull/94).

Prior to this version, users had to go to the simution to find the start date.
Prior to this version, users had to go to the simulation to find the start date.
It can now be saved as an attribute, making it easily accessible.
To do so, users need to pass the kwarg `start_date` when calling `NetCDFWriter`.

Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ClimaDiagnostics"
uuid = "1ecacbb8-0713-4841-9a07-eb5aa8a2d53f"
authors = ["Gabriele Bozzola <[email protected]>"]
version = "0.2.9"
version = "0.2.10"

[deps]
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
Expand Down
4 changes: 3 additions & 1 deletion src/netcdf_writer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,9 @@ function write_field!(writer::NetCDFWriter, field, diagnostic, u, p, t)

start_date = nothing
if isnothing(writer.start_date)
start_date = get(p, :start_date, nothing)
if hasproperty(p, :start_date)
start_date = getproperty(p, :start_date)
end
else
start_date = writer.start_date
end
Expand Down

2 comments on commit d703b29

@AlexisRenchon
Copy link
Member

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/118249

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.10 -m "<description of version>" d703b297b216bc1e9403d5b3e6b671a52f3d479b
git push origin v0.2.10

Please sign in to comment.