Backend placeholders

Overview

The backend placeholders are a set of pre-defined classes that can be used as a starting point for building an application. They provide a basic structure and functionality to allow an Algomancy app to launch.

Reference

class algomancy_content.backend.placeholderschema.PlaceholderSchema[source]

Bases: Schema

Schema class to be used as a placeholder

class algomancy_content.backend.placeholderalgorithmtemplate.PlaceholderParams(*args, **kwargs)[source]

Bases: BaseParameterSet

class algomancy_content.backend.placeholderalgorithmtemplate.PlaceholderAlgorithm(params)[source]

Bases: BaseAlgorithm

static initialize_parameters()[source]

Initializes parameters for the derived Algorithm, which is necessary for the GUI logic. It should simply return a default object of the associated AlgorithmParameters class.

Example

>>> @staticmethod
>>> def initialize_parameters() -> ExampleAlgorithmParams:
...    return ExampleAlgorithmParams()
Raises:

NotImplementedError – If the method is not overridden.

Returns:

The initialized set of parameters, derived

from the BaseAlgorithmParameters class.

Return type:

BASE_PARAMS_BOUND

class algomancy_content.backend.placeholderetlfactory.PlaceholderETLFactory(configs, logger=None)[source]

Bases: ETLFactory

create_extraction_sequence(files)[source]

Default extractor wiring keyed off the registry.

For each File in files looks up the matching schema by name and selects an extractor class via get_extractor_class on (extension, schema_type). Override only when you need non-default extractor parameters (e.g. CSV separator).

Raises:

ETLConstructionError – If no extractor is registered for a schema’s (extension, schema_type) pair.

create_transformation_sequence()[source]

Default to a no-op transformation step. Override to customise.

create_validation_sequence()[source]

Default validation sequence using the new built-in validators.

Includes (in order): RequiredColumnsValidator, SchemaValidator, and PrimaryKeyValidator. The PK validator skips schemas with no declared primary key internally (and decomposes MULTI schemas into per-group synthetic SINGLE schemas via _schema_table_map), so it is safe to append unconditionally. Subclasses can override to add domain-specific validators.

create_loader()[source]

Default loader materialises a DataSource.

class algomancy_content.backend.placeholderkpitemplate.PlaceholderKPI[source]

Bases: BaseKPI

compute(result)[source]

Abstract method to compute the KPI value from scenario results.

Parameters:

result (ScenarioResult) – The scenario result data.

Returns:

The computed numeric value.

Return type:

float

todo