radis.test.spectrum.test_spectrum moduleΒΆ

Examples

Run all tests:

pytest      # (in command line, in project folder)

Run only fast tests (i.e: tests that a β€˜fast’ label):

pytest -m fast

test_argmax_argmin(*args, **kwargs)[source]ΒΆ

Test argmax() and argmin()

test_copy(verbose=True, *args, **kwargs)[source]ΒΆ

Test that a Spectrum is correctly copied

We compare a Spectrum that has: - all available spectral quantities - a slit - many calculation conditions - no populations - no lines

test_emisscoeff_conversion(verbose=True, *args, **kwargs)[source]ΒΆ

Test conversion of intensity cm-1 works:

  • conversion of mW/sr/cm3/nm -> mW/sr/cm3/cm-1

test_fitting_lineshape(verbose=False, plot=False, *args, **kwargs)[source]ΒΆ

Test fit_model`()

test_intensity_conversion(verbose=True, *args, **kwargs)[source]ΒΆ

Test conversion of intensity cm-1 works:

  • conversion of mW/sr/cm2/nm -> mW/sr/cm2/cm-1

test_noplot_different_quantities(*args, **kwargs)[source]ΒΆ

Prevents User Errors: Ensures an error is raised if plotting different quantities on the same graph

test_normalization(*args, **kwargs)[source]ΒΆ
test_plot_by_parts(plot=True, *args, **kwargs)[source]ΒΆ

Test split_and_plot_by_parts() and plot_by_parts=True in plot()

test_populations(verbose=True, plot=True, close_plots=True, *args, **kwargs)[source]ΒΆ

Test that populations in a Spectrum are correctly read

test_resampling_function(verbose=True, plot=True, close_plots=True, *args, **kwargs)[source]ΒΆ

Test resampling functions

Get a Spectrum calculated in cm-1, then resample on a smaller range in cm-1, and in approximately the same range (but in nm). Check that all 3 overlap

test_resampling_nan_function(verbose=True, *args, **kwargs)[source]ΒΆ

Test resampling functions, for Spectra with nans

test_rescaling_function(verbose=True, *args, **kwargs)[source]ΒΆ

Test rescaling functions

test_sort(*args, **kwargs)[source]ΒΆ

Test sort()

test_spectrum_creation_method(*args, **kwargs)[source]ΒΆ
test_spectrum_get_methods(verbose=True, plot=True, close_plots=True, *args, **kwargs)[source]ΒΆ

Test all spectrum methods on a Spectrum generated in Specair

test_store_functions(verbose=True, *args, **kwargs)[source]ΒΆ

Test some store / retrieve functions

test_trimming(verbose=True, *args, **kwargs)[source]ΒΆ

Test radis.spectrum.spectrum.Spectrum.trim()