@@ -18,10 +18,10 @@ using MultiScaleTreeGraph
1818using DataFrames
1919using Dates
2020
21- mtg = Node(NodeMTG("/", " Scene" , 1, 0))
22- plant = Node(mtg, NodeMTG("+", " Plant" , 1, 1))
23- internode = Node(plant, NodeMTG("/", " Internode" , 1, 2))
24- Node(internode, NodeMTG("+", " Leaf" , 1, 2))
21+ mtg = Node(NodeMTG("/", : Scene, 1, 0))
22+ plant = Node(mtg, NodeMTG("+", : Plant, 1, 1))
23+ internode = Node(plant, NodeMTG("/", : Internode, 1, 2))
24+ Node(internode, NodeMTG("+", : Leaf, 1, 2))
2525
2626PlantSimEngine.@process "tutorialmeteodriven" verbose=false
2727struct TutorialMeteoDrivenModel <: AbstractTutorialmeteodrivenModel
@@ -35,7 +35,7 @@ function PlantSimEngine.run!(m::TutorialMeteoDrivenModel, models, status, meteo,
3535end
3636PlantSimEngine.timestep_hint(::Type{<:TutorialMeteoDrivenModel}) = (; required=(Minute(30), Hour(2)), preferred=Hour(1))
3737
38- mapping = ModelMapping(" Leaf" => (ModelSpec(TutorialMeteoDrivenModel(Ref(0))),))
38+ mapping = ModelMapping(: Leaf => (ModelSpec(TutorialMeteoDrivenModel(Ref(0))),))
3939meteo_30min = Weather([
4040 Atmosphere(date=DateTime(2025, 6, 12, 12, 0, 0), duration=Minute(30), T=20.0, Wind=1.0, Rh=0.6),
4141 Atmosphere(date=DateTime(2025, 6, 12, 12, 30, 0), duration=Minute(30), T=21.0, Wind=1.0, Rh=0.6),
@@ -47,10 +47,10 @@ out_meteo_driven = run!(
4747 mapping,
4848 meteo_30min;
4949 executor=SequentialEx(),
50- tracked_outputs=Dict(" Leaf" => (:count,)),
50+ tracked_outputs=Dict(: Leaf => (:count,)),
5151)
5252out_meteo_driven_df = PlantSimEngine.convert_outputs(out_meteo_driven, DataFrame)
53- out_meteo_driven_df[" Leaf" ][end, :count]
53+ out_meteo_driven_df[: Leaf][end, :count]
5454```
5555
5656The last value is ` 3.0 ` , showing the model ran on all three 30-minute meteo rows, even though ` preferred=Hour(1) ` .
@@ -79,7 +79,7 @@ function PlantSimEngine.run!(::TutorialHourlyIntegratorModel, models, status, me
7979end
8080
8181mapping_coarse = ModelMapping(
82- " Leaf" => (
82+ : Leaf => (
8383 ModelSpec(TutorialHalfHourSourceModel(Ref(0))),
8484 ModelSpec(TutorialHourlyIntegratorModel()) |>
8585 TimeStepModel(Hour(1)) |>
@@ -100,10 +100,10 @@ out_coarse = run!(
100100 mapping_coarse,
101101 meteo_30min_4;
102102 executor=SequentialEx(),
103- tracked_outputs=Dict(" Leaf" => (:A_hourly, :T_hourly)),
103+ tracked_outputs=Dict(: Leaf => (:A_hourly, :T_hourly)),
104104)
105105out_coarse_df = PlantSimEngine.convert_outputs(out_coarse, DataFrame)
106- (out_coarse_df[" Leaf" ][end, :A_hourly], out_coarse_df[" Leaf" ][end, :T_hourly])
106+ (out_coarse_df[: Leaf][end, :A_hourly], out_coarse_df[: Leaf][end, :T_hourly])
107107```
108108
109109The final tuple is ` (3600.0, 23.0) ` : hourly integrated assimilation (` 1.0 * 1800 s * 2 ` ) and hourly mean temperature over the coarse window.
@@ -124,10 +124,10 @@ using Dates
124124using Statistics
125125
126126# Minimal plant: Scene -> Plant -> Internode -> Leaf
127- mtg = Node(NodeMTG("/", " Scene" , 1, 0))
128- plant = Node(mtg, NodeMTG("+", " Plant" , 1, 1))
129- internode = Node(plant, NodeMTG("/", " Internode" , 1, 2))
130- Node(internode, NodeMTG("+", " Leaf" , 1, 2))
127+ mtg = Node(NodeMTG("/", : Scene, 1, 0))
128+ plant = Node(mtg, NodeMTG("+", : Plant, 1, 1))
129+ internode = Node(plant, NodeMTG("/", : Internode, 1, 2))
130+ Node(internode, NodeMTG("+", : Leaf, 1, 2))
131131
132132meteo_path = joinpath(pkgdir(PlantSimEngine), "examples", "meteo_day.csv")
133133leaf_mesh_path = joinpath(pkgdir(PlantSimEngine), "examples", "leaf_with_petiole.ply")
@@ -208,23 +208,23 @@ plant_daily_proc = process(TutorialPlantDailyModel())
208208plant_weekly_proc = process(TutorialPlantWeeklyModel())
209209
210210mapping = ModelMapping(
211- " Leaf" => (
211+ : Leaf => (
212212 ModelSpec(TutorialLeafHourlyModel()) |>
213213 TimeStepModel(hourly) |>
214214 ScopeModel(:plant),
215215 ),
216- " Plant" => (
216+ : Plant => (
217217 ModelSpec(TutorialPlantDailyModel()) |>
218218 ScopeModel(:plant) |>
219- MultiScaleModel([:leaf_assim_h => " Leaf" ]) |>
219+ MultiScaleModel([:leaf_assim_h => : Leaf]) |>
220220 TimeStepModel(daily) |>
221221 MeteoBindings(
222222 ;
223223 T=MeanWeighted(),
224224 Rh=MeanWeighted(),
225225 Ri_SW_q=(source=:Ri_SW_f, reducer=RadiationEnergy()),
226226 ) |>
227- InputBindings(; leaf_assim_h=(process=leaf_proc, var=:leaf_assim_h, scale=" Leaf" , policy=Integrate())),
227+ InputBindings(; leaf_assim_h=(process=leaf_proc, var=:leaf_assim_h, scale=: Leaf, policy=Integrate())),
228228 ModelSpec(TutorialPlantWeeklyModel()) |>
229229 ScopeModel(:plant) |>
230230 TimeStepModel(weekly) |>
@@ -238,27 +238,27 @@ mapping = ModelMapping(
238238Run directly from ` mtg + mapping ` and request exported series.
239239
240240``` @example multirate_tutorial
241- req_leaf_hourly = OutputRequest(" Leaf" , :leaf_assim_h;
241+ req_leaf_hourly = OutputRequest(: Leaf, :leaf_assim_h;
242242 name=:leaf_assim_hourly,
243243 process=leaf_proc,
244244 policy=HoldLast(),
245245)
246246
247- req_plant_daily = OutputRequest(" Plant" , :plant_assim_d;
247+ req_plant_daily = OutputRequest(: Plant, :plant_assim_d;
248248 name=:plant_assim_daily,
249249 process=plant_daily_proc,
250250 policy=HoldLast(),
251251 clock=daily,
252252)
253253
254- req_plant_daily_T = OutputRequest(" Plant" , :T;
254+ req_plant_daily_T = OutputRequest(: Plant, :T;
255255 name=:T_daily,
256256 process=plant_daily_proc,
257257 policy=HoldLast(),
258258 clock=daily,
259259)
260260
261- req_plant_weekly = OutputRequest(" Plant" , :plant_assim_w;
261+ req_plant_weekly = OutputRequest(: Plant, :plant_assim_w;
262262 name=:plant_assim_weekly,
263263 process=plant_weekly_proc,
264264 policy=HoldLast(),
@@ -301,7 +301,7 @@ Of course the outputs of the models are still available in the `status_outputs`
301301
302302``` @example multirate_tutorial
303303outs = convert_outputs(out_status, DataFrame)
304- outs[" Plant" ][1:3,:]
304+ outs[: Plant][1:3,:]
305305```
306306
307307## 5. Deeper notes
0 commit comments