Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to fix the Mac OS CI builds #67

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- name: Checkout repository
Expand All @@ -33,7 +33,7 @@ jobs:
if: runner.os == 'macOS'
run: |
brew unlink gcc && brew link gcc
brew install automake
brew install automake libtool
./install_tempo2.sh
- name: Install tempo2 on linux
if: runner.os == 'Linux'
Expand All @@ -60,7 +60,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
python-version: '3.10'
- name: Install tempo2 on mac
if: runner.os == 'macOS'
run: |
Expand Down Expand Up @@ -114,4 +114,4 @@ jobs:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*
twine upload dist/*
11 changes: 8 additions & 3 deletions tests/test_fakepulsar.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@
TMP_DIR = Path("test_fake_output")
TMP_DIR.mkdir(exist_ok=True)

try:
NP_LONG_DOUBLE_TYPE = np.float128
except AttributeError:
NP_LONG_DOUBLE_TYPE = np.double


class TestFakePulsar(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.obstimes = np.arange(53000, 54800, 10, dtype=np.float128)
cls.obstimes = np.arange(53000, 54800, 10, dtype=NP_LONG_DOUBLE_TYPE)
cls.toaerr = 1e-3
cls.freq = 1440.0
cls.observatory = "ao"
Expand Down Expand Up @@ -133,7 +138,7 @@ def test_astropy_array(self):
self.assertEqual(len(self.obstimes), psr.nobs)
self.assertTrue(np.all(self.obstimes == self.fakepsr.stoas))
self.assertTrue(np.all(psr.stoas == self.fakepsr.stoas))
self.assertEqual(psr.stoas[0].dtype, np.float128)
self.assertEqual(psr.stoas[0].dtype, NP_LONG_DOUBLE_TYPE)

def test_single_values(self):
"""
Expand All @@ -151,7 +156,7 @@ def test_single_values(self):
self.assertEqual(psr.nobs, 1)
self.assertEqual(len(psr.stoas), 1)
self.assertTrue(np.all(self.fakepsr.stoas[0] == psr.stoas[0]))
self.assertEqual(psr.stoas[0].dtype, np.float128)
self.assertEqual(psr.stoas[0].dtype, NP_LONG_DOUBLE_TYPE)

def test_toa_errs(self):
"""
Expand Down
7 changes: 6 additions & 1 deletion tests/test_pulsar.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
TMP_DIR = Path("test_output")
TMP_DIR.mkdir(exist_ok=True)

try:
NP_LONG_DOUBLE_TYPE = np.float128
except AttributeError:
NP_LONG_DOUBLE_TYPE = np.double


class TestDeterministicSignals(unittest.TestCase):
@classmethod
Expand All @@ -29,7 +34,7 @@ def test_attrs(self):
self.assertTrue(np.all(self.psr.stoas > 50000) and np.all(self.psr.stoas < 59000))
self.assertTrue(np.all(self.psr.toaerrs > 0.01) and np.all(self.psr.toaerrs < 10))
self.assertTrue(np.all(self.psr.freqs > 700) and np.all(self.psr.freqs < 4000))
self.assertEqual(self.psr.stoas[0].dtype, np.float128)
self.assertEqual(self.psr.stoas[0].dtype, NP_LONG_DOUBLE_TYPE)

def test_toas(self):
self.assertTrue(np.all(self.psr.toas() != self.psr.stoas))
Expand Down
Loading