Skip to content

Commit

Permalink
MAINT: replace testing_xarray
Browse files Browse the repository at this point in the history
  • Loading branch information
jklenzing committed Oct 4, 2023
1 parent dd67193 commit ea9e856
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
13 changes: 7 additions & 6 deletions pysatSeasons/tests/test_avg.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,13 @@ def setup_method(self):
self.testInst.bounds = (dt.datetime(2008, 1, 1),
dt.datetime(2008, 2, 1))
self.dname = 'profiles'
self.test_val_length = 15
self.test_name = 'z'

return

def teardown_method(self):
"""Run after every method to clean up previous testing."""
del self.testInst, self.dname, self.test_val_length
del self.testInst, self.dname, self.test_name

return

Expand Down Expand Up @@ -245,10 +245,11 @@ def test_basic_seasonal_median1D(self):
results = avg.median1D(self.testInst, [0., 24., 24], 'mlt',
[self.dname])

test_val_length = self.testInst.data.coords[self.test_name].shape[0]
for i, row in enumerate(results[self.dname]['median']):
# Define truth values. There is a variation in value based on
# longitude, at thousands level. MLT only shows at ones/tens level.
test_vals = [i] * self.test_val_length
test_vals = [i] * test_val_length
vals = []
for val in row[self.dname].values:
if not isinstance(val, np.float64):
Expand All @@ -274,7 +275,7 @@ def setup_method(self):
self.testInst.bounds = (dt.datetime(2008, 1, 1),
dt.datetime(2008, 2, 1))
self.dname = 'variable_profiles'
self.test_val_length = 15
self.test_name = 'z'

return

Expand All @@ -289,13 +290,13 @@ def setup_method(self):
self.testInst.bounds = (dt.datetime(2008, 1, 1),
dt.datetime(2008, 2, 1))
self.dname = 'images'
self.test_val_length = 17
self.test_name = 'x'

return

def teardown_method(self):
"""Run after every method to clean up previous testing."""
del self.testInst, self.dname, self.test_val_length
del self.testInst, self.dname, self.test_name

return

Expand Down
2 changes: 1 addition & 1 deletion pysatSeasons/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class TestCoreXarray(TestCore):

def setup_method(self):
"""Run before every method to create a clean testing setup."""
self.testInst = pysat.Instrument(inst_module=pinsts.pysat_testing_xarray,
self.testInst = pysat.Instrument(inst_module=pinsts.pysat_ndtesting,
clean_level='clean', use_header=True)
self.bounds1 = self.testInst.inst_module._test_dates['']['']
return
Expand Down
8 changes: 4 additions & 4 deletions pysatSeasons/tests/test_occur_prob.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,12 @@ class TestXarrayBasics(TestBasics):
def setup_method(self):
"""Run before every method to create a clean testing setup."""
orbit_info = {'index': 'longitude', 'kind': 'longitude'}
self.testInst = pysat.Instrument('pysat', 'testing_xarray',
self.testInst = pysat.Instrument('pysat', 'ndtesting',
clean_level='clean',
orbit_info=orbit_info)

# Assign short bounds.
test_date = pysat.instruments.pysat_testing_xarray._test_dates['']['']
test_date = pysat.instruments.pysat_ndtesting._test_dates['']['']
self.testInst.bounds = (test_date, test_date + dt.timedelta(days=1))

return
Expand Down Expand Up @@ -220,12 +220,12 @@ class TestXarrayConstellationBasics(TestBasics):
def setup_method(self):
"""Run before every method to create a clean testing setup."""
orbit_info = {'index': 'longitude', 'kind': 'longitude'}
self.rawInst = pysat.Instrument('pysat', 'testing_xarray',
self.rawInst = pysat.Instrument('pysat', 'ndtesting',
clean_level='clean',
orbit_info=orbit_info)

# Assign short bounds.
test_date = pysat.instruments.pysat_testing_xarray._test_dates['']['']
test_date = pysat.instruments.pysat_ndtesting._test_dates['']['']
self.rawInst.bounds = (test_date, test_date + dt.timedelta(days=1))

self.testInst = pysat.Constellation(instruments=[self.rawInst,
Expand Down
4 changes: 2 additions & 2 deletions pysatSeasons/tests/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class TestXarrayBasics(TestBasics):

def setup_method(self):
"""Run before every method to create a clean testing setup."""
self.testInst = pysat.Instrument('pysat', 'testing_xarray',
self.testInst = pysat.Instrument('pysat', 'ndtesting',
clean_level='clean')
self.testInst.bounds = (dt.datetime(2008, 1, 1),
dt.datetime(2008, 1, 1))
Expand Down Expand Up @@ -132,7 +132,7 @@ class TestXarrayConstellationBasics(TestXarrayBasics):

def setup_method(self):
"""Run before every method to create a clean testing setup."""
self.rawInst = pysat.Instrument('pysat', 'testing_xarray',
self.rawInst = pysat.Instrument('pysat', 'ndtesting',
clean_level='clean')
self.rawInst.bounds = (dt.datetime(2008, 1, 1),
dt.datetime(2008, 1, 31))
Expand Down

0 comments on commit ea9e856

Please sign in to comment.