diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fa8f48b..87d462b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,11 +32,17 @@ jobs: run: | cd tests mkdir templ_data - cd templ_data - wget -q -r -nd -np https://people.ast.cam.ac.uk/~koposov/files/rvspecfit_files/v2401/ - mv small_phoenix.tar.gz ../ - cd .. + wget -q https://people.ast.cam.ac.uk/~koposov/files/rvspecfit_files/v2407/small_phoenix.tar.gz tar xfz small_phoenix.tar.gz + mkdir templ_data_desi + cd templ_data_desi/ + wget -q -r -np -nd https://people.ast.cam.ac.uk/~koposov/files/rvspecfit_files/v2407/templ_data_desi/ + cd .. + mkdir templ_data_sdss + cd templ_data_sdss/ + wget -q -r -np -nd https://people.ast.cam.ac.uk/~koposov/files/rvspecfit_files/v2407/templ_data_sdss/ + cd ../data/ + wget https://data.desi.lbl.gov/public/edr/spectro/redux/fuji/healpix/sv1/bright/103/10378/coadd-sv1-bright-10378.fits cd .. - name: Testing run: | diff --git a/tests/accuracy.py b/tests/accuracy.py index 013f2c7..730fb69 100644 --- a/tests/accuracy.py +++ b/tests/accuracy.py @@ -1,4 +1,5 @@ import os + os.environ['OMP_NUM_THREADS'] = '1' import sys import astropy.io.fits as pyfits @@ -13,14 +14,14 @@ class si: - fname = 'tests/test.yaml' + fname = 'tests/yamls/test.yaml' config = utils.read_config(fname) def doone(seed, sn=100, nlam=400, - config_name='tests/test.yaml', + config_name='tests/yamls/test.yaml', doplot=False, resol=1000): diff --git a/tests/test_fit.py b/tests/test_fit.py index 10cde8a..a06d84e 100644 --- a/tests/test_fit.py +++ b/tests/test_fit.py @@ -27,7 +27,7 @@ def test_config(): def test_fit(): - config = utils.read_config(path + '/config.yaml') + config = utils.read_config(path + '/yamls/config_sdss.yaml') # read data dat = pyfits.getdata(path + '/data/spec-0266-51602-0031.fits') diff --git a/tests/test_fit_fake.py b/tests/test_fit_fake.py index 99c1097..f439c4e 100644 --- a/tests/test_fit_fake.py +++ b/tests/test_fit_fake.py @@ -1,4 +1,5 @@ import os + os.environ['OMP_NUM_THREADS'] = '1' import sys import astropy.io.fits as pyfits @@ -14,7 +15,7 @@ def test_fit_fake(): - config = utils.read_config(path + '/test.yaml') + config = utils.read_config(path + '/yamls/test.yaml') # read data lam = np.linspace(4600, 5400, 800) v0 = np.random.normal(0, 100) diff --git a/tests/test_fit_fake_grid.py b/tests/test_fit_fake_grid.py index 4bbbaa0..1891441 100644 --- a/tests/test_fit_fake_grid.py +++ b/tests/test_fit_fake_grid.py @@ -1,4 +1,5 @@ import os + os.environ['OMP_NUM_THREADS'] = '1' import sys import astropy.io.fits as pyfits @@ -10,11 +11,12 @@ import pathlib from mktemps import getspec + path = str(pathlib.Path(__file__).parent.absolute()) def test_fake_grid(): - config = utils.read_config(path + '/test.yaml') + config = utils.read_config(path + '/yamls/test.yaml') # read data lam = np.linspace(4600, 5400, 800) diff --git a/tests/test_interp.py b/tests/test_interp.py index 02dd05d..5e550d1 100644 --- a/tests/test_interp.py +++ b/tests/test_interp.py @@ -1,14 +1,16 @@ import os + os.environ['OMP_NUM_THREADS'] = '1' from rvspecfit import spec_fit from rvspecfit import spec_inter from rvspecfit import utils import pathlib + path = str(pathlib.Path(__file__).parent.absolute()) def test_interp(): - conf = utils.read_config(path + '/config.yaml') + conf = utils.read_config(path + '/yamls/config_sdss.yaml') interp = spec_inter.getInterpolator('sdss1', conf) interp.eval({'teff': 5000, 'logg': 1, 'feh': -1, 'alpha': 0.3}) diff --git a/tests/test_sdss.py b/tests/test_sdss.py index 4ee97ee..df8b12b 100644 --- a/tests/test_sdss.py +++ b/tests/test_sdss.py @@ -18,7 +18,7 @@ def test_fits(): - config = utils.read_config(path + '/config.yaml') + config = utils.read_config(path + '/yamls/config_sdss.yaml') # read data dat = pyfits.getdata(path + '/data/spec-0266-51602-0031.fits') diff --git a/tests/config.yaml b/tests/yamls/config.yaml similarity index 100% rename from tests/config.yaml rename to tests/yamls/config.yaml diff --git a/tests/test.yaml b/tests/yamls/test.yaml similarity index 100% rename from tests/test.yaml rename to tests/yamls/test.yaml