You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, models should not use any attributes/methods that are not in the interface classes of atomic rates.
Second, because NullBeamCXPEC does not have a donor_metastable attribute, running code with missing CX PECs for some species will raise an AttributeError if atomic data is configured with missing_rates_return_null = True.
There are two possible solutions. The first is to add the donor_metastable attribute to the BeamCXPEC interface class, and the second is to update the AtomicData.beam_cx_pec() method to return a list of (donor_metastable, rate) pairs instead of a list of rates. I think the first solution is less invasive and will have less impact on user code.
The
BeamCXLine
model uses thedonor_metastable
attribute of theBeamCXPEC
.core/cherab/core/model/beam/charge_exchange.pyx
Lines 309 to 312 in 9ae5a3e
However, the interface class of the
BeamCXPEC
does not have this attribute.core/cherab/core/atomic/rates.pxd
Lines 53 to 55 in 9ae5a3e
The attribute is added only in the
openadas
implementation of theBeamCXPEC
.core/cherab/openadas/rates/cx.pxd
Lines 23 to 29 in 9ae5a3e
First, models should not use any attributes/methods that are not in the interface classes of atomic rates.
Second, because
NullBeamCXPEC
does not have adonor_metastable
attribute, running code with missing CX PECs for some species will raise anAttributeError
if atomic data is configured withmissing_rates_return_null = True
.There are two possible solutions. The first is to add the
donor_metastable
attribute to theBeamCXPEC
interface class, and the second is to update theAtomicData.beam_cx_pec()
method to return a list of(donor_metastable, rate)
pairs instead of a list of rates. I think the first solution is less invasive and will have less impact on user code.@jacklovell, @Mateasek, which solution do you like better?
The text was updated successfully, but these errors were encountered: