Skip to content

Commit

Permalink
Handle larger caches
Browse files Browse the repository at this point in the history
  • Loading branch information
ctessum committed Sep 15, 2024
1 parent 0f5b545 commit 2b71ade
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "EarthSciData"
uuid = "a293c155-435f-439d-9c11-a083b6b47337"
authors = ["EarthSciML Authors"]
version = "0.9.3"
version = "0.9.4"

[deps]
DataInterpolations = "82cc6244-b520-54b8-b5a6-8a565e85f1d0"
Expand Down
2 changes: 1 addition & 1 deletion src/load.jl
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ mutable struct DataSetInterpolator{To,N,N2,FT,ITPT}
interp_cache = similar(data)
N = ndims(data)
N2 = N - 1
times = [DateTime(0, i, 1) for i 1:cache_size]
times = [DateTime(0, 1, 1) + Hour(i) for i 1:cache_size]
_, itp2 = create_interpolator!(To, interp_cache, data, metadata, times)
ITPT = typeof(itp2)

Expand Down
4 changes: 4 additions & 0 deletions test/load_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ end

fs = DummyFileSet(DateTime(2022, 4, 30), DateTime(2022, 5, 4))

@testset "big cache" begin
@test_nowarn EarthSciData.DataSetInterpolator{Float32}(fs, "U", fs.start; cache_size=100)
end

itp = EarthSciData.DataSetInterpolator{Float32}(fs, "U", fs.start; cache_size=5)
dfi = EarthSciData.DataFrequencyInfo(fs, fs.start)

Expand Down

4 comments on commit 2b71ade

@ctessum
Copy link
Member Author

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/115239

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.9.4 -m "<description of version>" 2b71ade0470d4a9abc77877eb7d11679e3dc2801
git push origin v0.9.4

@ctessum
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register

Release notes:

Fixed bug that was preventing large cache sizes.

@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 updated: JuliaRegistries/General/115239

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.9.4 -m "<description of version>" 2b71ade0470d4a9abc77877eb7d11679e3dc2801
git push origin v0.9.4

Please sign in to comment.