Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
synergy
o3skim
Commits
c82da9a0
Commit
c82da9a0
authored
Jan 21, 2021
by
BorjaEst
Browse files
staticmethod for test xarrays in ext_xarray unittests
parent
79d8e551
Changes
1
Hide whitespace changes
Inline
Side-by-side
o3skim/extended_xarray.py
View file @
c82da9a0
...
...
@@ -47,7 +47,8 @@ class Tests(unittest.TestCase):
pressure_level
=
[
1
,
10
,
100
,
1000
]
time
=
pd
.
date_range
(
"2000-01-01"
,
periods
=
3
)
def
tco3_datarray
(
self
):
@
staticmethod
def
tco3_datarray
():
return
xr
.
DataArray
(
data
=
Tests
.
tco3
,
dims
=
[
"lon"
,
"lat"
,
"time"
],
...
...
@@ -58,8 +59,9 @@ class Tests(unittest.TestCase):
),
attrs
=
dict
(
description
=
"Test tco3 datarray"
)
)
def
vmro3_datarray
(
self
):
@
staticmethod
def
vmro3_datarray
():
return
xr
.
DataArray
(
data
=
Tests
.
vmro3
,
dims
=
[
"lon"
,
"lat"
,
"plev"
,
"time"
],
...
...
@@ -87,6 +89,8 @@ class Tests(unittest.TestCase):
attrs
=
dict
(
description
=
"Test dataset"
)
)
def
test_001
(
self
):
xr
.
testing
.
assert_equal
(
self
.
ds
.
model
.
tco3
,
self
.
tco3_datarray
())
xr
.
testing
.
assert_equal
(
self
.
ds
.
model
.
vmro3
,
self
.
vmro3_datarray
())
def
test_tco3_property
(
self
):
xr
.
testing
.
assert_equal
(
self
.
ds
.
model
.
tco3
,
Tests
.
tco3_datarray
())
def
test_vmro3_property
(
self
):
xr
.
testing
.
assert_equal
(
self
.
ds
.
model
.
vmro3
,
Tests
.
vmro3_datarray
())
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment