Backends

Submodules

ixmp4.data.backend.api module

class ixmp4.data.backend.api.RestBackend(info: PlatformInfo, auth: BaseAuth | None = None, max_concurrent_requests: int = 2)

Bases: Backend

client: Client
create_repositories() None
executor: ThreadPoolExecutor
get_auth(rest_url: str, override_auth: BaseAuth | None) BaseAuth | None
make_client(rest_url: str, auth: BaseAuth | None) None
timeout: Timeout
class ixmp4.data.backend.api.RestTestBackend(db_backend: SqlAlchemyBackend)

Bases: RestBackend

close() None

Closes the connection to the database.

make_client(rest_url: str, auth: BaseAuth) None
setup() None
teardown() None

ixmp4.data.backend.base module

class ixmp4.data.backend.base.Backend(info: PlatformInfo)

Bases: object

close() None

Closes the connection to the database.

iamc: IamcSubobject
info: PlatformInfo
meta: RunMetaEntryRepository
models: ModelRepository
optimization: OptimizationSubobject
regions: RegionRepository
runs: RunRepository
scenarios: ScenarioRepository
units: UnitRepository
class ixmp4.data.backend.base.IamcSubobject

Bases: object

datapoints: DataPointRepository
timeseries: TimeSeriesRepository[TimeSeries]
variables: VariableRepository
class ixmp4.data.backend.base.OptimizationSubobject

Bases: object

equations: EquationRepository
indexsets: IndexSetRepository
parameters: ParameterRepository
scalars: ScalarRepository
tables: TableRepository
variables: VariableRepository

ixmp4.data.backend.db module

class ixmp4.data.backend.db.IamcSubobject

Bases: IamcSubobject

datapoints: DataPointRepository
timeseries: TimeSeriesRepository
variables: VariableRepository
class ixmp4.data.backend.db.OptimizationSubobject

Bases: OptimizationSubobject

equations: EquationRepository
indexsets: IndexSetRepository
parameters: ParameterRepository
scalars: ScalarRepository
tables: TableRepository
variables: VariableRepository
class ixmp4.data.backend.db.PostgresTestBackend(*args: Unpack[tuple[PlatformInfo]])

Bases: SqlAlchemyBackend

make_engine(dsn: str) None
class ixmp4.data.backend.db.SqlAlchemyBackend(info: PlatformInfo)

Bases: Backend

Session = sessionmaker(class_='Session', autocommit=False, future=True, bind=None, autoflush=False, expire_on_commit=True)
auth(user: User, manager: ManagerConfig, info: ManagerPlatformInfo, overlap_ok: bool = False) Generator[AuthorizationContext, None, None]
auth_context: AuthorizationContext | None = None
check_dsn(dsn: str) str
close() None

Closes the connection to the database.

event_handler: SqlaEventHandler
iamc: IamcSubobject
info: PlatformInfo
make_engine(dsn: str) None
make_repositories() None
meta: RunMetaEntryRepository
models: ModelRepository
optimization: OptimizationSubobject
regions: RegionRepository
runs: RunRepository
scenarios: ScenarioRepository
setup() None
teardown() None
units: UnitRepository
class ixmp4.data.backend.db.SqliteTestBackend(*args: Unpack[tuple[PlatformInfo]])

Bases: SqlAlchemyBackend

make_engine(dsn: str) None
ixmp4.data.backend.db.cached_create_engine(dsn: str) Engine

Module contents