Skip to content

Commit

Permalink
remove tests that use BTSETTL
Browse files Browse the repository at this point in the history
  • Loading branch information
kelle committed Nov 13, 2024
1 parent 0ee4e89 commit 0c7ecb0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
11 changes: 9 additions & 2 deletions sedkit/tests/test_modelgrid.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import unittest
import pytest
import os
import importlib_resources

Expand Down Expand Up @@ -32,6 +33,7 @@ def setUp(self):

self.bt = mg.BTSettl()

@pytest.mark.skip(reason="BTSettl grid is not currently available")
def test_get_spectrum(self):
"""Test the get_spectrum method"""
# On grid specific
Expand All @@ -43,27 +45,32 @@ def test_get_spectrum(self):
# Off grid
spec = self.bt.get_spectrum(teff=3456, logg=5., alpha=0, meta=0)

@pytest.mark.skip(reason="BTSettl grid is not currently available")
def test_resample_grid(self):
"""Test resample_grid method"""
bt = self.bt
new = bt.resample_grid(teff=[3500, 3600, 3700], logg=[5.], meta=[0], alpha=[0])
self.assertTrue(len(bt.index) > len(new.index))

@pytest.mark.skip(reason="BTSettl grid is not currently available")
def test_filter(self):
"""Test the filter metod works"""
filt = self.bt.filter(teff=3500)
self.assertEqual(len(filt), 1)

@pytest.mark.skip(reason="BTSettl grid is not currently available")
def test_photometry(self):
"""Test the photometry method"""
phot_mg = self.bt.photometry(['2MASS.J', '2MASS.H', '2MASS.Ks'])
self.assertEqual(phot_mg.index.iloc[0]['spectrum'][0].size, 3)

@pytest.mark.skip(reason="BTSettl grid is not currently available")
def test_plot(self):
"""Test that the plot method works"""
plt = self.bt.plot(teff=3500, draw=False)
self.assertEqual(str(type(plt)), "<class 'bokeh.plotting._figure.figure'>")

@pytest.mark.skip(reason="BTSettl grid is not currently available")
def test_save(self):
"""Test the save method works"""
self.bt.save('test.p')
Expand All @@ -80,7 +87,7 @@ def test_load_model():
meta = mg.load_model(filepath)
assert isinstance(meta, dict)


@pytest.mark.skip(reason="BTSettl grid is not currently available")
def test_load_ModelGrid():
"""Test the load_ModelGrid function"""
grid = mg.BTSettl()
Expand All @@ -90,7 +97,7 @@ def test_load_ModelGrid():
assert isinstance(lmg, mg.ModelGrid)
os.remove(test_p)


@pytest.mark.skip(reason="BTSettl grid is not currently available")
def test_BTSettl():
"""Test the BTSettl grid"""
grid = mg.BTSettl()
Expand Down
11 changes: 8 additions & 3 deletions sedkit/tests/test_sed.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import unittest
import pytest
import copy
import importlib_resources

import numpy as np
import astropy.units as q
from astropy.coordinates import SkyCoord

from .. import sed
from .. import spectrum as sp
from .. import modelgrid as mg
from sedkit import sed
from sedkit import spectrum as sp
from sedkit import modelgrid as mg


class TestSED(unittest.TestCase):
Expand Down Expand Up @@ -169,12 +170,14 @@ def test_no_spectra(self):
# Radius from spectral type
s.results

@pytest.mark.skip(reason="BTSettl grid is not currently available")
def test_compare_model(self):
"""Test for the compare_model method"""
v = sed.VegaSED()
bt = mg.BTSettl()
v.compare_model(bt, teff=10000)

@pytest.mark.skip(reason="BTSettl grid is not currently available")
def test_plot(self):
"""Test plotting method"""
v = sed.VegaSED()
Expand Down Expand Up @@ -241,6 +244,7 @@ def test_synthetic_photometry(self):

self.assertTrue(len(v.synthetic_photometry) > 0)

@pytest.mark.skip(reason="BTSettl grid is not currently available")
def test_fit_spectral_type(self):
"""Test that the SED can be fit by a spectral type atlas"""
# Grab the SPL
Expand All @@ -254,6 +258,7 @@ def test_fit_spectral_type(self):
# Fit with SPL
s.fit_spectral_type()

@pytest.mark.skip(reason="BTSettl grid is not currently available")
def test_fit_modelgrid(self):
"""Test that the SED can be fit by a model grid"""
# Grab BTSettl
Expand Down
2 changes: 2 additions & 0 deletions sedkit/tests/test_spectrum.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""A suite of tests for the spectrum.py module"""
import unittest
import pytest
import copy
import importlib_resources

Expand Down Expand Up @@ -71,6 +72,7 @@ def test_unit_conversion(self):
self.assertEqual(s.spectrum[1].unit, fu)
self.assertEqual(s.spectrum[2].unit, fu)

@pytest.mark.skip(reason="BTSettl grid is not currently available")
def test_model_fit(self):
"""Test that a model grid can be fit"""
# Empty fit results
Expand Down

0 comments on commit 0c7ecb0

Please sign in to comment.