Skip to content

Commit

Permalink
set kwargs through **kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
lheagy committed Apr 24, 2016
1 parent d9048bc commit 422ec20
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions SimPEG/EM/FDEM/SrcFDEM.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ class RawVec_e(BaseSrc):
:param bool integrate: Integrate the source term (multiply by Me) [False]
"""

def __init__(self, rxList, freq, s_e, ePrimary=None, jPrimary=None, hPrimary=None, bPrimary=None):
def __init__(self, rxList, freq, s_e, **kwargs): #ePrimary=None, jPrimary=None, hPrimary=None, bPrimary=None
self._s_e = np.array(s_e, dtype=complex)
self.freq = float(freq)
[setattr(self, '_%s'%primField, primField) for primField in [ePrimary, jPrimary, hPrimary, bPrimary] if primField is not None]
[setattr(self, '_%s'%primField, kwargs[primField]) for primField in ['ePrimary', 'jPrimary', 'hPrimary', 'bPrimary'] if kwargs.get(primField) is not None]
BaseSrc.__init__(self, rxList)

def s_e(self, prob):
Expand All @@ -179,10 +179,10 @@ class RawVec_m(BaseSrc):
:param bool integrate: Integrate the source term (multiply by Me) [False]
"""

def __init__(self, rxList, freq, s_m, ePrimary=None, jPrimary=None, hPrimary=None, bPrimary=None):
def __init__(self, rxList, freq, s_m, **kwargs): #ePrimary=None, jPrimary=None, hPrimary=None, bPrimary=None):
self._s_m = np.array(s_m, dtype=complex)
self.freq = float(freq)
[setattr(self, '_%s'%primField, primField) for primField in [ePrimary, jPrimary, hPrimary, bPrimary] if primField is not None]
[setattr(self, '_%s'%primField, kwargs[primField]) for primField in ['ePrimary', 'jPrimary', 'hPrimary', 'bPrimary'] if kwargs.get(primField) is not None]
BaseSrc.__init__(self, rxList)

def s_m(self, prob):
Expand All @@ -208,11 +208,11 @@ class RawVec(BaseSrc):
:param numpy.array s_e: electric source term
:param bool integrate: Integrate the source term (multiply by Me) [False]
"""
def __init__(self, rxList, freq, s_m, s_e, ePrimary=None, jPrimary=None, hPrimary=None, bPrimary=None, **kwargs):
def __init__(self, rxList, freq, s_m, s_e, **kwargs): #ePrimary=None, jPrimary=None, hPrimary=None, bPrimary=None, **kwargs):
self._s_m = np.array(s_m, dtype=complex)
self._s_e = np.array(s_e, dtype=complex)
self.freq = float(freq)
[setattr(self, '_%s'%primField, primField) for primField in [ePrimary, jPrimary, hPrimary, bPrimary] if primField is not None]
[setattr(self, '_%s'%primField, kwargs[primField]) for primField in ['ePrimary', 'jPrimary', 'hPrimary', 'bPrimary'] if kwargs.get(primField) is not None]
BaseSrc.__init__(self, rxList, **kwargs)

def s_m(self, prob):
Expand Down

0 comments on commit 422ec20

Please sign in to comment.