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()
executor: ThreadPoolExecutor
get_auth(rest_url: str, override_auth: BaseAuth | None) BaseAuth
make_client(rest_url: str, auth: BaseAuth | None)
timeout: Timeout
class ixmp4.data.backend.api.RestTestBackend(db_backend, *args, **kwargs)

Bases: RestBackend

close()

Closes the connection to the database.

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

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
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, **kwargs)

Bases: SqlAlchemyBackend

make_engine(dsn: str)
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)
close()

Closes the connection to the database.

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

Bases: SqlAlchemyBackend

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

Module contents