Simulation properties for the population class.
This class contains the simulation properties, e.g. flow, steps and max_time.
- class posydon.binary_evol.simulationproperties.EvolveHooks[source]
Bases:
object
Base class for hooking into binary evolution.
- class posydon.binary_evol.simulationproperties.PrintStepInfoHooks[source]
Bases:
posydon.binary_evol.simulationproperties.EvolveHooks
Simple example for adding extra print info.
- class posydon.binary_evol.simulationproperties.SimulationProperties(properties=None, **kwargs)[source]
Bases:
object
Class describing the properties of a population synthesis simulation.
Construct the simulation properties object.
- Parameters
properties (object) – Simulation Properties class containing, e.g. flow, steps.
extra_hooks (list of tuples) – Each tuple contains a hooks class and kwargs or the extra step name (‘extra_pre_evolve’, ‘extra_pre_step’, ‘extra_post_step’, ‘extra_post_evolve’) and the corresponding function.
- post_evolve(binary)[source]
Finalize the evolution of the binary.
The method is called after a binary exits the evolution loop. Uses all extra hooks classes or extra functions.
- Parameters
binary (instance of <class, BinaryStar>) – The binary after evolution is ended.
- Returns
binary
- Return type
instance of <class, BinaryStar>
- post_step(binary, step_name)[source]
Finalize step.
The method is called after every evolution step; uses all extra hooks classes or extra functions (except for undefined next step errors).
- Parameters
binary (instance of <class, BinaryStar>) – The binary before evolution starts.
step_name (str) – The name of the step about to be called (as defined in the flow).
- Returns
binary
- Return type
instance of <class, BinaryStar>
- pre_evolve(binary)[source]
Functions called before a binary evolves.
Uses all extra hooks classes or extra functions.
- Parameters
binary (instance of <class, BinaryStar>) – The binary before evolution starts.
- Returns
binary
- Return type
instance of <class, BinaryStar>
- pre_step(binary, step_name)[source]
Prepare for step.
The method is called before every evolution step; uses all extra hooks classes or extra functions (except for undefined next step errors).
- Parameters
binary (instance of <class, BinaryStar>) – The binary before evolution starts.
step_name (str) – The name of the step about to be called (as defined in the flow).
- Returns
binary
- Return type
instance of <class, BinaryStar>
- class posydon.binary_evol.simulationproperties.StepNamesHooks[source]
Bases:
posydon.binary_evol.simulationproperties.EvolveHooks
Add history column ‘step_name’ to each binary.
Name of evolutionary step as defined in SimulationProperties.
>>> pop.to_df(extra_columns=['step_names'])
- class posydon.binary_evol.simulationproperties.TimingHooks[source]
Bases:
posydon.binary_evol.simulationproperties.EvolveHooks
Add history column ‘step_times’ (time taken by step) to each binary.
Example
>>> pop.to_df(extra_columns=['step_times'])