From 43a359725f4cf6b98b11359a80683fdc3d81c88f Mon Sep 17 00:00:00 2001 From: Ben RdO Date: Wed, 29 Nov 2023 10:43:16 -0800 Subject: [PATCH] chore: lint modules --- src/column_checks.py | 1 - src/data_cleaning.py | 1 - src/eia930.py | 3 ++- src/output_data.py | 2 +- src/validation.py | 2 +- test/test_logging.py | 6 ++---- 6 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/column_checks.py b/src/column_checks.py index 43eeff12..64b5a7d9 100644 --- a/src/column_checks.py +++ b/src/column_checks.py @@ -460,7 +460,6 @@ def get_dtypes(): "equipment_tech_description": "str", "pm_control_id": "str", "so2_control_id": "str", - "nox_control_id": "str", "hg_control_id": "str", "operational_status": "str", "hours_in_service": "float64", diff --git a/src/data_cleaning.py b/src/data_cleaning.py index ecb5c8d1..80e7263d 100644 --- a/src/data_cleaning.py +++ b/src/data_cleaning.py @@ -1,6 +1,5 @@ import pandas as pd import numpy as np -import os import sqlalchemy as sa import pudl.analysis.allocate_net_gen as allocate_gen_fuel diff --git a/src/eia930.py b/src/eia930.py index 3b99b787..01e493dc 100644 --- a/src/eia930.py +++ b/src/eia930.py @@ -12,7 +12,8 @@ # Tell gridemissions where to find config before we load gridemissions os.environ["GRIDEMISSIONS_CONFIG_FILE_PATH"] = top_folder("config/gridemissions.json") -from gridemissions.workflows import make_dataset +from gridemissions.workflows import make_dataset # noqa E402 + logger = get_logger(__name__) diff --git a/src/output_data.py b/src/output_data.py index 244dceaf..3620f1ff 100644 --- a/src/output_data.py +++ b/src/output_data.py @@ -462,7 +462,7 @@ def write_power_sector_results(ba_fuel_data, path_prefix, skip_outputs): if not skip_outputs: for ba in list(ba_fuel_data.ba_code.unique()): - if type(ba) is not str: + if not isinstance(ba, str): logger.warning( f"not aggregating {sum(ba_fuel_data.ba_code.isna())} plants with numeric BA {ba}" ) diff --git a/src/validation.py b/src/validation.py index e2a7f020..c5ec8ebe 100644 --- a/src/validation.py +++ b/src/validation.py @@ -220,7 +220,7 @@ def check_for_orphaned_cc_part_in_subplant(subplant_crosswalk): "prime_mover_code" ].agg(["unique"]) cc_subplants["unique_cc_pms"] = [ - ",".join(map(str, l)) for l in cc_subplants["unique"] + ",".join(map(str, L)) for L in cc_subplants["unique"] ] cc_subplants = cc_subplants.drop(columns="unique") # identify where there are subplants that only contain a single CC part diff --git a/test/test_logging.py b/test/test_logging.py index 5758cca5..3d08e112 100644 --- a/test/test_logging.py +++ b/test/test_logging.py @@ -6,10 +6,8 @@ sys.path.append("../src") sys.path.append("..") -import src.eia930 as eia930 -from src.filepaths import top_folder - -from src.logging_util import get_logger, configure_root_logger +from src.filepaths import top_folder # noqa E402 +from src.logging_util import get_logger, configure_root_logger # noqa E402 pudl_logger = logging.getLogger(name="catalystcoop.pudl")