-
-
Notifications
You must be signed in to change notification settings - Fork 405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug in plasma #743
Fix bug in plasma #743
Conversation
""" | ||
Reduces non-metastable level populations by a factor of W compared to LTE in the case of dilute-lte excitation. | ||
Reduces non-metastable level populations by a factor of W |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not what this method does.
""" | ||
outputs = ('level_number_density',) | ||
latex_name = ('N_{i,j,k}',) | ||
latex_formula = ('N_{i,j}\\dfrac{bf_{i,j,k}}{Z_{i,j}}',) | ||
|
||
def calculate(self): | ||
pass | ||
|
||
def __init__(self, plasma_parent): | ||
""" | ||
Calculates the level populations with the Boltzmann equation in LTE. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that this is not particularly relevant for this PR but this class has nothing to do with either the Boltzmann equation or LTE. It is used for all excitation treatments including dilute-lte and nlte.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address @chvogl's comments
While having a second look at the LevelNumberDensity module in plasma I found a bug.
Instead of defining the
calculate
function as a method, we assigned an attribute with a reference to a method during the__init__
. That is a so calledinstancemethod
and should only be used in special cases. In our case thecalculate
method is the same for all instances which should be reflected by the class.If this fix hides implementation details, one could leave the original names and assign the function on the class level instead of in the
__init__
.