Skip to content

Commit

Permalink
Merge pull request #173 from desihub/fix-ci
Browse files Browse the repository at this point in the history
Get CI running again using newer tag of surveyops
  • Loading branch information
sbailey committed Jul 24, 2024
2 parents e492b7d + 951ad82 commit 3b9af1e
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 106 deletions.
44 changes: 20 additions & 24 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest]
python-version: ['3.9'] # fuji+guadalupe, not ready for 3.10 yet
astropy-version: ['==5.0', '<5.1'] # fuji+guadalupe, latest
fitsio-version: ['==1.1.6', '<2'] # fuji+guadalupe, latest
numpy-version: ['<1.23'] # to keep asscalar, used by astropy
# DESI 24.4 release
python-version: ['3.10']
fitsio-version: ['==1.2.1']
env:
DESIUTIL_VERSION: 3.2.5
DESIUTIL_VERSION: 3.4.2
DESIMODEL_DATA: branches/test-0.19

steps:
Expand All @@ -39,14 +38,14 @@ jobs:
python -m pip install --upgrade pip setuptools wheel
python -m pip install pytest
python -m pip install git+https://github.com/desihub/desiutil.git@${DESIUTIL_VERSION}#egg=desiutil
python -m pip install -U 'numpy${{ matrix.numpy-version }}'
python -m pip install -U 'astropy${{ matrix.astropy-version }}'
python -m pip install -U --no-deps scipy
python -m pip cache remove fitsio
python -m pip install --no-deps --force-reinstall --ignore-installed 'fitsio${{ matrix.fitsio-version }}'
python -m pip install pyyaml requests scipy healpy matplotlib
python -m pip install pyyaml requests
svn export https://desi.lbl.gov/svn/code/desimodel/${DESIMODEL_DATA}/data
# ADM grab the surveyops directory.
wget -e robots=off -r -np -nH --cut-dirs 7 https://data.desi.lbl.gov/public/edr/survey/ops/surveyops/tags/0.1/ops/
# grab surveyops snapshot
wget -nv https://data.desi.lbl.gov/public/epo/example_files/surveyops_2.0_ops.tar.gz
tar xzf surveyops_2.0_ops.tar.gz
- name: Run the test
run: DESIMODEL=$(pwd) DESI_SURVEYOPS=$(pwd) pytest

Expand All @@ -57,12 +56,11 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest]
python-version: ['3.9'] # fuji+guadalupe version
astropy-version: ['==5.0'] # fuji+guadalupe version
fitsio-version: ['==1.1.6'] # fuji+guadalupe version
numpy-version: ['<1.23'] # to keep asscalar, used by astropy
# DESI 24.4 release
python-version: ['3.10']
fitsio-version: ['==1.2.1']
env:
DESIUTIL_VERSION: 3.2.5
DESIUTIL_VERSION: 3.4.2
DESIMODEL_DATA: branches/test-0.17

steps:
Expand All @@ -79,14 +77,14 @@ jobs:
python -m pip install --upgrade pip setuptools wheel
python -m pip install pytest pytest-cov coveralls
python -m pip install git+https://github.com/desihub/desiutil.git@${DESIUTIL_VERSION}#egg=desiutil
python -m pip install -U 'numpy${{ matrix.numpy-version }}'
python -m pip install -U 'astropy${{ matrix.astropy-version }}'
python -m pip install -U --no-deps scipy
python -m pip cache remove fitsio
python -m pip install --no-deps --force-reinstall --ignore-installed 'fitsio${{ matrix.fitsio-version }}'
python -m pip install pyyaml requests scipy healpy matplotlib
python -m pip install pyyaml requests
svn export https://desi.lbl.gov/svn/code/desimodel/${DESIMODEL_DATA}/data
# ADM grab the surveyops directory.
wget -e robots=off -r -np -nH --cut-dirs 7 https://data.desi.lbl.gov/public/edr/survey/ops/surveyops/tags/0.1/ops/
# grab surveyops snapshot
wget -nv https://data.desi.lbl.gov/public/epo/example_files/surveyops_2.0_ops.tar.gz
tar xzf surveyops_2.0_ops.tar.gz
- name: Run the test with coverage
run: DESIMODEL=$(pwd) DESI_SURVEYOPS=$(pwd) pytest --cov
- name: Coveralls
Expand All @@ -102,8 +100,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.9']

python-version: ['3.10']
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -126,7 +123,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.9']
python-version: ['3.10']

steps:
- name: Checkout code
Expand All @@ -143,4 +140,3 @@ jobs:
# This is equivalent to an allowed falure.
continue-on-error: true
run: pycodestyle --count py/desimodel

6 changes: 0 additions & 6 deletions py/desimodel/test/test_fastfiberacceptance.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,5 @@ def test_fastfiberacceptance(self):
val = fa.value("POINT",sigmas=np.linspace(1.0,1.5,3)*fwhm_arcsec_to_sigma_um,offsets=np.zeros(3))
assert(val.size==3)

def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)

if __name__ == '__main__':
unittest.main()
10 changes: 0 additions & 10 deletions py/desimodel/test/test_fieldrot.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,3 @@ def test_angle_with_or_without_astropy(self) :
maxdiff=max(maxdiff,np.abs(angle2-angle1)*3600.)
print("Max. difference = {:3.2f} arcsec".format(maxdiff))
assert(maxdiff<10.)

def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""

# usage, in base directory of desimodel :
# python setup.py test -m desimodel.test.test_fieldrot
return unittest.defaultTestLoader.loadTestsFromName(__name__)
7 changes: 0 additions & 7 deletions py/desimodel/test/test_focalplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,3 @@ def test_gfa_coverage(self):
del targets['TARGET_DEC']
with self.assertRaises(ValueError):
ok = f.targets_on_gfa(telra, teldec, targets) #- no ra/dec

def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
8 changes: 0 additions & 8 deletions py/desimodel/test/test_footprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,3 @@ def test_spatial_real_tiles(self):

# Just interesting to see how many tiles overlap a random point?
### print(np.bincount([len(i) for i in ret]))


def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m desimodel.test.test_footprint
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
6 changes: 0 additions & 6 deletions py/desimodel/test/test_healpix.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,3 @@ def test_pix2tiles(self):
for pix in tileids2pix(nside, tileid):
tiles = pix2tiles(nside, pix)
self.assertIn(tileid, tiles['TILEID'], '{} not in pix2tiles({},{})'.format(tileid, nside, pix))

def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
8 changes: 0 additions & 8 deletions py/desimodel/test/test_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,3 @@ def test_build_gfa_table(self):
gfa.build_gfa_table(testdir='.')
self.assertTrue(os.path.exists('gfa.ecsv'), "Test Failed to create a valid file!")
os.remove('gfa.ecsv')


def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
7 changes: 0 additions & 7 deletions py/desimodel/test/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,3 @@ def test_install(self):
install(desimodel='/opt/desimodel')
self.assertEqual(str(e.exception), "Mock stderr")
Popen.assert_called_with(['svn', 'export', 'https://desi.lbl.gov/svn/code/desimodel/trunk/data'], stderr=-1, stdout=-1)


def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
7 changes: 0 additions & 7 deletions py/desimodel/test/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,3 @@ def test_trim_data(self):
trim.trim_data(indir, self.trimdir)
self.assertTrue(os.path.isdir(self.trimdir))
self.assertGreater(len(list(os.walk(self.trimdir))), 1)


def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
7 changes: 0 additions & 7 deletions py/desimodel/test/test_top_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,3 @@ def test_version(self):
self.assertRegex(theVersion, self.versionre)
except AttributeError:
self.assertRegexpMatches(theVersion, self.versionre)


def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
8 changes: 0 additions & 8 deletions py/desimodel/test/test_trim.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,3 @@ def test_trim_quickpsf(self):
trim_quickpsf('/in/specpsf', '/out/specpsf', 'psf-quicksim.fits')
fits['open'].assert_called_with('/in/specpsf/psf-quicksim.fits')
fits['HDUList']().writeto.assert_called_with('/out/specpsf/psf-quicksim.fits', overwrite=True)


def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
8 changes: 0 additions & 8 deletions py/desimodel/test/test_weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,3 @@ def test_dome_frac_values(self):
replay='Y2017,Y2007')
self.assertTrue(np.all(probs[:365] == t['Y2017']))
self.assertTrue(np.all(probs[365:] == t['Y2007']))


def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)

0 comments on commit 3b9af1e

Please sign in to comment.