Skip to content

Commit

Permalink
massive change of structure
Browse files Browse the repository at this point in the history
  • Loading branch information
wkerzendorf committed Mar 3, 2015
1 parent d8dfd92 commit c7fa02c
Show file tree
Hide file tree
Showing 17 changed files with 37 additions and 52 deletions.
2 changes: 1 addition & 1 deletion tardis/atomic.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ def __init__(self, atom_data, ionization_data, levels_data, lines_data, macro_at




self.ion_cx_data = ion_cx_data



Expand Down
18 changes: 0 additions & 18 deletions tardis/plasma/properties.py

This file was deleted.

1 change: 1 addition & 0 deletions tardis/plasma/properties/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from ion_population import PhiSahaNebular, PhiSahaLTE
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from abc import ABCMeta
from abc import ABCMeta, abstractmethod

import numpy as np
import pandas as pd

from tardis.plasma.base_properties import ProcessingPlasmaProperty
from tardis.plasma.properties.base import ProcessingPlasmaProperty
from tardis.plasma.exceptions import IncompleteAtomicData

class BaseAtomicDataProperty(ProcessingPlasmaProperty):
Expand All @@ -15,6 +15,15 @@ def __init__(self, plasma_parent):
super(BaseAtomicDataProperty, self).__init__(plasma_parent)
self.value = None

@abstractmethod
def _set_index(self, raw_atomic_property):
raise NotImplementedError('Needs to be implemented in subclasses')

@abstractmethod
def _filter_atomic_property(self, raw_atomic_property):
raise NotImplementedError('Needs to be implemented in subclasses')


def calculate(self, atomic_data, selected_atoms):
if self.value is not None:
return self.value
Expand Down Expand Up @@ -70,6 +79,15 @@ def calculate(self, levels, lines):
return np.array(levels_index.ix[lines_index])


class IonCXData(BaseAtomicDataProperty):
name = 'ion_cx_data'

def _filter_atomic_property(self, ion_cx_data, selected_atoms):
return filtered_ion_cx_data

def _set_index(self, ion_cx_data):
return levels.set_index(['atomic_number', 'ion_number', 'level_number'])


class AtomicMass(BaseAtomicDataProperty):
name = 'atomic_mass'
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import logging

import numpy as np
import pandas as pd

from astropy import constants as const

from tardis.plasma.base_properties import ProcessingPlasmaProperty
from tardis.plasma.properties.base import ProcessingPlasmaProperty

logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import numpy as np
import pandas as pd

from tardis.plasma.base_properties import ProcessingPlasmaProperty
from tardis.plasma.properties.base import ProcessingPlasmaProperty
from tardis.plasma.exceptions import PlasmaIonizationError
logger = logging.getLogger(__name__)


__all__ = ['PhiSahaNebular', 'PhiSahaLTE', 'RadiationFieldCorrection',
'IonNumberDensity', ]

class PhiSahaNebular(ProcessingPlasmaProperty):
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import logging

import numpy as np
import pandas as pd

from tardis.plasma.base_properties import ProcessingPlasmaProperty
from tardis.plasma.properties.base import ProcessingPlasmaProperty

logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np
import pandas as pd

from tardis.plasma.base_properties import ProcessingPlasmaProperty
from tardis.plasma.properties.base import ProcessingPlasmaProperty

logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tardis.plasma.base_properties import BasePlasmaProperty
from tardis.plasma.properties.base import BasePlasmaProperty



Expand Down
3 changes: 3 additions & 0 deletions tardis/plasma/properties/properties.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#### Importing properties from other modules ########

######################################################
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

import numpy as np
import pandas as pd

from astropy import units as u, constants as const

from tardis.plasma.base_properties import ProcessingPlasmaProperty
from tardis.plasma.properties.base import ProcessingPlasmaProperty

logger = logging.getLogger(__name__)

Expand Down
5 changes: 1 addition & 4 deletions tardis/plasma/standard_plasmas.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import logging

import numpy as np
import pandas as pd

from tardis.plasma import BasePlasma
from tardis.plasma.plasma_input import (TRadiative, AtomicData, Abundance,
from tardis.plasma.properties.plasma_input import (TRadiative, AtomicData, Abundance,
Density, TimeExplosion)
from tardis.plasma.properties import (
BetaRadiation, LevelBoltzmannFactor, Levels, Lines,
Expand Down
4 changes: 1 addition & 3 deletions tardis/plasma/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import pytest
import numpy as np

import pandas as pd

from astropy import units as u

import pytest
from tardis.plasma.standard_plasmas import LTEPlasma


Expand Down
6 changes: 2 additions & 4 deletions tardis/plasma/tests/test_general_properties.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@

import numpy as np
from astropy import constants as const

from astropy import units as u, constants as const

from tardis.plasma.general_properties import (BetaRadiation, GElectron,
from tardis.plasma.properties.general import (BetaRadiation, GElectron,
NumberDensity, SelectedAtoms)


Expand Down
9 changes: 0 additions & 9 deletions tardis/plasma/tests/test_simple_plasma.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
import pytest

import pandas as pd
import numpy as np

from astropy import units as u

from tardis.plasma.plasma_input import TRadiative, AtomicData, Abundance, DilutionFactor

from tardis.plasma.standard_plasmas import LTEPlasma


Expand Down

0 comments on commit c7fa02c

Please sign in to comment.