Protocols

Simulation and post-processing codes

Protocol is the generic term for a software tool used to conduct a numerical Experiment. There are two different types of protocols :

class astrophysix.simdm.protocol.SimulationCode(**kwargs)

Simulation code

Parameters
  • name (string) – name (mandatory)

  • code_name (string) – base code name (mandatory)

  • alias (string) – code alias

  • url (string) – reference URL

  • code_version (string) – code version

  • description (string) – code description

INVALID_ALIAS_ERROR_MESSAGE = "The alias can contain capital letters, digits and '_' only. It must start with a capital letter and cannot end with a '_'."
VALID_ALIAS_REGEX = re.compile("^[A-Z] # First character must be a capital letter\n ([A-Z0-9_]* # Then any capital letter, digit or '_'\n [A-Z0-9])?, re.VERBOSE)
__eq__(other)

SimulationCode comparison method

other: SimulationCode

simulation code to compare to

__ne__(other)

Not an implied relationship between “rich comparison” equality methods in Python 2.X but only in Python 3.X see https://docs.python.org/2.7/reference/datamodel.html#object.__ne__

other: other instance to compare to

__unicode__()

String representation of the instance

property algorithms

Protocol Algorithm list (ObjectList)

property alias

Protocol alias

property code_name

Protocol code name

property code_version

Protocol code version

property description

Protocol description

galactica_valid_alias(alias_value)
galactica_validity_check(**kwargs)

Perform validity checks on this instance and eventually log warning messages.

Parameters

kwargs (dict) – keyword arguments (optional)

property input_parameters

Protocol InputParameter list (ObjectList)

property name

Protocol name

property physical_processes

Simulation code PhysicalProcess list (ObjectList)

property uid
property url

Protocol code url

class astrophysix.simdm.protocol.PostProcessingCode(**kwargs)

Post-processing code

Parameters
  • name (string) – name (mandatory)

  • code_name (:obj:`string) – base code name (mandatory)

  • alias (string) – code alias

  • url (string) – reference URL

  • code_version (string) – code version

  • description (string) – code description

INVALID_ALIAS_ERROR_MESSAGE = "The alias can contain capital letters, digits and '_' only. It must start with a capital letter and cannot end with a '_'."
VALID_ALIAS_REGEX = re.compile("^[A-Z] # First character must be a capital letter\n ([A-Z0-9_]* # Then any capital letter, digit or '_'\n [A-Z0-9])?, re.VERBOSE)
__eq__(other)

Protocol comparison method

other: Protocol

Protocol to compare to

__ne__(other)

Not an implied relationship between “rich comparison” equality methods in Python 2.X but only in Python 3.X see https://docs.python.org/2.7/reference/datamodel.html#object.__ne__

other: other instance to compare to

__unicode__()

String representation of the instance

property algorithms

Protocol Algorithm list (ObjectList)

property alias

Protocol alias

property code_name

Protocol code name

property code_version

Protocol code version

property description

Protocol description

galactica_valid_alias(alias_value)
galactica_validity_check(**kwargs)

Perform validity checks on this instance and eventually log warning messages.

Parameters

kwargs (dict) – keyword arguments (optional)

property input_parameters

Protocol InputParameter list (ObjectList)

property name

Protocol name

property uid
property url

Protocol code url

Input parameters

class astrophysix.simdm.protocol.InputParameter(**kwargs)

Protocol input parameter

Parameters
  • name (string) – input parameter name (mandatory)

  • key (string) – input parameter configuration key

  • description (string) – input parameter description

INVALID_ALIAS_ERROR_MESSAGE = "The alias can contain capital letters, digits and '_' only. It must start with a capital letter and cannot end with a '_'."
VALID_ALIAS_REGEX = re.compile("^[A-Z] # First character must be a capital letter\n ([A-Z0-9_]* # Then any capital letter, digit or '_'\n [A-Z0-9])?, re.VERBOSE)
__eq__(other)

InputParameter comparison method

other: InputParameter

input parameter to compare to

__ne__(other)

Not an implied relationship between “rich comparison” equality methods in Python 2.X but only in Python 3.X see https://docs.python.org/2.7/reference/datamodel.html#object.__ne__

other: other instance to compare to

__unicode__()

String representation of the instance

property description

Input parameter description

galactica_valid_alias(alias_value)
galactica_validity_check(**kwargs)

Perform validity checks on this instance and eventually log warning messages.

Parameters

kwargs (dict) – keyword arguments (optional)

property key

Input parameter configuration key

property name

Input parameter name

property uid

Algorithms

Algorithm type

class astrophysix.simdm.protocol.AlgoType(value)

Algorithm type enum

Example

>>> t = AlgoType.PoissonMultigrid
>>> t.name
"Multigrid Poisson solver"
AdaptiveMeshRefinement = ('AMR', 'Adaptive mesh refinement')
FriendOfFriend = ('FOF', 'Friend-of-friend')
Godunov = ('Godunov', 'Godunov scheme')
HLLCRiemann = ('HLLC', 'Harten-Lax-van Leer-Contact Riemann solver')
ParticleMesh = ('PM', 'Particle-mesh solver')
PoissonConjugateGradient = ('Poisson_CG', 'Conjugate Gradient Poisson solver')
PoissonMultigrid = ('Poisson_MG', 'Multigrid Poisson solver')
RayTracer = ('ray_tracer', 'Ray-tracer')
SmoothParticleHydrodynamics = ('SPH', 'Smooth particle hydrodynamics')
VoronoiMovingMesh = ('Voronoi_MM', 'Voronoi tesselation-based moving mesh')
classmethod from_key(key)
Parameters

key (string) – algorithm type key

Returns

t – Algorithm type matching the requested key.

Return type

AlgoType

Raises

ValueError – if requested key does not match any algorithm type.

Example

>>> t = AlgoType.from_key("FOF")
>>> t.name
"Friend-of-friend"
>>> t2 = AlgoType.from_key("MY_UNKNOWN_ALGO_TYPE")
ValuerError: No AlgoType defined with the key 'MY_UNKNOWN_ALGO_TYPE'.
property key

Algorithm type indexing key

Algorithm

class astrophysix.simdm.protocol.Algorithm(**kwargs)

Protocol algorithm

Parameters
  • algo_type (AlgoType or string) – AlgoType enum value or AlgoType valid key (mandatory).

  • description (string) – algorithm description

INVALID_ALIAS_ERROR_MESSAGE = "The alias can contain capital letters, digits and '_' only. It must start with a capital letter and cannot end with a '_'."
VALID_ALIAS_REGEX = re.compile("^[A-Z] # First character must be a capital letter\n ([A-Z0-9_]* # Then any capital letter, digit or '_'\n [A-Z0-9])?, re.VERBOSE)
__eq__(other)

Algorithm comparison method

other: Algorithm

algorithm to compare to

__ne__(other)

Not an implied relationship between “rich comparison” equality methods in Python 2.X but only in Python 3.X see https://docs.python.org/2.7/reference/datamodel.html#object.__ne__

other: other instance to compare to

__unicode__()

String representation of the instance

property algo_type

Algorithm type (AlgoType)

property description

Algorithm description

galactica_valid_alias(alias_value)
galactica_validity_check(**kwargs)

Perform validity checks on this instance and eventually log warning messages.

Parameters

kwargs (dict) – keyword arguments (optional)

property name

Algorithm name

property uid

Physical processes

Physics

class astrophysix.simdm.protocol.Physics(value)

Physics enum

Example

>>> ph = Physics.MHD
>>> ph.name
"Magnetohydrodynamics"
AGNFeedback = ('AGN_feedback', 'AGN feedback')
Hydrodynamics = ('hydro', 'Hydrodynamics')
MHD = ('mhd', 'Magnetohydrodynamics')
MolecularCooling = ('mol_cooling', 'Molecular cooling')
SelfGravity = ('self_gravity', 'Self-gravity')
StarFormation = ('star_form', 'Star formation')
SupernovaeFeedback = ('sn_feedback', 'Supernovae feedback')
classmethod from_key(key)
Parameters

key (string) – physics key

Returns

t – Physics matching the requested key.

Return type

Physics

Raises

ValueError – if requested key does not match any physics.

Example

>>> ph = Physics.from_key("star_from")
>>> ph.name
"Star formation"
>>> ph2 = Physics.from_key("MY_UNKNOWN_PHYSICS")
ValuerError: No Physics defined with the key 'MY_UNKNOWN_PHYSICS'.
property key

Physics indexing key

Physical process

class astrophysix.simdm.protocol.PhysicalProcess(**kwargs)

Simulation code physical process

Parameters
  • physics (Physics or string) – Physics enum value or Physics valid key. (mandatory)

  • description (string) – physics description

INVALID_ALIAS_ERROR_MESSAGE = "The alias can contain capital letters, digits and '_' only. It must start with a capital letter and cannot end with a '_'."
VALID_ALIAS_REGEX = re.compile("^[A-Z] # First character must be a capital letter\n ([A-Z0-9_]* # Then any capital letter, digit or '_'\n [A-Z0-9])?, re.VERBOSE)
__eq__(other)

PhysicalProcess comparison method

other: PhysicalProcess

physical process to compare to

__ne__(other)

Not an implied relationship between “rich comparison” equality methods in Python 2.X but only in Python 3.X see https://docs.python.org/2.7/reference/datamodel.html#object.__ne__

other: other instance to compare to

__unicode__()

String representation of the instance

property description

Physical process description

galactica_valid_alias(alias_value)
galactica_validity_check(**kwargs)

Perform validity checks on this instance and eventually log warning messages.

Parameters

kwargs (dict) – keyword arguments (optional)

property name

Physical process name

property physics

Prrocess type (Physics)

property uid