|
89 | 89 | "metadata": {}, |
90 | 90 | "outputs": [], |
91 | 91 | "source": [ |
92 | | - "from typing import List, Optional, Text\n", |
| 92 | + "from typing import Optional\n", |
93 | 93 | "\n", |
94 | 94 | "from muse.outputs.sector import market_quantity, register_output_quantity\n", |
95 | 95 | "from xarray import DataArray, Dataset\n", |
|
137 | 137 | "\n", |
138 | 138 | "@register_output_sink(name=\"txt\")\n", |
139 | 139 | "@sink_to_file(\".txt\")\n", |
140 | | - "def text_dump(data: Any, filename: Text) -> None:\n", |
| 140 | + "def text_dump(data: Any, filename: str) -> None:\n", |
141 | 141 | " from pathlib import Path\n", |
142 | 142 | "\n", |
143 | 143 | " Path(filename).write_text(f\"Hello world!\\n\\n{data}\")" |
|
286 | 286 | "metadata": {}, |
287 | 287 | "outputs": [], |
288 | 288 | "source": [ |
289 | | - "from typing import MutableMapping, Text\n", |
| 289 | + "from collections.abc import MutableMapping\n", |
290 | 290 | "\n", |
291 | 291 | "import pandas as pd\n", |
292 | 292 | "import xarray as xr\n", |
|
295 | 295 | "\n", |
296 | 296 | "@register_cached_quantity(overwrite=True)\n", |
297 | 297 | "def capacity(\n", |
298 | | - " cached: List[xr.DataArray],\n", |
299 | | - " agents: MutableMapping[Text, MutableMapping[Text, Text]],\n", |
| 298 | + " cached: list[xr.DataArray],\n", |
| 299 | + " agents: MutableMapping[str, MutableMapping[str, str]],\n", |
300 | 300 | ") -> pd.DataFrame:\n", |
301 | 301 | " \"\"\"Consolidates the cached capacity into a single DataFrame to save.\n", |
302 | 302 | "\n", |
303 | 303 | " Args:\n", |
304 | | - " cached (List[xr.DataArray]): The list of cached arrays during the calculation of\n", |
| 304 | + " cached (list[xr.DataArray]): The list of cached arrays during the calculation of\n", |
305 | 305 | " the time period with the capacity.\n", |
306 | 306 | " agents (MutableMapping[Text, MutableMapping[Text, Text]]): Agents' metadata.\n", |
307 | 307 | "\n", |
|
453 | 453 | " market: Dataset,\n", |
454 | 454 | " capacity: DataArray,\n", |
455 | 455 | " technologies: Dataset,\n", |
456 | | - " sum_over: Optional[List[Text]] = None,\n", |
457 | | - " drop: Optional[List[Text]] = None,\n", |
| 456 | + " sum_over: Optional[list[str]] = None,\n", |
| 457 | + " drop: Optional[list[str]] = None,\n", |
458 | 458 | " rounding: int = 4,\n", |
459 | 459 | "):\n", |
460 | 460 | " \"\"\"Current consumption.\"\"\"\n", |
|
469 | 469 | "\n", |
470 | 470 | "@register_output_sink(name=\"txt\", overwrite=True)\n", |
471 | 471 | "@sink_to_file(\".txt\")\n", |
472 | | - "def text_dump(data: Any, filename: Text, msg: Optional[Text] = \"Hello, world!\") -> None: # noqa: F811\n", |
| 472 | + "def text_dump(data: Any, filename: str, msg: Optional[str] = \"Hello, world!\") -> None: # noqa: F811\n", |
473 | 473 | " from pathlib import Path\n", |
474 | 474 | "\n", |
475 | 475 | " Path(filename).write_text(f\"{msg}\\n\\n{data}\")" |
|
0 commit comments