File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
77OhMyThreads = " 67456a42-1dca-4109-a031-0a68de7e3ad5"
88OrdinaryDiffEq = " 1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
99Plots = " 91a5bcdd-55d7-5caf-9e0b-520d859cae80"
10+ ProfileView = " c46f51b8-102a-5cf2-8d2c-8597cb0e0da7"
1011SolarPosition = " 5b9d1343-a731-5a90-8730-7bf8d89bf3eb"
1112StructArrays = " 09ab397b-f2b6-538f-b94a-2f83cf4a842a"
1213
Original file line number Diff line number Diff line change 1+ """ Profiling example for SolarPosition.jl using ProfileView."""
2+
3+ using Pkg
4+ Pkg. activate (@__DIR__ )
5+ Pkg. instantiate ()
6+
7+ using Dates
8+ using SolarPosition
9+
10+ # define observer location (latitude, longitude, altitude in meters)
11+ obs = Observer (52.358134610343214 , 4.881269505489815 , 0.0 ) # Van Gogh Museum
12+
13+ # a whole year of hourly timestamps for profiling
14+ times = collect (DateTime (2023 ): Minute (1 ): DateTime (2024 ))
15+
16+ # warm up the function to compile
17+ solar_position (obs, times, PSA ())
18+
19+ # profile the PSA algorithm with multiple iterations for better sampling
20+ @profview for _ = 1 : 1000
21+ solar_position (obs, times, PSA ())
22+ end
You can’t perform that action at this time.
0 commit comments