Skip to content

Commit d703b29

Browse files
SbozzoloAlexisRenchon
authored andcommitted
Fix start_date
It was not working with AtmosCache
1 parent ef31693 commit d703b29

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

NEWS.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
# NEWS
22

3+
v0.2.10
4+
-------
5+
## Bug fixes
6+
7+
Fixed broken `start_date` feature.
8+
39
v0.2.9
410
-------
511

612
## Features
713

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

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

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ClimaDiagnostics"
22
uuid = "1ecacbb8-0713-4841-9a07-eb5aa8a2d53f"
33
authors = ["Gabriele Bozzola <gbozzola@caltech.edu>"]
4-
version = "0.2.9"
4+
version = "0.2.10"
55

66
[deps]
77
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"

src/netcdf_writer.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,9 @@ function write_field!(writer::NetCDFWriter, field, diagnostic, u, p, t)
358358

359359
start_date = nothing
360360
if isnothing(writer.start_date)
361-
start_date = get(p, :start_date, nothing)
361+
if hasproperty(p, :start_date)
362+
start_date = getproperty(p, :start_date)
363+
end
362364
else
363365
start_date = writer.start_date
364366
end

0 commit comments

Comments
 (0)