Skip to content

Commit 13c6d4d

Browse files
committed
Attempt at activating benchmarks on a dev branch, using PBP and XPalm's own dev branches, see what happens
1 parent 48789d8 commit 13c6d4d

5 files changed

Lines changed: 13 additions & 10 deletions

File tree

.github/workflows/benchmarks_and_downstream.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: BenchmarksAndDownstream
22
on:
33
push:
44
branches:
5-
- main
5+
- dev
66
- benchmarks-github-action
77
tags: "*"
88
workflow-dispatch:
@@ -30,6 +30,7 @@ jobs:
3030
arch:
3131
- x64
3232
package:
33+
# the group setting is unused atm
3334
- {user: VEZY, repo: PlantSimEngine.jl, group: Downstream}
3435
steps:
3536
- uses: actions/checkout@v4

test/downstream/Project.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
33
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
44
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
55
MultiScaleTreeGraph = "dd4a991b-8a45-4075-bede-262ee62d5583"
6-
PlantBiophysics = "7ae8fcfa-76ad-4ec6-9ea7-5f8f5e2d6ec9"
76
PlantMeteo = "4630fe09-e0fb-4da5-a846-781cb73437b6"
87
PlantSimEngine = "9a576370-710b-4269-adf9-4f603a9c6423"
98
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

test/downstream/test-all-benchmarks.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ suite[suite_name]["PBP_multiple_timesteps_MT"] = @benchmarkable benchmark_plantb
3737
suite[suite_name]["PBP_multiple_timesteps_ST"] = @benchmarkable benchmark_plantbiophysics_multitimestep_ST($leaf, $meteo)
3838

3939
# "XPalm benchmark"
40-
#=include("test-xpalm.jl")
40+
include("test-xpalm.jl")
4141
suite[suite_name]["XPalm_setup"] = @benchmarkable xpalm_default_param_create() seconds = 120
4242

4343
palm, models, out_vars, meteo = xpalm_default_param_create()
4444
sim_outputs = xpalm_default_param_run(palm, models, out_vars, meteo)
4545

4646
suite[suite_name]["XPalm_run"] = @benchmarkable xpalm_default_param_run($palm, $models, $out_vars, $meteo) seconds = 120
4747
suite[suite_name]["XPalm_convert_outputs"] = @benchmarkable xpalm_default_param_convert_outputs($sim_outputs) seconds = 120
48-
=#
48+
4949
tune!(suite)
5050
results = run(suite, verbose=true)
5151
BenchmarkTools.save(dirname(@__FILE__) * "/output.json", median(results))

test/downstream/test-plantbiophysics.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
#using Pkg
33
#Pkg.develop("PlantSimEngine")
44
#using PlantSimEngine
5+
6+
using Pkg
7+
Pkg.add(url="https://github.com/VEZY/PlantBiophysics.jl#dev")
58
using Statistics
69
#using DataFrames
710
#using CSV

test/downstream/test-xpalm.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# no release of XPalm yet, so can't just add it to the .toml
66
using Pkg
7-
Pkg.add(url="https://github.com/PalmStudio/XPalm.jl")
7+
Pkg.add(url="https://github.com/PalmStudio/XPalm.jl#dev")
88

99
using Test
1010
using PlantMeteo#, MultiScaleTreeGraph
@@ -15,8 +15,8 @@ using XPalm
1515
using BenchmarkTools
1616

1717
function xpalm_default_param_create()
18-
meteo = CSV.read("../XPalm.jl/0-data/Meteo_Nigeria_PR.txt", DataFrame)
19-
meteo.duration = [Dates.Day(i[1:1]) for i in meteo.duration]
18+
meteo = CSV.read(joinpath(dirname(dirname(pathof(XPalm))),"0-data","meteo.csv"), DataFrame)
19+
#meteo.duration = [Dates.Day(i[1:1]) for i in meteo.duration]
2020
m = Weather(meteo)
2121

2222
out_vars = Dict{String,Any}(
@@ -32,12 +32,12 @@ function xpalm_default_param_create()
3232
)
3333

3434
# Example 1: Run the model with the default parameters (but output as a DataFrame):
35-
palm = Palm(initiation_age=0, parameters=default_parameters())
36-
models = model_mapping(palm)
35+
palm = XPalm.Palm(initiation_age=0, parameters=XPalm.default_parameters())
36+
models = XPalm.model_mapping(palm)
3737
return palm, models, out_vars, meteo
3838
end
3939

40-
function xpalm_default_param_run(palm, models, meteo, out_vars)
40+
function xpalm_default_param_run(palm, models, out_vars, meteo)
4141
sim_outputs = PlantSimEngine.run!(palm.mtg, models, meteo, tracked_outputs=out_vars, executor=PlantSimEngine.SequentialEx(), check=false)
4242
return sim_outputs
4343
end

0 commit comments

Comments
 (0)