Skip to content

Commit

Permalink
update testing
Browse files Browse the repository at this point in the history
  • Loading branch information
segasai committed Jul 31, 2024
1 parent c96b898 commit a5defbc
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 11 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
5 changes: 3 additions & 2 deletions tests/accuracy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os

os.environ['OMP_NUM_THREADS'] = '1'
import sys
import astropy.io.fits as pyfits
Expand All @@ -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):

Expand Down
2 changes: 1 addition & 1 deletion tests/test_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
3 changes: 2 additions & 1 deletion tests/test_fit_fake.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os

os.environ['OMP_NUM_THREADS'] = '1'
import sys
import astropy.io.fits as pyfits
Expand All @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion tests/test_fit_fake_grid.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os

os.environ['OMP_NUM_THREADS'] = '1'
import sys
import astropy.io.fits as pyfits
Expand All @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion tests/test_interp.py
Original file line number Diff line number Diff line change
@@ -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})

Expand Down
2 changes: 1 addition & 1 deletion tests/test_sdss.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit a5defbc

Please sign in to comment.