Skip to content
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

Merged
merged 3 commits into from
Jun 22, 2017
Merged

Fix bug in plasma #743

merged 3 commits into from
Jun 22, 2017

Conversation

yeganer
Copy link
Contributor

@yeganer yeganer commented Jun 14, 2017

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 called instancemethod and should only be used in special cases. In our case the calculate 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__.

"""
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
Copy link
Contributor

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.
Copy link
Contributor

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.

Copy link
Contributor

@unoebauer unoebauer left a 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

@wkerzendorf wkerzendorf merged commit 396c3be into tardis-sn:master Jun 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants