Skip to content

Commit

Permalink
Merge 3cbfe24 into 8986ca5
Browse files Browse the repository at this point in the history
  • Loading branch information
jklenzing committed Aug 4, 2022
2 parents 8986ca5 + 3cbfe24 commit 4e20bd6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 44 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
## [0.3.2] - 2022-08-01
* Make OMMBV an optional install
* Access logger directly from pysat
* Use pysat deprecation tests

## [0.3.1] - 2022-05-18
* Include license in package manifest
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Python 3.8+.
| -------------- | ----------------- |
| numpy | aacgmv2 |
| pandas | apexpy |
| pyEphem | pysat>=3.0 |
| pyEphem | pysat>=3.0.2 |
| sgp4>=2.7 | |


Expand All @@ -63,7 +63,7 @@ python setup.py install

Note: pre-1.0.0 version
-----------------------
pysatMissions is currently in an initial development phase and requires pysat 3.0.0.
pysatMissions is currently in an initial development phase and requires pysat 3.0.2.

# Using with pysat

Expand Down
41 changes: 1 addition & 40 deletions pysatMissions/tests/test_deprecation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Unit tests for deprecated methods and objects in pysatMissions."""

import numpy as np
import warnings

import pysat
Expand All @@ -20,41 +19,6 @@ def teardown(self):
"""Clean up test environment after each method."""
return

def eval_deprecation(self, warns, check_msgs, warn_type=DeprecationWarning):
"""Evaluate whether message is contained in DeprecationWarning.
Parameters
----------
warns : list
List of warnings.WarningMessage objects
check_msgs : list
List of strings containing the expected warning messages
warn_type : type
Type for the warning messages (default=DeprecationWarning)
"""

# TODO(#82): Remove when pysat 3.0.2 is released. Replace with
# pysat.utils.testing.eval_warnings

# Ensure the minimum number of warnings were raised
assert len(warns) >= len(check_msgs)

# Initialize the output
found_msgs = [False for msg in check_msgs]

# Test the warning messages, ensuring each attribute is present
for iwar in warns:
for i, msg in enumerate(check_msgs):
if str(iwar.message).find(msg) >= 0:
assert iwar.category == warn_type, \
"bad warning type for message: {:}".format(msg)
found_msgs[i] = True

assert np.all(found_msgs), "did not find {:d} expected {:}".format(
len(found_msgs) - np.sum(found_msgs), repr(warn_type))
return

def test_ephem_deprecation(self):
"""Test that instatiating missions_ephem will give DeprecationWarning."""

Expand All @@ -63,8 +27,5 @@ def test_ephem_deprecation(self):

warn_msgs = ["`missions_ephem` has been deprecated"]

# TODO(#82): Replace with pysat.utils.testing.eval_warnings when pysat
# 3.0.2 is released.

self.eval_deprecation(war, warn_msgs)
pysat.utils.testing.eval_warnings(war, warn_msgs)
return
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ apexpy
geospacepy
numpy
pandas
pysat>=3.0
pysat>=3.0.2
pyEphem
sgp4>=2.7
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ install_requires =
numpy
OMMBV
pandas
pysat>=3.0
pysat
pyEphem
sgp4

Expand Down

0 comments on commit 4e20bd6

Please sign in to comment.