radis.test.lbl.test_calc module¶

Created on Mon Nov 20 09:36:25 2017

@author: erwan

Examples

Run all tests:

>>> pytest       (in command line, in project folder)

Run only fast tests (i.e: tests that have a ‘fast’ label)

>>> pytest -m fast

test_all_calc_methods_CO2pcN(verbose=True, plot=False, warnings=True, rtol=0.001, *args, **kwargs)[source]¶

Test same spectrum for 3 different calculation variants (equilibrium, non-equilibrium, per band and recombine

Uses CO2 Levels database where the energy partitioning is done as follow:

2 nonequilibrium modes Evib is the minimum of a “p,c,N” group Erot = E - Evib

This corresponds to the levelsfmt = ‘cdsd-pcN’ in KNOWN_LVLFORMAT

test_calc_spectrum(verbose=True, plot=True, warnings=True, *args, **kwargs)[source]¶

Basic example, used as a non-regression test.

Notes

How long it took to calculate this Spectrum?

Performance test on old NeQ package, with the [CDSD-HITEMP-JMIN] databank. See the caveats in the E. Pannier “Limits of CO2 NonEquilibrium Models” paper. (just used here as a performance monitoring)

  • neq 0.9.20: 18.7s

  • neq 0.9.20*: 15.4s (removed 2nd loop on 1st isotope because of groupby().apply())

  • neq 0.9.20**: 11.7s (after replacing fill_Evib with map() )

  • neq 0.9.21: 9.4s (improve Qrot / nrot fetching performance)

  • neq 0.9.22: 8.4s

Starting from RADIS 1.0.1, the test is run on [HITRAN-2020], which is not valid for these temperatures but can be more conveniently downloaded automatically and thus executed every time with Travis CI

(we also expect the test to be much faster than above, but that’s just because the database is smaller!)

  • radis 0.9.202.49 s on [HITRAN-2020]

    4.05 s on [CDSD-HITEMP-JMIN]

  • radis 0.12.2 : 1.1s on [HITRAN-2020] (most time spent in the Evib, Erot look-up)

test_calc_spectrum_multiple_molecules(verbose=True, plot=True, warnings=True, *args, **kwargs)[source]¶

Test calculations with multiple molecules

Note: try to keep the same wavelength ranges for each of the multi-molecule tests, so that databases are only downloaded once, and cached!

test_calc_spectrum_multiple_molecules_inputerror(verbose=True, plot=True, warnings=True, *args, **kwargs)[source]¶

Test calculations with multiple molecules

Note: try to keep the same wavelength ranges for each of the multi-molecule tests, so that databases are only downloaded once, and cached!

test_calc_spectrum_multiple_molecules_otherinputs(verbose=True, plot=True, warnings=True, *args, **kwargs)[source]¶

Test calculations with different kind of inputs for multiple molecules

Note: try to keep the same wavelength ranges for each of the multi-molecule tests, so that databases are only downloaded once, and cached!

test_calc_spectrum_multiple_molecules_wstep_auto(verbose=True, plot=True, warnings=True, *args, **kwargs)[source]¶

Tests multiple molecules spectrum for wstep = ‘auto’ and checks that minimum wstep value is selected with resample = “intersect

test_calc_spectrum_overpopulations(verbose=True, plot=False, warnings=True, *args, **kwargs)[source]¶

Non-regression test.

Example using overpopulation of the 001 asymmetric stretch first level of CO2, which is written (p,c,N) = (3,1,4) in [CDSD-4000] notation

Notes

In old Neq package (before RADIS):

the test uses a CDSD-PCN notation for vibrational energy assignation, i.e, Evib = minimal energy of a (p,c,N) polyad. See the discussion on the implications in the E. Pannier “Limits of CO2 NonEquilibrium models” paper. Better use the assignation scheme suggested in the paper. But it’s okay here as a non-regression test.

Starting from RADIS 1.0.1, the test is run on [HITRAN-2020], which is not valid for these temperatures but can be more conveniently downloaded automatically and thus executed every time with Travis CI

test_check_wavelength_range(verbose=True, warnings=True, *args, **kwargs)[source]¶

Check that input wavelength is correctly taken into account. See https://github.com/radis/radis/issues/214

test_diluent_invalid(verbose=True, plot=False, *args, **kwargs)[source]¶
test_diluents_for_molecule()[source]¶
test_eq_vs_noneq_isotope(verbose=True, plot=False, warnings=True, *args, **kwargs)[source]¶

Test same spectrum for 2 different calculation codes (equilibrium, non-equilibrium) in the presence of isotopes

Notes

On the old NeQ package the test used [HITEMP-2010]

Starting from RADIS 1.0.1, the test is run on [HITRAN-2020], which is not valid for these temperatures but can be more conveniently downloaded automatically and thus executed every time with Travis CI

test_non_air_diluent_calc(verbose=True, plot=False, warnings=True, *args, **kwargs)[source]¶
test_sPlanck_conversions(verbose=True, *args, **kwargs)[source]¶