From 4d58b9c84c2a4a46879aa32aab4537d84ff7f028 Mon Sep 17 00:00:00 2001 From: Nathan Moore Date: Tue, 14 Jan 2025 14:25:34 -0700 Subject: [PATCH] update typing via ruff, since we require python >=3.10 --- urbanopt_des/modelica_results.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/urbanopt_des/modelica_results.py b/urbanopt_des/modelica_results.py index c443113..7f69b58 100644 --- a/urbanopt_des/modelica_results.py +++ b/urbanopt_des/modelica_results.py @@ -1,7 +1,6 @@ import json from datetime import datetime, timedelta from pathlib import Path -from typing import Dict, Union import numpy as np import pandas as pd @@ -9,7 +8,7 @@ from .emissions import HourlyEmissionsData -VariablesDict = Dict[str, Union[bool, str, int, str]] +VariablesDict = dict[str, bool | str | int | str] class ModelicaResults: @@ -99,8 +98,8 @@ def number_of_buildings(self, building_count_var: str = "nBui") -> int: def resample_and_convert_to_df( self, - building_ids: Union[list[str], None] = None, - other_vars: Union[list[str], None] = None, + building_ids: list[str] | None = None, + other_vars: list[str] | None = None, year_of_data: int = 2017, ) -> None: """The Modelica data (self.modelica_data) are stored in a Reader object and the timesteps are non ideal for comparison across models. The method handles @@ -237,7 +236,7 @@ def resample_and_convert_to_df( def combine_with_openstudio_results( self, - building_ids: Union[list[str], None], + building_ids: list[str] | None, openstudio_df: pd.DataFrame, openstudio_df_15: pd.DataFrame, ) -> None: