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_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_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_plot_by_parts(plot=True, *args, **kwargs)[source]ΒΆ
Test
split_and_plot_by_parts()
and plot_by_parts=True inplot()
- 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_spectrum_get_methods(verbose=True, plot=True, close_plots=True, *args, **kwargs)[source]ΒΆ
Test all spectrum methods on a Spectrum generated in Specair