Skip to content

Commit 14cd342

Browse files
Fix erroneous use and tests
1 parent 2f755ef commit 14cd342

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

examples/run_nodes.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ rmse = round(rmse_score, digits=4)
5151

5252
import Dates: month, monthday, yearmonth
5353

54-
climate_burnin = climate_data[366:end, :Date]
54+
sim_dates = Streamfall.timesteps(climate)
55+
climate_burnin = sim_dates[366:end]
5556
Streamfall.temporal_cross_section(climate_burnin, dam_obs, dam_sim; period=monthday)
5657
# savefig("temporal_xsection_monthday_ME.png")
5758

src/Climate.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ struct Climate
88
et_id::String
99
t_id::String
1010
end
11-
function Climate(data, p_id, et_id)
11+
function Climate(data::DataFrame, p_id, et_id)
1212
return Climate(data, p_id, et_id, "_T")
1313
end
1414

15-
function Climate(file_path, p_id, et_id; t_id="_T")
15+
function Climate(file_path::String, p_id, et_id; t_id="_T")
1616
climate_data = CSV.read(file_path, DataFrame; comment="#")
1717

1818
return Climate(climate_data, p_id, et_id, t_id)

test/test_nodes.jl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ using Streamfall
1414

1515
# Load climate data, in this case from a CSV file with data for all nodes.
1616
climate_data = CSV.read(
17-
"../test/data/campaspe/climate/climate_historic.csv", DataFrame,
17+
"../test/data/campaspe/climate/climate_historic.csv",
18+
DataFrame;
1819
comment="#",
1920
dateformat="YYYY-mm-dd"
2021
)
@@ -66,10 +67,6 @@ using Streamfall
6667
node_id, node = sn["406219"]
6768
perturbed3 = node.outflow
6869

69-
@info length(baseline_outflow) length(perturbed1) length(perturbed2) length(perturbed3)
70-
@info all((baseline_outflow .+ 10.0) .== perturbed1)
71-
@info sum((baseline_outflow .+ 10.0) .- perturbed1)
72-
7370
@test all(baseline_outflow .!= perturbed1 .!= perturbed2 .!= perturbed3) || "Perturbations resulted in identical streamflows"
7471

7572
# Check that additional interactions are accounted for.

0 commit comments

Comments
 (0)