Skip to content

Commit

Permalink
fixed indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
apetri committed May 17, 2016
1 parent c76b832 commit 8785a3a
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions lenstools/simulations/camb.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,40 +382,40 @@ def __call__(self,z,k):
#Use interpolator to compute the transfer function
return self._interpolated[z](k.to((u.Mpc)**-1).value)

#I/O
def save(self,filename):
#I/O
def save(self,filename):

"""
Pickle the TransferFunction instance
"""
Pickle the TransferFunction instance
:param filename: name of the file to save the instance to
:type filename: str.
:param filename: name of the file to save the instance to
:type filename: str.
"""
"""

with open(filename,"w") as fp:
pkl.dump(self,fp)
with open(filename,"w") as fp:
pkl.dump(self,fp)

@classmethod
def read(cls,filename):
@classmethod
def read(cls,filename):

"""
Load a previously pickled TransferFunction instance
"""
Load a previously pickled TransferFunction instance
:param filename: name of the file from which the instance should be read
:type filename: str.
:param filename: name of the file from which the instance should be read
:type filename: str.
:rtype: :py:class:`TransferFunction`
:rtype: :py:class:`TransferFunction`
"""
"""

with open(filename,"r") as fp:
tfr = pkl.load(fp)
with open(filename,"r") as fp:
tfr = pkl.load(fp)

if isinstance(tfr,cls):
return tfr
else:
raise TypeError("Pickled instance is not of type {0}".format(cls.__name__))
if isinstance(tfr,cls):
return tfr
else:
raise TypeError("Pickled instance is not of type {0}".format(cls.__name__))


##############################################################################################################################
Expand Down

0 comments on commit 8785a3a

Please sign in to comment.