Skip to content

Commit

Permalink
MAINT: remove tests no longer suported by pysat
Browse files Browse the repository at this point in the history
  • Loading branch information
jklenzing committed Oct 4, 2023
1 parent 59503ce commit 438be78
Showing 1 changed file with 3 additions and 146 deletions.
149 changes: 3 additions & 146 deletions pysatSeasons/tests/test_avg.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,127 +199,13 @@ def setup_method(self):
return


class TestFrameProfileAverages(object):
"""Test bin averaging dataframes from pandas data sources."""

def setup_method(self):
"""Run before every method to create a clean testing setup."""
self.testInst = pysat.Instrument('pysat', 'testing2D',
clean_level='clean')
self.testInst.bounds = (dt.datetime(2008, 1, 1),
dt.datetime(2008, 1, 3))
self.dname = 'alt_profiles'
self.test_vals = np.arange(50) * 1.2
self.test_fracs = np.arange(50) / 50.0

return

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

return

def test_basic_seasonal_2Dmedian(self):
"""Test the basic seasonal 2D median."""

results = avg.median2D(self.testInst, [0., 360., 24], 'longitude',
[0., 24., 24], 'mlt', [self.dname])

# Test medians.
for i, row in enumerate(results[self.dname]['median']):
for j, item in enumerate(row):
assert np.all(item['density'] == self.test_vals)
assert np.all(item['fraction'] == self.test_fracs)

# No variation in the median, all values should be the same
for i, row in enumerate(results[self.dname]['avg_abs_dev']):
for j, item in enumerate(row):
assert np.all(item['density'] == 0)
assert np.all(item['fraction'] == 0)

return

def test_basic_seasonal_1Dmedian(self):
"""Test the basic seasonal 1D median."""

results = avg.median1D(self.testInst, [0., 24, 24], 'mlt',
[self.dname])

# Test medians.
for i, row in enumerate(results[self.dname]['median']):
assert np.all(row['density'] == self.test_vals)
assert np.all(row['fraction'] == self.test_fracs)

# No variation in the median, all values should be the same.
for i, row in enumerate(results[self.dname]['avg_abs_dev']):
assert np.all(row['density'] == 0)
assert np.all(row['fraction'] == 0)

return


class TestSeriesProfileAverages(object):
"""Test bin averaging series profile data from pandas data sources."""

def setup_method(self):
"""Run before every method to create a clean testing setup."""
self.testInst = pysat.Instrument('pysat', 'testing2D',
clean_level='clean')
self.testInst.bounds = (dt.datetime(2008, 1, 1),
dt.datetime(2008, 2, 1))
self.dname = 'series_profiles'
self.test_vals = np.arange(50) * 1.2

return

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

return

def test_basic_seasonal_median2D(self):
"""Test basic seasonal 2D median."""
results = avg.median2D(self.testInst, [0., 360., 24], 'longitude',
[0., 24., 24], 'mlt', [self.dname])

# Test medians.
for i, row in enumerate(results[self.dname]['median']):
for j, item in enumerate(row):
assert np.all(item[self.dname] == self.test_vals)

# No variation in the median, all values should be the same.
for i, row in enumerate(results[self.dname]['avg_abs_dev']):
for j, item in enumerate(row):
assert np.all(item[self.dname] == 0)

return

def test_basic_seasonal_median1D(self):
"""Test basic seasonal 1D median."""

results = avg.median1D(self.testInst, [0., 24., 24], 'mlt',
[self.dname])

# Test medians.
for i, row in enumerate(results[self.dname]['median']):
assert np.all(row[self.dname] == self.test_vals)

# No variation in the median, all values should be the same.
for i, row in enumerate(results[self.dname]['avg_abs_dev']):
assert np.all(row[self.dname] == 0)

return


class TestXarrayProfileAverages(object):
"""Test bin averaging profile data from xarray data sources."""

def setup_method(self):
"""Run before every method to create a clean testing setup."""

self.testInst = pysat.Instrument('pysat', 'testing2D_xarray',
self.testInst = pysat.Instrument('pysat', 'ndtesting',
clean_level='clean')
self.testInst.bounds = (dt.datetime(2008, 1, 1),
dt.datetime(2008, 2, 1))
Expand Down Expand Up @@ -383,7 +269,7 @@ class TestXarrayVariableProfileAverages(TestXarrayProfileAverages):

def setup_method(self):
"""Run before every method to create a clean testing setup."""
self.testInst = pysat.Instrument('pysat', 'testing2D_xarray',
self.testInst = pysat.Instrument('pysat', 'ndtesting',
clean_level='clean')
self.testInst.bounds = (dt.datetime(2008, 1, 1),
dt.datetime(2008, 2, 1))
Expand All @@ -398,7 +284,7 @@ class TestXarrayImageAverages(TestXarrayProfileAverages):

def setup_method(self):
"""Run before every method to create a clean testing setup."""
self.testInst = pysat.Instrument('pysat', 'testing2D_xarray',
self.testInst = pysat.Instrument('pysat', 'ndtesting',
clean_level='clean')
self.testInst.bounds = (dt.datetime(2008, 1, 1),
dt.datetime(2008, 2, 1))
Expand Down Expand Up @@ -524,35 +410,6 @@ def teardown_method(self):
return


class Test2DConstellation(TestSeriesProfileAverages):
"""Test seasonal analysis for 2D pandas constellations."""

def setup_method(self):
"""Run before every method to create a clean testing setup."""

self.insts = []
self.testInst = pysat.Instrument('pysat', 'testing2D',
clean_level='clean')
self.testInst.bounds = (dt.datetime(2008, 1, 1),
dt.datetime(2008, 1, 3))
self.insts.append(self.testInst)
self.insts.append(self.testInst)

self.dname = 'series_profiles'
self.test_vals = np.arange(50) * 1.2

self.testC = pysat.Constellation(instruments=self.insts)

return

def teardown_method(self):
"""Run after every method to clean up previous testing."""

del self.testC, self.insts, self.testInst, self.dname, self.test_vals

return


class TestSeasonalAverageUnevenBins(TestBasics):
"""Test seasonal analysis for uneven bins."""

Expand Down

0 comments on commit 438be78

Please sign in to comment.