Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pyicon-fraser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Fraser William Goldsworth
pyicon-fraser
Commits
aa5a3c17
Commit
aa5a3c17
authored
2 years ago
by
fraserwg
Browse files
Options
Downloads
Patches
Plain Diff
updated the tests
parent
d92a415e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pyicon/tests/test_pyicon_calc_xr.py
+10
-2
10 additions, 2 deletions
pyicon/tests/test_pyicon_calc_xr.py
with
10 additions
and
2 deletions
pyicon/tests/test_pyicon_calc_xr.py
+
10
−
2
View file @
aa5a3c17
...
...
@@ -63,16 +63,24 @@ def test_xr_crop_tgrid(tgrid, request):
&
(
tgrid
[
"
clat
"
]
>
-
5
)
&
(
tgrid
[
"
clat
"
]
<
5
),
drop
=
True
).
astype
(
"
int32
"
)
# This checks ireg_c is as expected
assert
ireg_c
.
sum
()
==
301614
assert
ireg_c
.
prod
()
==
-
8253145384319188992
cropped_tgrid
=
pyic
.
xr_crop_tgrid
(
tgrid
,
ireg_c
)
# Check ireg_[cev] is present
for
point
in
"
ev
"
:
for
point
in
"
c
ev
"
:
assert
f
"
ireg_
{
point
}
"
in
cropped_tgrid
.
keys
()
# Check ncells == len(ireg_c)
assert
cropped_tgrid
.
dims
[
"
cell
"
]
==
ireg_c
.
sizes
[
"
cell
"
]
# Check ireg_[ev] is correct
# Check ireg_[cev] is correct
# Ideally we would hash the array and compare, but this will probably do
assert
cropped_tgrid
[
"
ireg_c
"
].
sum
()
==
301614
assert
cropped_tgrid
[
"
ireg_c
"
].
prod
()
==
-
8253145384319188992
assert
cropped_tgrid
[
"
ireg_e
"
].
sum
()
==
839941
assert
cropped_tgrid
[
"
ireg_e
"
].
prod
()
==
0
...
...
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