Experiments¶
Simulation and post-processing runs¶
Numerical Experiments
can be of two different types:
-
class
astrophysix.simdm.experiment.
Simulation
(Simulation data model)¶ - Parameters
name (
string
) – Simulation name (mandatory)simu_code (
SimulationCode
) – Simulation code used for this simulation (mandatory)alias (
string
) – Simulation alias (if defined, 16 max characters is recommended)description (
string
) – Long simulation descriptiondirectory_path (
string
) – Simulation data directory pathexecution_time (
string
) – Simulation execution time in the format ‘%Y-%m-%d %H:%M:%S’
-
EXETIME_FORMAT
= '%Y-%m-%d %H:%M:%S'¶
-
__eq__
(other)¶ Simulation comparison method
- other:
Simulation
simulation to compare to
- other:
-
__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
alias
¶ Experiment alias. Can be edited.
-
property
applied_algorithms
¶ Experiment applied algorithm list (
ObjectList
)
-
property
description
¶ Experiment description. Can be edited.
-
property
directory_path
¶ Experiment data directory path. Can be edited.
-
property
execution_time
¶ Simulation execution date/time. Can be edited.
Example
>>> simu = Simulation(simu_code=gadget4, name="Maxi Cosmic", execution_time="2020-09-10 14:25:48") >>> simu.execution_time = '2020-09-28 18:45:24'
-
property
execution_time_as_utc_datetime
¶ UTC execution time of the simulation (timezone aware)
-
galactica_validity_check
(**kwargs)¶ Perform validity checks on this instance and eventually log warning messages.
- Parameters
kwargs (dict) – keyword arguments (optional)
-
property
generic_results
¶ Experiment generic result list (
ObjectList
)
-
property
name
¶ Experiment name. Can be edited.
-
property
parameter_settings
¶ Experiment parameter setting list (
ObjectList
)
-
property
post_processing_runs
¶ Simulation associated post-processing run list (
ObjectList
)
-
property
resolved_physics
¶ Simulation resolved physical process list (
ObjectList
).
-
property
simulation_code
¶ SimulationCode
used to run this simulation. Cannot be changed after simulation initialisation.
-
property
snapshots
¶ Experiment snapshot list (
ObjectList
)
-
property
uid
¶
-
class
astrophysix.simdm.experiment.
PostProcessingRun
(*args, **kwargs)¶ Post-processing run (Simulation data model)
- Parameters
name (
string
) – post-processing run name (mandatory)ppcode (
PostProcessingCode
) – post-processing code used for this post-processing run (mandatory)alias (
string
) – Post-processing run alias (if defined, 16 max characters is recommended)description (
string
) – Long post-processing run description
-
__eq__
(other)¶ PostProcessingRun comparison method
- other:
PostProcessingRun
post-processing run to compare to
- other:
-
__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
alias
¶ Experiment alias. Can be edited.
-
property
applied_algorithms
¶ Experiment applied algorithm list (
ObjectList
)
-
property
description
¶ Experiment description. Can be edited.
-
property
directory_path
¶ Experiment data directory path. Can be edited.
-
galactica_validity_check
(**kwargs)¶ Perform validity checks on this instance and eventually log warning messages.
- Parameters
kwargs (dict) – keyword arguments (optional)
-
property
generic_results
¶ Experiment generic result list (
ObjectList
)
-
property
name
¶ Experiment name. Can be edited.
-
property
parameter_settings
¶ Experiment parameter setting list (
ObjectList
)
-
property
postpro_code
¶ PostProcessingCode
used to run this post-processing run. Cannot be changed after post-processing run initialisation.
-
property
snapshots
¶ Experiment snapshot list (
ObjectList
)
-
property
uid
¶
Parameter settings¶
Parameter visibility flag¶
-
class
astrophysix.simdm.experiment.
ParameterVisibility
(value)¶ Parameter setting visibility flag (enum)
Example
>>> vis = ParameterVisibility.BASIC_DISPLAY >>> vis.display_name "Basic display"
-
ADVANCED_DISPLAY
= ('advanced', 'Advanced display')¶
-
BASIC_DISPLAY
= ('basic', 'Basic display')¶
-
NOT_DISPLAYED
= ('not_displayed', 'Not displayed')¶
-
property
display_name
¶ Parameter visibility display name
-
classmethod
from_key
(key)¶ - Parameters
key (
string
) – parameter visibility flag key- Returns
t – Parameter vsibility flag matching the requested key.
- Return type
- Raises
ValueError – if requested key does not match any parameter visibility.
Example
>>> vis = ParameterVisibility.from_key("advanced") >>> vis.display_name "Advanced display" >>> vis2 = ParameterVisibility.from_key("MY_UNKNOWN_FLAG") ValuerError: No ParameterVisibility defined with the key 'MY_UNKNOWN_FLAG'.
-
property
key
¶ Parameter visibility flag key
-
Parameter setting¶
-
class
astrophysix.simdm.experiment.
ParameterSetting
(**kwargs)¶ Experiment input parameter setting class
- Parameters
input_param (
InputParameter
) – protocol input parameter (mandatory)value (
float
orint
orstring
orbool
) – numeric/string/boolean value of the input parameter (mandatory)unit (
Unit
orstring
) – parameter value unit (or unit keystring
)visibility (
ParameterVisibility
) – Parameter setting visibility (for display use only). DefaultBASIC_DISPLAY
-
__eq__
(other)¶ ParameterSetting comparison method
- other:
ParameterSetting
parameter setting to compare to
- other:
-
__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
-
galactica_validity_check
(**kwargs)¶ Perform validity checks on this instance and eventually log warning messages.
- Parameters
kwargs (
dict
) – keyword arguments (optional)
-
property
input_parameter
¶ Experiment protocol’s
InputParameter
. Cannot be edited after parameter setting initialisation.
-
property
parameter_key
¶ Experiment protocol’s
InputParameter
key
-
property
uid
¶
-
property
unit
¶ Parameter value unit (
Unit
). Can be edited.Example
>>> from astrophysix import units as U >>> psetting = ParameterSetting(input_param=inpp, value=0.5, unit=U.pc) >>> psetting.unit = U.kpc >>> psetting.unit = "Mpc"
-
property
value
¶ Parameter value.
Can be set to a
bool
,string
,int
orfloat
value. When set,value_type
is also set accordingly.Example
>>> psetting = ParameterSetting(input_param=inpp, value=0.5) >>> type(psetting.value) is float and psetting.value == 0.5 and psetting.value_type == DataType.REAL True >>> psetting.value = "true" >>> type(psetting.value) is bool and psetting.value is True and psetting.value_type == DataType.BOOLEAN True >>> psetting.value = "false" >>> type(psetting.value) is bool and psetting.value is False and psetting.value_type == DataType.BOOLEAN True >>> psetting.value = "banana" >>> type(psetting.value) is str and psetting.value == "banana" and psetting.value_type == DataType.STRING True >>> psetting.value = 4.256 >>> type(psetting.value) is float and psetting.value == 4.256 and psetting.value_type == DataType.REAL True >>> psetting.value = 58.0 >>> type(psetting.value) is int and psetting.value == 58 and psetting.value_type == DataType.INTEGER True >>> psetting.value = "3.584e2" >>> type(psetting.value) is float and psetting.value == 358.4 and psetting.value_type == DataType.REAL True >>> psetting.value = "-254" >>> type(psetting.value) is int and psetting.value == -254 and psetting.value_type == DataType.INTEGER True
-
property
visibility
¶ Parameter setting visibility flag (
ParameterVisibility
). Can be edited.Example
>>> psetting = ParameterSetting(input_param=inpp, value=0.5, visibility=ParameterVisibility.ADVANCED_DISPLAY) >>> psetting.visibility = ParameterVisibility.BASIC_DISPLAY >>> psetting.visibility = "not_displayed"
Applied algorithms¶
-
class
astrophysix.simdm.experiment.
AppliedAlgorithm
(**kwargs)¶ Experiment applied algorithm class
- Parameters
algorithm (
Algorithm
) – protocol algorithm (mandatory).details (
string
) – implementation details.
-
__eq__
(other)¶ AppliedAlgorithm comparison method
- other:
AppliedAlgorithm
applied algorithm to compare to
- other:
-
__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
algorithm
¶ Experiment protocol’s
Algorithm
. Cannot be edited after applied algorithm initialisation.
-
galactica_validity_check
(**kwargs)¶ Perform validity checks on this instance and eventually log warning messages.
- Parameters
kwargs (
dict
) – keyword arguments (optional)
-
property
implementation_details
¶ Applied algorithm implementation details (
string
). Can be edited.
-
property
uid
¶
Resolved physical processes¶
-
class
astrophysix.simdm.experiment.
ResolvedPhysicalProcess
(**kwargs)¶ Simulation resolved physical process class
- Parameters
physics (
PhysicalProcess
) – simulation code’sPhysicalProcess
instance (mandatory)details (
string
) – resolved physical process implementation details
-
__eq__
(other)¶ ResolvedPhysicalProcess comparison method
- other:
ResolvedPhysicalProcess
resolved physical process to compare to
- other:
-
__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
-
galactica_validity_check
(**kwargs)¶ Perform validity checks on this instance and eventually log warning messages.
- Parameters
kwargs (
dict
) – keyword arguments (optional)
-
property
implementation_details
¶ Resolved physical process implementation details. Editable.
-
property
physical_process
¶ Simulation code’s
PhysicalProcess
. Cannot be edited after instance initialisation
-
property
process_name
¶ Simulation code’s
PhysicalProcess
name. Cannot be edited.
-
property
uid
¶