- class foxes.core.Engine(abc.ABC)[source]
Abstract base clas for foxes calculation engines
Attributes¶
- chunk_size_states: int
The size of a states chunk
- chunk_size_points: int
The size of a points chunk
- progress_bar: bool, optional
Use a progress bar instead of simply printing lines of reached percentages. Unless progress_bar is None, then neither
- verbosity: int
The verbosity level, 0 = silent
Notes¶
Use engines via the context manager protocol: >>> engine = Engine.new(…) >>> with engine: >>> …
Public members¶
-
Engine(chunk_size_states=
None, chunk_size_points=None, ...)[source] Constructor.
- property name
The engine’s name
- property n_procs
The number of processes
- property n_workers
The number of worker processes
- property has_progress_bar
Flag for active progress bar
- property prints_progress
Flag for active progress printing
- property entered
Flag that this model has been entered.
- property running_chunk_calc
Flag that a chunk calculation is running.
- abstract future_is_done(future)[source]
Checks if a future is done
- abstract await_result(future)[source]
Waits for result from a future
- property loop_dims
Gets the loop dimensions (possibly chunked)
-
select_subsets(*datasets, sel=
None, isel=None)[source] Takes subsets of datasets
-
calc_chunk_sizes(n_states, n_targets=
1)[source] Computes the sizes of states and points chunks
- get_chunk_input_data(algo, model_data, farm_data, point_data, ...)[source]
Extracts the data for a single chunk calculation
- get_start_calc_message(n_chunks_states, n_chunks_targets)[source]
Helper function for start calculation message
-
abstract run_calculation(algo, model, model_data=
None, ...)[source] Runs the model calculation
- new_chunk_results_manager(algo, **kwargs)[source]
Creates a new ChunkResultsManager
- classmethod new(engine_type, *args, **kwargs)[source]
Run-time engine factory.
Classes¶
- class ChunkResultsManager[source]
Helper class for results management during chunk calculations