Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fcc3da0

Browse files
committedJun 27, 2023
typing fixes for new version of ruff
1 parent 7a95a31 commit fcc3da0

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed
 

‎src/dispatch/model.py

+14-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import logging
55
import warnings
66
from datetime import datetime, timedelta
7-
from typing import ClassVar, Literal
7+
from typing import ClassVar, Literal
88

99
import numpy as np
1010
import pandas as pd
@@ -70,24 +70,30 @@ class DispatchModel(IOMixin):
7070
"pl_re_plant_specs",
7171
"pl_storage_specs",
7272
)
73-
id_schema = {
73+
id_schema: ClassVar[dict] = {
7474
"plant_id_eia": pl.Int32,
7575
"generator_id": pl.Utf8,
7676
"datetime": pl.Datetime("us"),
7777
}
78-
es_schema = {
78+
es_schema: ClassVar[dict] = {
7979
"charge": pl.Float32,
8080
"discharge": pl.Float32,
8181
"soc": pl.Float32,
8282
"gridcharge": pl.Float32,
8383
}
84-
sys_schema = {
84+
sys_schema: ClassVar[dict] = {
8585
"deficit": pl.Float32,
8686
"dirty_charge": pl.Float32,
8787
"curtailment": pl.Float32,
8888
"load_adjustment": pl.Float32,
8989
}
90-
pl_freq = {"YS": "1y", "AS": "1y", "MS": "1mo", "D": "1d", "H": "1h"}
90+
pl_freq: ClassVar[dict] = {
91+
"YS": "1y",
92+
"AS": "1y",
93+
"MS": "1mo",
94+
"D": "1d",
95+
"H": "1h",
96+
}
9197
default_config: ClassVar[dict[str, str]] = {"dynamic_reserve_coeff": "auto"}
9298

9399
def __init__(
@@ -408,7 +414,9 @@ def __init__(
408414
409415
Generate a full, combined output of all resources at specified frequency.
410416
411-
>>> dm.full_output(freq="YS").collect().to_pandas() # doctest: +NORMALIZE_WHITESPACE
417+
>>> dm.full_output(
418+
... freq="YS"
419+
... ).collect().to_pandas() # doctest: +NORMALIZE_WHITESPACE
412420
plant_id_eia generator_id capacity_mw ... duration_hrs roundtrip_eff reserve
413421
0 0 curtailment NaN ... NaN NaN NaN
414422
1 0 deficit NaN ... NaN NaN NaN

0 commit comments

Comments
 (0)