Skip to content

fetch_sortables

fetch_sortables

Service for fetch sortables operations.

Classes

FetchSortablesRunner

Bases: BaseRunner[Dict[str, Any]]

Runner for reading all user sortables on a scenario.

GET /api/v3/scenarios/{scenario_id}/user_sortables

Functions
run staticmethod
run(client, scenario, **kwargs)

Execute the fetch sortables operation.

Returns:

Type Description
ServiceResult[Dict[str, Any]]

ServiceResult[Dict[str, Any]]: Success case contains dict with sortables (forecast_storage, hydrogen_supply, hydrogen_demand, space_heating, and heat_network with lt/mt/ht subtypes as lists of ints); failure case contains error messages.

Source code in src/pyetm/services/scenario_runners/fetch_sortables.py
@staticmethod
def run(client: BaseClient, scenario: Any, **kwargs: Any) -> ServiceResult[Dict[str, Any]]:
    """Execute the fetch sortables operation.

    Returns:
        ServiceResult[Dict[str, Any]]: Success case contains dict with sortables
            (forecast_storage, hydrogen_supply, hydrogen_demand, space_heating, and
            heat_network with lt/mt/ht subtypes as lists of ints); failure case
            contains error messages.
    """
    return FetchSortablesRunner._make_request(
        client=client, method="get", path=f"/scenarios/{scenario.id}/user_sortables"
    )