Skip to content

Commit

Permalink
more revs
Browse files Browse the repository at this point in the history
  • Loading branch information
maxscheurer committed Apr 27, 2021
1 parent 4480135 commit 00be33f
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions adcc/ExcitedStates.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,25 @@


class EnergyCorrection:
def __init__(self, name, function, description=None):
assert isinstance(name, str)
assert callable(function)
def __init__(self, name, function):
"""A helper class to represent excitation energy
corrections.
Parameters
----------
name : str
descriptive name of the energy correction
function : callable
function that takes a :py:class:`Excitation`
as single argument and returns the energy
correction as a float
"""
if not isinstance(name, str):
raise TypeError("name needs to be a string.")
if not callable(function):
raise TypeError("function needs to be callable.")
self.name = name
self.function = function
self.description = description

def __call__(self, excitation):
assert isinstance(excitation, Excitation)
Expand Down

0 comments on commit 00be33f

Please sign in to comment.