Skip to content

Commit

Permalink
added test_partition_function script
Browse files Browse the repository at this point in the history
  • Loading branch information
wkerzendorf committed Mar 3, 2015
1 parent f408073 commit d8dfd92
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tardis/plasma/tests/test_partition_function.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import numpy as np

from tardis.plasma.properties import LevelBoltzmannFactor, LTEPartitionFunction


def test_level_boltzmann_factor1(standard_lte_plasma_he_db):
level_boltzmann_factor_module = LevelBoltzmannFactor(None)
levels = standard_lte_plasma_he_db.levels
factor = level_boltzmann_factor_module.calculate(levels, standard_lte_plasma_he_db.beta_rad)
assert np.allclose(factor.loc[2, 0, 0], levels.loc[2, 0, 0].g)
assert np.allclose(factor.loc[2, 1, 0], levels.loc[2, 1, 0].g)
assert np.allclose(factor.loc[2, 0, 10], 7.6218092841240705e-12)

def test_lte_partition_function1(standard_lte_plasma_he_db):
partition_function = LTEPartitionFunction.calculate(
standard_lte_plasma_he_db.levels,
standard_lte_plasma_he_db.level_boltzmann_factor)
assert 0

0 comments on commit d8dfd92

Please sign in to comment.