Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Persefone.jl
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Persefone
Persefone.jl
Commits
671cdb60
Commit
671cdb60
authored
1 month ago
by
Marco Matthies
Browse files
Options
Downloads
Patches
Plain Diff
Rearrange weather unit tests
parent
69ee3eb9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
test/landscape_tests.jl
+1
-1
1 addition, 1 deletion
test/landscape_tests.jl
test/runtests.jl
+3
-0
3 additions, 0 deletions
test/runtests.jl
test/weather_tests.jl
+27
-0
27 additions, 0 deletions
test/weather_tests.jl
with
31 additions
and
1 deletion
test/landscape_tests.jl
+
1
−
1
View file @
671cdb60
...
...
@@ -64,7 +64,7 @@ end
@test
Ps
.
distancetoedge
((
6
,
6
),
model
)
==
20
m
end
@testset
"Weather in
itialisation
"
begin
@testset
"Weather in
terface
"
begin
# these tests are specific to the Jena weather file
model
=
inittestmodel
()
@test
length
(
model
.
weather
)
==
59
...
...
This diff is collapsed.
Click to expand it.
test/runtests.jl
+
3
−
0
View file @
671cdb60
...
...
@@ -92,6 +92,9 @@ end
include
(
"landscape_tests.jl"
)
include
(
"simulation_tests.jl"
)
end
@testset
"Weather model"
begin
include
(
"weather_tests.jl"
)
end
@testset
"Nature model"
begin
include
(
"nature_tests.jl"
)
end
...
...
This diff is collapsed.
Click to expand it.
test/weather_tests.jl
0 → 100644
+
27
−
0
View file @
671cdb60
@testset
"Constructor and interface"
begin
float3
=
[
0.0
,
1.0
,
2.0
]
missing3
=
Union
{
Missing
,
Float64
}[
missing
,
missing
,
missing
]
weather
=
Weather
(;
firstdate
=
Date
(
"2000-01-01"
),
lastdate
=
Date
(
"2000-01-03"
),
windspeed
=
missing3
,
precipitation
=
float3
,
sunshine
=
missing3
,
cloudcover
=
missing3
,
humidity
=
missing3
,
meantemp
=
float3
,
maxtemp
=
float3
,
mintemp
=
float3
,
evapotranspiration
=
float3
)
date
=
Date
(
"2000-01-02"
)
@test
length
(
weather
)
==
3
@test
Ps
.
daynumber
(
weather
,
date
)
==
2
@test
Ps
.
windspeed
(
weather
,
date
)
|>
ismissing
@test
Ps
.
precipitation
(
weather
,
date
)
==
1.0
@test
Ps
.
sunshine
(
weather
,
date
)
|>
ismissing
@test
Ps
.
humidity
(
weather
,
date
)
|>
ismissing
@test
Ps
.
meantemp
(
weather
,
date
)
==
1.0
@test
Ps
.
maxtemp
(
weather
,
date
)
==
1.0
@test
Ps
.
mintemp
(
weather
,
date
)
==
1.0
@test
Ps
.
evapotranspiration
(
weather
,
date
)
==
1.0
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment