Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AWehrhahn committed Jun 8, 2021
1 parent bd8b812 commit e89819a
Show file tree
Hide file tree
Showing 4 changed files with 639 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/cywrapper.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def InputModel(double teff, double grav, vturb, atmo):
raise Exception(byte.decode("utf8"))
return

def InputDepartureCoefficients(np_double_t[:, ::1] bmat, int lineindex):
def InputDepartureCoefficients(np.ndarray bmat, int lineindex):
cdef const char * byte
byte = Python_InputDepartureCoefficients(to_arr_double_2d(bmat), lineindex)
if byte != b"":
Expand Down Expand Up @@ -431,7 +431,7 @@ def Transf(
int nwmax = 400000,
short keep_lineop = 0,
short long_continuum = 1,
np_double_t[::1] wave = None,
np.ndarray wave = None,
):
cdef const char * byte
cdef short nmu
Expand Down
2 changes: 1 addition & 1 deletion test/sme_synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def InputLineList(self, linelist):
except AttributeError:
raise TypeError("linelist has to be a LineList type")

nlines = 1
nlines = len(species)
species = np.asarray(species, "U8")

assert (
Expand Down
13 changes: 12 additions & 1 deletion test/test_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from sme_synth import SME_DLL
from cwrapper import get_lib_name


logger = logging.getLogger(__name__)

@pytest.fixture
Expand Down Expand Up @@ -41,9 +42,19 @@ def test_radiative_transfer(dll, libfile, datadir):
# species wlcent gflog excit j_lo ... term_lower term_upper error atom_number ionization
# 35 Ca 1 6439.075 0.39 2.525682 3.0 ... 3p6.3d.4s 3D 3p6.3d.4p 3F* 0.5 1.0 1.0
linelist = {
"species": np.array(["Ca 1"]),
"species": np.array(["Ca 1", "Fe 1"]),
"atomic": np.array(
[
[
1.00000000e00,
1.00000000e00,
6.43907500e03,
2.52568209e00,
3.90000000e-01,
7.64900000e00,
-6.07200000e00,
-7.56900000e00,
],
[
1.00000000e00,
1.00000000e00,
Expand Down
Loading

0 comments on commit e89819a

Please sign in to comment.