Skip to content

Commit

Permalink
code: pre-commit run --all
Browse files Browse the repository at this point in the history
  • Loading branch information
finozzifa committed Feb 19, 2025
1 parent 9257fdc commit 518c616
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

import pathlib


configfile: "config.yaml"


rule compile_cost_assumptions:
input:
inflation_rate="inputs/prc_hicp_aind__custom_9928419_spreadsheet.xlsx",
Expand Down
5 changes: 2 additions & 3 deletions scripts/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@

# coding: utf-8

import logging
import re
import sys
from pathlib import Path

import numpy as np
import pandas as pd

import logging
import sys


class Dict(dict):
"""
Expand Down
9 changes: 6 additions & 3 deletions scripts/compile_cost_assumptions_usa.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
The input files are in parquet format and can be downloaded from https://data.openei.org/s3_viewer?bucket=oedi-data-lake&prefix=ATB%2Felectricity%2Fparquet%2F
"""

import pathlib
import logging
import pathlib

import numpy as np
import pandas as pd
from _helpers import adjust_for_inflation, configure_logging, mock_snakemake
Expand Down Expand Up @@ -966,7 +967,7 @@ def duplicate_fuel_cost(input_file_path: str, list_of_years: list) -> pd.DataFra
else:
raise Exception(f"{year_val} is not a considered year")

logger.info("The file {} is used for year {}".format(input_atb_path, year_val))
logger.info(f"The file {input_atb_path} is used for year {year_val}")

manual_input_usa_df = pre_process_manual_input_usa(
input_file_manual_input_usa,
Expand Down Expand Up @@ -1072,7 +1073,9 @@ def duplicate_fuel_cost(input_file_path: str, list_of_years: list) -> pd.DataFra
if len(output_cost_path_list) == 1:
output_cost_path = output_cost_path_list[0]
updated_cost_df.to_csv(output_cost_path, index=False)
logger.info("The cost assumptions file for the US has been compiled for year {}".format(year_val))
logger.info(
f"The cost assumptions file for the US has been compiled for year {year_val}"
)
else:
raise Exception(
"Please verify the list of cost files. It may contain duplicates."
Expand Down

0 comments on commit 518c616

Please sign in to comment.