Skip to content

Commit

Permalink
Call upgrades analyzer with keyword arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
rajeee committed Dec 27, 2023
1 parent 55de28b commit c4df1e4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions buildstock_query/tools/upgrades_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ def reducer(l1, l2):

return logic_array, logic_str

def save_detailed_report_all(self, file_path: str, logic_transform=None):
def save_detailed_report_all(self, file_path: str, normalize_logic: bool = False):
"""Save detailed text based upgrade report.
Args:
Expand All @@ -747,7 +747,7 @@ def save_detailed_report_all(self, file_path: str, logic_transform=None):
all_report = ""
for upgrade in range(1, len(cfg["upgrades"]) + 1):
logger.info(f"Getting report for upgrade {upgrade}")
_, report = self.get_detailed_report(upgrade, normalize_logic=logic_transform)
_, report = self.get_detailed_report(upgrade, normalize_logic=normalize_logic)
all_report += report + "\n"
with open(file_path, "w") as file:
file.write(all_report)
Expand Down Expand Up @@ -778,7 +778,8 @@ def main():
defaults.update({"yaml_file": yaml_file, "buildstock_file": buildstock_file, "opt_sat_file": opt_sat_file,
"output_prefix": output_prefix})
save_script_defaults("project_info", defaults)
ua = UpgradesAnalyzer(yaml_file, buildstock_file, opt_sat_file)
ua = UpgradesAnalyzer(yaml_file=yaml_file, buildstock=buildstock_file,
opt_sat_file=opt_sat_file)
report_df = ua.get_report()
folder_path = Path.cwd()
csv_name = folder_path / f"{output_prefix}options_report.csv"
Expand Down

0 comments on commit c4df1e4

Please sign in to comment.