From b11ba3cc30d4390aa51aa7c2b76279a615908526 Mon Sep 17 00:00:00 2001 From: Fridolin Glatter Date: Mon, 28 Oct 2024 15:50:11 +0100 Subject: [PATCH] Update usage of typing dict and list --- ixmp/backend/jdbc.py | 4 ++-- ixmp/model/base.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ixmp/backend/jdbc.py b/ixmp/backend/jdbc.py index b67721e2d..f562df1c0 100644 --- a/ixmp/backend/jdbc.py +++ b/ixmp/backend/jdbc.py @@ -10,7 +10,7 @@ from functools import lru_cache from pathlib import Path, PurePosixPath from types import SimpleNamespace -from typing import Generator, List, Mapping, Optional +from typing import Generator, Mapping, Optional from weakref import WeakKeyDictionary import jpype @@ -1290,7 +1290,7 @@ def start_jvm(jvmargs=None): # Conversion methods -def to_pylist(jlist) -> List: +def to_pylist(jlist) -> list: """Convert Java list types to :class:`list`.""" try: return list(jlist[:]) diff --git a/ixmp/model/base.py b/ixmp/model/base.py index 5332fbfd2..417b6d4b6 100644 --- a/ixmp/model/base.py +++ b/ixmp/model/base.py @@ -2,7 +2,7 @@ import os import re from abc import ABC, abstractmethod -from typing import TYPE_CHECKING, Dict, Mapping +from typing import TYPE_CHECKING, Mapping from ixmp.util import maybe_check_out, maybe_commit @@ -85,7 +85,7 @@ def initialize(cls, scenario): log.debug(f"No initialization for {repr(scenario.scheme)}-scheme Scenario") @classmethod - def initialize_items(cls, scenario: "Scenario", items: Mapping[str, Dict]) -> None: + def initialize_items(cls, scenario: "Scenario", items: Mapping[str, dict]) -> None: """Helper for :meth:`initialize`. All of the `items` are added to `scenario`. Existing items are not modified.