From a8f87c870444d6e6dbf75ee3431aaccceec85aa9 Mon Sep 17 00:00:00 2001 From: "Sergey E. Koposov" Date: Tue, 16 Jan 2024 14:14:25 +0000 Subject: [PATCH] fix overflow --- tests/test_fit.py | 6 +++++- tests/test_sdss.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test_fit.py b/tests/test_fit.py index 8da2df1..1a7a235 100644 --- a/tests/test_fit.py +++ b/tests/test_fit.py @@ -1,4 +1,5 @@ import os + os.environ['OMP_NUM_THREADS'] = '1' import sys import pytest @@ -10,8 +11,10 @@ from rvspecfit import vel_fit from rvspecfit import spec_fit from rvspecfit import fitter_ccf + path = str(pathlib.Path(__file__).parent.absolute()) + def test_config(): with pytest.raises(RuntimeError): config = utils.read_config('xx.yaml') @@ -22,6 +25,7 @@ def test_config(): finally: os.chdir(cwd) + def test_fit(): config = utils.read_config(path + '/config.yaml') @@ -29,7 +33,7 @@ def test_fit(): dat = pyfits.getdata(path + '/data/spec-0266-51602-0031.fits') err = dat['ivar'] err = 1. / err**.5 - err[~np.isfinite(err)] = 1e40 + err[~np.isfinite(err)] = 1e30 # construct specdata object specdata = [ diff --git a/tests/test_sdss.py b/tests/test_sdss.py index cf775f2..4ee97ee 100644 --- a/tests/test_sdss.py +++ b/tests/test_sdss.py @@ -24,7 +24,7 @@ def test_fits(): dat = pyfits.getdata(path + '/data/spec-0266-51602-0031.fits') err = dat['ivar'] err = 1. / err**.5 - err[~np.isfinite(err)] = 1e40 + err[~np.isfinite(err)] = 1e30 # construct specdata object specdata = [