Skip to content

Commit

Permalink
Merge #127
Browse files Browse the repository at this point in the history
127: Fix tc main commit sha r=charleskawczynski a=charleskawczynski

It seems that we're still grabbing commit sha f22e3b2, instead of the latest commit (c360990). This PR uses `Dates` to sort the paths by the date.

Co-authored-by: Charles Kawczynski <[email protected]>
  • Loading branch information
bors[bot] and charleskawczynski authored Aug 15, 2021
2 parents c360990 + 1321913 commit 370cbca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ version = "0.1.0"
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
ArtifactWrappers = "a14bc488-3040-4b00-9dc1-f6467924858a"
CLIMAParameters = "6eacf6c3-8458-43b9-ae03-caf5306d3d53"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Dierckx = "39dd38d3-220a-591b-8e3c-4c3a8c710a94"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
FastGaussQuadrature = "442a2c76-b920-505d-bb47-c5924d526838"
Expand Down
5 changes: 4 additions & 1 deletion integration_tests/utils/compute_mse.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Plots
using OrderedCollections
using Test
import Dates
using NCDatasets
import StatsBase
using Dierckx
Expand Down Expand Up @@ -88,7 +89,8 @@ function find_latest_dataset_folder(; dir = pwd())
end
isempty(matching_paths) && return ""
# sort by timestamp
return pop!(sort(matching_paths))
sorted_paths = sort(matching_paths; by = f -> Dates.unix2datetime(stat(f).mtime))
return pop!(sorted_paths)
end

function compute_mse_wrapper(
Expand All @@ -109,6 +111,7 @@ function compute_mse_wrapper(
# TODO: make this more robust in case folder/file changes
folder_name = joinpath("Output.$case_name.01", "stats")
ds_tc_main_filename = joinpath(path, folder_name, "Stats.$case_name.nc")
@info "TC.jl main dataset: $ds_tc_main_filename"
end
# Note that we're using a closure over
# - PyCLES_output_dataset_path
Expand Down

0 comments on commit 370cbca

Please sign in to comment.