Skip to content

Commit 41322a2

Browse files
Fix typo that propagated throughout
SYMHYD -> SIMHYD
1 parent 5ec296f commit 41322a2

File tree

10 files changed

+55
-55
lines changed

10 files changed

+55
-55
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This package includes implementations of the following:
1616
- GR4J
1717
- HyMod
1818
- IHACRES
19-
- SYMHYD
19+
- SIMHYD
2020

2121
Performance is expected to be similar to implementations in C and Fortran.
2222

@@ -26,7 +26,7 @@ Naive timings (using `@time`) for an example dataset spanning 1963-07-05 - 2014-
2626
0.016502 seconds (469.25 k allocations: 12.902 MiB)
2727
- GR4JNode \
2828
0.015274 seconds (224.75 k allocations: 5.584 MiB)
29-
- SYMHYDNode \
29+
- SIMHYDNode \
3030
0.039540 seconds (638.01 k allocations: 15.190 MiB, 46.99% gc time)
3131
- IHACRESBilinearNode \
3232
0.021734 seconds (675.63 k allocations: 17.773 MiB)

docs/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ makedocs(sitename="Streamfall Documentation",
4040
"API/nodes/IHACRES.md",
4141
"API/nodes/HyMod.md",
4242
"API/nodes/GR4J.md",
43-
"API/nodes/SYMHYD.md",
43+
"API/nodes/SIMHYD.md",
4444
"API/nodes/Dam.md"
4545
],
4646
"API/plotting.md",
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# SYMHYD
1+
# SIMHYD
22

33
```@autodocs
44
Modules = [Streamfall]
55
Order = [:function, :type]
6-
Pages = ["Nodes/SYMHYD/SYMHYDNode.jl"]
6+
Pages = ["Nodes/SIMHYD/SIMHYDNode.jl"]
77
```

docs/src/examples/calibration/custom_calibration.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,16 +173,16 @@ obs_data = CSV.read(
173173
Qo = extract_flow(obs_data, "410730")
174174
climate = extract_climate(obs_data)
175175

176-
# Create one instance each of IHACRES_CMD, GR4J and SYMHYD
176+
# Create one instance each of IHACRES_CMD, GR4J and SIMHYD
177177
ihacres_node = create_node(IHACRESBilinearNode, "410730_ihacres", 129.2)
178178
gr4j_node = create_node(GR4JNode, "410730_gr4j", 129.2)
179-
symhyd_node = create_node(SYMHYDNode, "410730_symhyd", 129.2)
179+
simhyd_node = create_node(SIMHYDNode, "410730_simhyd", 129.2)
180180

181181
# Create a weighted ensemble with equal weights
182182
# The default behavior is to combine component predictions with a normalized weighted sum.
183183
ensemble = create_node(
184184
WeightedEnsembleNode,
185-
[ihacres_node, gr4j_node, symhyd_node],
185+
[ihacres_node, gr4j_node, simhyd_node],
186186
[0.5, 0.5, 0.5]
187187
)
188188

@@ -222,13 +222,13 @@ end
222222
custom_metrics = Dict(
223223
"410730_ihacres" => (obs, sim) -> 1.0 - Streamfall.NmKGE(obs, sim),
224224
"410730_gr4j" => custom_low_flow_objective,
225-
"410730_symhyd" => (obs, sim) -> 1.0 - Streamfall.NmKGE(obs, sim)
225+
"410730_simhyd" => (obs, sim) -> 1.0 - Streamfall.NmKGE(obs, sim)
226226
)
227227

228228
# Copy flow data (these can be nodes in a network)
229229
Qo[:, "410730_ihacres"] = Qo[:, "410730"]
230230
Qo[:, "410730_gr4j"] = Qo[:, "410730"]
231-
Qo[:, "410730_symhyd"] = Qo[:, "410730"]
231+
Qo[:, "410730_simhyd"] = Qo[:, "410730"]
232232

233233
# Copy climate data for each node (these can be nodes in a network)
234234
insertcols!(
@@ -239,9 +239,9 @@ insertcols!(
239239
"410730_gr4j_P" => climate.climate_data[:, "410730_P"],
240240
"410730_gr4j_PET" => climate.climate_data[:, "410730_PET"],
241241
"410730_gr4j_Q" => climate.climate_data[:, "410730_Q"],
242-
"410730_symhyd_P" => climate.climate_data[:, "410730_P"],
243-
"410730_symhyd_PET" => climate.climate_data[:, "410730_PET"],
244-
"410730_symhyd_Q" => climate.climate_data[:, "410730_Q"]
242+
"410730_simhyd_P" => climate.climate_data[:, "410730_P"],
243+
"410730_simhyd_PET" => climate.climate_data[:, "410730_PET"],
244+
"410730_simhyd_Q" => climate.climate_data[:, "410730_Q"]
245245
)
246246

247247
# Use the custom objective function in calibration

docs/src/examples/evaluation/model_comparison.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ end
4545
# Create individual nodes
4646
hymod_node = create_node(SimpleHyModNode, "410730", 129.2)
4747
gr4j_node = create_node(GR4JNode, "410730", 129.2)
48-
symhyd_node = create_node(SYMHYDNode, "410730", 129.2)
48+
simhyd_node = create_node(SIMHYDNode, "410730", 129.2)
4949
ihacres_node = create_node(IHACRESBilinearNode, "410730", 129.2)
5050

5151

5252
# Calibrate each node separately using multiprocessing
53-
node_types = ["HyMod", "GR4J", "SYMHYD", "IHACRES"]
54-
node_list = [hymod_node, gr4j_node, symhyd_node, ihacres_node]
53+
node_types = ["HyMod", "GR4J", "SIMHYD", "IHACRES"]
54+
node_list = [hymod_node, gr4j_node, simhyd_node, ihacres_node]
5555
result = pmap(opt_func, node_list)
5656

5757
# Create comparison plot

docs/src/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This package includes implementations of the following:
1212
- GR4J
1313
- HyMod
1414
- IHACRES
15-
- SYMHYD
15+
- SIMHYD
1616

1717
Performance is expected to be similar to implementations in C and Fortran.
1818

@@ -59,7 +59,7 @@ more "hands-on" overview.
5959
</td>
6060
</tr>
6161
<tr>
62-
<td>SYMHYD</td>
62+
<td>SIMHYD</td>
6363
<td>-</td>
6464
<td>
6565
Chiew, F. H. S., Peel, M. C., Western, A. W., Singh, V. P., & Frevert, D. (2002). Application and testing of the simple rainfall-runoff model SIMHYD. Mathematical models of small watershed hydrology and applications, 335-367.

examples/node_comparison.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ end
3434
# Create individual nodes
3535
hymod_node = create_node(SimpleHyModNode, "410730", 129.2)
3636
gr4j_node = create_node(GR4JNode, "410730", 129.2)
37-
symhyd_node = create_node(SYMHYDNode, "410730", 129.2)
37+
simhyd_node = create_node(SIMHYDNode, "410730", 129.2)
3838
ihacres_node = create_node(IHACRESBilinearNode, "410730", 129.2)
3939

4040

4141
# Calibrate each node separately using multiprocessing
42-
node_names = ["HyMod", "GR4J", "SYMHYD", "IHACRES"]
43-
node_list = [hymod_node, gr4j_node, symhyd_node, ihacres_node]
42+
node_names = ["HyMod", "GR4J", "SIMHYD", "IHACRES"]
43+
node_list = [hymod_node, gr4j_node, simhyd_node, ihacres_node]
4444
result = pmap(opt_func, node_list)
4545

4646

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ using Parameters
22
using ModelParameters
33

44

5-
const SYMHYD_SOIL_ET_CONST = 10.0
5+
const SIMHYD_SOIL_ET_CONST = 10.0
66

7-
Base.@kwdef mutable struct SYMHYDNode{P, A<:AbstractFloat} <: NetworkNode
7+
Base.@kwdef mutable struct SIMHYDNode{P,A<:AbstractFloat} <: NetworkNode
88
name::String
99
area::A
1010

@@ -34,12 +34,12 @@ end
3434

3535

3636
"""
37-
SYMHYDNode(name::String, spec::AbstractDict)::SYMHYDNode
37+
SIMHYDNode(name::String, spec::AbstractDict)::SIMHYDNode
3838
39-
Create SYMHYD node from spec.
39+
Create SIMHYD node from spec.
4040
"""
41-
function SYMHYDNode(name::String, spec::AbstractDict)::SYMHYDNode
42-
n = create_node(SYMHYDNode, name, spec["area"])
41+
function SIMHYDNode(name::String, spec::AbstractDict)::SIMHYDNode
42+
n = create_node(SIMHYDNode, name, spec["area"])
4343
node_params = spec["parameters"]
4444
node_params["sm_store"] = [node_params["initial_sm_store"]]
4545
node_params["gw_store"] = [node_params["initial_gw_store"]]
@@ -70,10 +70,10 @@ function SYMHYDNode(name::String, spec::AbstractDict)::SYMHYDNode
7070
return n
7171
end
7272

73-
function prep_state!(node::SYMHYDNode, sim_length::Int64)::Nothing
74-
resize!(node.sm_store, sim_length+1)
75-
resize!(node.gw_store, sim_length+1)
76-
resize!(node.total_store, sim_length+1)
73+
function prep_state!(node::SIMHYDNode, sim_length::Int64)::Nothing
74+
resize!(node.sm_store, sim_length + 1)
75+
resize!(node.gw_store, sim_length + 1)
76+
resize!(node.total_store, sim_length + 1)
7777
node.sm_store[2:end] .= 0.0
7878
node.gw_store[2:end] .= 0.0
7979
node.total_store[2:end] .= 0.0
@@ -88,11 +88,11 @@ end
8888

8989
"""
9090
run_timestep!(
91-
node::SYMHYDNode, climate::Climate, ts::Int;
91+
node::SIMHYDNode, climate::Climate, ts::Int;
9292
inflow=nothing, extraction=extraction, exchange=nothing
9393
)::AbstractFloat
9494
run_timestep!(
95-
node::SYMHYDNode,
95+
node::SIMHYDNode,
9696
rain::F,
9797
et::F,
9898
ts::Int;
@@ -101,26 +101,26 @@ end
101101
exchange=nothing
102102
)::F where {F<:AbstractFloat}
103103
104-
Run SYMHYD for a given timestep.
104+
Run SIMHYD for a given timestep.
105105
"""
106106
function run_timestep!(
107-
node::SYMHYDNode, climate::Climate, ts::Int;
107+
node::SIMHYDNode, climate::Climate, ts::Int;
108108
inflow=nothing, extraction=extraction, exchange=nothing
109109
)::AbstractFloat
110110
P, E = climate_values(node, climate, ts)
111111

112112
return run_timestep!(node, P, E, ts; inflow=inflow, extraction=extraction, exchange=exchange)
113113
end
114114
function run_timestep!(
115-
node::SYMHYDNode,
115+
node::SIMHYDNode,
116116
rain::F,
117117
et::F,
118118
ts::Int;
119119
inflow=nothing,
120120
extraction=nothing,
121121
exchange=nothing
122122
)::F where {F<:AbstractFloat}
123-
sm_store, gw_store, total_store, total_runoff, baseflow, event_runoff = run_symhyd(node, rain, et, ts)
123+
sm_store, gw_store, total_store, total_runoff, baseflow, event_runoff = run_simhyd(node, rain, et, ts)
124124

125125
node_name = node.name
126126
wo = timestep_value(ts, node_name, "releases", extraction)
@@ -138,15 +138,15 @@ function run_timestep!(
138138
end
139139

140140

141-
function update_state!(node::SYMHYDNode, sm_store, gw_store, total_store, outflow, baseflow, quickflow)
141+
function update_state!(node::SIMHYDNode, sm_store, gw_store, total_store, outflow, baseflow, quickflow)
142142
push!(node.sm_store, sm_store)
143143
push!(node.gw_store, gw_store)
144144
push!(node.total_store, total_store)
145145
push!(node.outflow, outflow)
146146
push!(node.baseflow, baseflow)
147147
push!(node.quickflow, quickflow)
148148
end
149-
function update_state!(node::SYMHYDNode, ts::Int64, sm_store, gw_store, total_store, outflow, baseflow, quickflow)
149+
function update_state!(node::SIMHYDNode, ts::Int64, sm_store, gw_store, total_store, outflow, baseflow, quickflow)
150150
node.sm_store[ts+1] = sm_store
151151
node.gw_store[ts+1] = gw_store
152152
node.total_store[ts+1] = total_store
@@ -157,7 +157,7 @@ end
157157

158158
"""
159159
update_params!(
160-
node::SYMHYDNode,
160+
node::SIMHYDNode,
161161
baseflow_coef::Float64,
162162
impervious_threshold::Float64,
163163
infiltration_coef::Float64,
@@ -172,7 +172,7 @@ end
172172
Update model parameters.
173173
"""
174174
function update_params!(
175-
node::SYMHYDNode,
175+
node::SIMHYDNode,
176176
baseflow_coef::Float64,
177177
impervious_threshold::Float64,
178178
infiltration_coef::Float64,
@@ -198,11 +198,11 @@ end
198198

199199

200200
"""
201-
reset!(node::SYMHYDNode)::Nothing
201+
reset!(node::SIMHYDNode)::Nothing
202202
203203
Reset node. Clears all states back to their initial values.
204204
"""
205-
function reset!(node::SYMHYDNode)::Nothing
205+
function reset!(node::SIMHYDNode)::Nothing
206206
# stores
207207
node.sm_store = [node.sm_store[1]]
208208
node.gw_store = [node.gw_store[1]]
@@ -218,18 +218,18 @@ end
218218

219219

220220
"""
221-
run_symhyd(node::SYMHYDNode, P::F, ET::F, ts::Int64)::NTuple{6,F} where {F<:Float64}
221+
run_simhyd(node::SIMHYDNode, P::F, ET::F, ts::Int64)::NTuple{6,F} where {F<:Float64}
222222
223-
Run SYMHYD for a single time step with given inputs and state variables.
223+
Run SIMHYD for a single time step with given inputs and state variables.
224224
"""
225-
function run_symhyd(node::SYMHYDNode, P::F, ET::F, ts::Int64)::NTuple{6,F} where {F<:Float64}
225+
function run_simhyd(node::SIMHYDNode, P::F, ET::F, ts::Int64)::NTuple{6,F} where {F<:Float64}
226226

227227
sm_store::F = node.sm_store[ts]
228228
gw_store::F = node.gw_store[ts]
229229
total_store::F = node.total_store[ts]
230230

231231
pervious_incident::F = P
232-
impervious_incident::F = P
232+
impervious_incident::F = P
233233

234234
impervious_ET::F = min(node.impervious_threshold, impervious_incident)
235235
impervious_runoff::F = impervious_incident - impervious_ET
@@ -264,7 +264,7 @@ function run_symhyd(node::SYMHYDNode, P::F, ET::F, ts::Int64)::NTuple{6,F} where
264264
baseflow_runoff::F = node.baseflow_coef.val::F * gw_store
265265
gw_store -= baseflow_runoff
266266

267-
soil_ET::F = min(sm_store, min(ET - interception_ET, sm_fraction*SYMHYD_SOIL_ET_CONST))
267+
soil_ET::F = min(sm_store, min(ET - interception_ET, sm_fraction * SIMHYD_SOIL_ET_CONST))
268268
sm_store -= soil_ET
269269

270270
pervious_frac::F = node.pervious_fraction.val::F
@@ -274,6 +274,6 @@ function run_symhyd(node::SYMHYDNode, P::F, ET::F, ts::Int64)::NTuple{6,F} where
274274
total_runoff::F = event_runoff + pervious_frac * baseflow_runoff
275275
baseflow::F = baseflow_runoff * pervious_frac
276276

277-
# values for time step...
278-
return sm_store, gw_store, total_store, total_runoff, baseflow, event_runoff
277+
# values for time step...
278+
return sm_store, gw_store, total_store, total_runoff, baseflow, event_runoff
279279
end

src/Streamfall.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ include("Nodes/IHACRES/IHACRESNode.jl")
1515
# include("Nodes/IHACRES/IHACRESExpuhNode.jl")
1616
include("Nodes/GR4J/GR4JNode.jl")
1717
include("Nodes/HyMod/HyModNode.jl")
18-
include("Nodes/SYMHYD/SYMHYDNode.jl")
18+
include("Nodes/SIMHYD/SIMHYDNode.jl")
1919
include("Nodes/DamNode.jl")
2020
include("Nodes/Ensembles/EnsembleNode.jl")
2121

@@ -279,7 +279,7 @@ end
279279
# Nodes
280280
export NetworkNode, GenericNode, GenericDirectNode
281281
export IHACRES, IHACRESNode, IHACRESBilinearNode, DamNode, Climate
282-
export create_node, GR4JNode, HyModNode, SimpleHyModNode, SYMHYDNode
282+
export create_node, GR4JNode, HyModNode, SimpleHyModNode, SIMHYDNode
283283
export EnsembleNode, WeightedEnsembleNode, GREnsembleNode
284284

285285
# Network

test/runtests.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ TEST_DIR = @__DIR__
1414

1515
gr4j = create_node(GR4JNode, "GR4J", 100.0)
1616
hymod = create_node(SimpleHyModNode, "HyMod", 100.0)
17-
symhyd = create_node(SYMHYDNode, "SYMHYD", 100.0)
17+
simhyd = create_node(SIMHYDNode, "SIMHYD", 100.0)
1818

1919
@testset "Running a single timestep" begin
2020
# Prep and run a single timestep simulation for each model
@@ -31,8 +31,8 @@ TEST_DIR = @__DIR__
3131
Streamfall.prep_state!(hymod, 1)
3232
@test Streamfall.run_timestep!(hymod, 6.0, 3.0, 1) isa AbstractFloat
3333

34-
Streamfall.prep_state!(symhyd, 1)
35-
@test Streamfall.run_timestep!(symhyd, 6.0, 3.0, 1) isa AbstractFloat
34+
Streamfall.prep_state!(simhyd, 1)
35+
@test Streamfall.run_timestep!(simhyd, 6.0, 3.0, 1) isa AbstractFloat
3636
end
3737

3838
end

0 commit comments

Comments
 (0)