cape.cfdx.casecntlbase: Abstract base classes for case interface

This module provides an abstract base class for the cape.cfdx.casecntl.CaseRunner class that controls the CAPE interface to individual CFD cases. The base class is CaseRunnerBase.

class cape.cfdx.casecntlbase.CaseRunnerBase

Abstract base class for cape.cfdx.casecntl.CaseRunner

The main purpose for this class is to provide useful type annotations for cape.cfdx.cntl without circular imports.

Call:
>>> runner = CaseRunnerBase()
Outputs:
runner: CaseRunner

Controller to run one case of solver

Class attributes:
  • _modname

  • _progname

  • _logprefix

  • _rc_cls

  • _archivist_cls

  • _dex_cls

class cape.cfdx.casecntlbase.MetaCaseRunner(name: str, bases: tuple, namespace: dict)

Metaclass for CaseRunner

This metaclass ensures that new subclasses of CaseRunner, for example in cape.pyfun or cape.pylava, merge their _dex_cls class attribute values.

classmethod combine_dex_cls(clsj: type, cls: type)

Combine the _dex_cls from a class and one of its bases

Call:
>>> metacls.combine_dex_cls(clsj, cls)
Inputs:
metacls: type

The MetaArgReader metaclass

clsj: type

Parent class (basis) to combine into cls

cls: type

New class in which to save combined attributes

classmethod combine_dict(clsj: type, cls: type, attr: str)

Combine one dict-like class attribute of clsj and cls

Call:
>>> metacls.combine_dict(clsj, cls, attr)
Inputs:
metacls: type

The MetaArgReader metaclass

clsj: type

Parent class (basis) to combine into cls

cls: type

New class in which to save combined attributes

attr: str

Name of attribute to combine