Package solvcon :: Module hook :: Class Hook
[hide private]
[frames] | no frames]

Class Hook

source code


Organizer class for hooking subroutines for BaseCase.

Instance Methods [hide private]
 
__init__(self, cse, **kw)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
bool
_depend(self, deplst, verbose=False, stop_on_false=True)
Check for dependency to another hook.
source code
 
_makedir(self, dirname, verbose=False)
Make new directory if it does not exist in prior.
source code
 
drop_anchor(self, svr)
Drop the anchor(s) to the solver object.
source code
 
postloop(self)
Things to do after the time-marching loop.
source code
 
postmarch(self)
Things to do after the time march for a specific time step.
source code
 
preloop(self)
Things to do before the time-marching loop.
source code
 
premarch(self)
Things to do before the time march for a specific time step.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
 
_deliver_anchor(target, ankcls, ankkw)
Provide the information to instantiate anchor object for a solver.
source code
Instance Variables [hide private]
  cse
Case object.
  info
information output function.
  kws
excessive keywords.
  psteps
the interval number of steps between printing.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, cse, **kw)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • cse (BaseCase) - Case object.
Overrides: object.__init__

_deliver_anchor(target, ankcls, ankkw)
Static Method

source code 

Provide the information to instantiate anchor object for a solver. The target object can be a real solver object or a shadow associated to a remote worker object with attached muscle of solver object.

Parameters:
  • target (solvcon.solver.Solver or solvcon.rpc.Shadow) - the solver or shadow object.
  • ankcls (type) - type of the anchor to instantiate.
  • ankkw (dict) - keywords to instantiate anchor object.
Returns:
nothing

_depend(self, deplst, verbose=False, stop_on_false=True)

source code 

Check for dependency to another hook.

Parameters:
  • deplst (list) - list of depended hook classes.
  • verbose (bool) - flag print message.
  • stop_on_false (bool) - flag stop on false.
Returns: bool
dependency met or not.

_makedir(self, dirname, verbose=False)

source code 

Make new directory if it does not exist in prior.

Parameters:
  • dirname (str) - name of directory to be created.
  • verbose (bool) - flag if print out creation message.

drop_anchor(self, svr)

source code 

Drop the anchor(s) to the solver object.

Parameters:
  • svr (solvon.solver.BaseSolver) - the solver object on which the anchor(s) is dropped.
Returns:
nothing