Important API Changes Between pyXSIM Version 3 and Version 4

This section documents the most important API changes between pyXSIM version 3 and 4, with code examples showing how to update your code for version 4.

API Changes to Thermal Source Models

The class ThermalSourceModel in version 3 of pyXSIM has now been subclassed into three separate classes, CIESourceModel, NEISourceModel, and IGMSourceModel. ThermalSourceModel itself should no longer be used as a standalone class. In order to replicate the functionality of the previously existing ThermalSourceModel class for CIE spectra, change (for example):

import pyxsim

source_model = pyxsim.ThermalSourceModel("apec", 0.1, 10.0, 5000, 0.3)

to:

import pyxsim

source_model = pyxsim.CIESourceModel("apec", 0.1, 10.0, 5000, 0.3)

and for NEI sources, change:

import pyxsim

source_model = pyxsim.ThermalSourceModel("apec", 0.1, 10.0, 5000,
                                         ("gas", "metallicity"), var_elem=var_elem,
                                         nei=True)

to:

import pyxsim

source_model = pyxsim.NEISourceModel(0.1, 10.0, 5000, var_elem)

See Thermal Sources for more details.