Skip to content

Commit

Permalink
Another spell-check for run_pyrecodes.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBonus committed Jan 21, 2025
1 parent 450f4d0 commit 1949a76
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions modules/performREC/pyrecodes/run_pyrecodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ def modify_system_config_rewet_distribution(system_config, input_data_dir, rlz_r
The modified system configuration dictionary.
"""
resources_config = system_config['Resources']
for resouces in resources_config.values():
distribution_model = resouces['DistributionModel']
for resources in resources_config.values():
distribution_model = resources['DistributionModel']
if distribution_model['ClassName'] == 'REWETDistributionModel':
distribution_model['Parameters']['INPFile'] = str(input_data_dir / distribution_model['Parameters']['INPFile'])
if not (rlz_run_dir / 'rewet_results').exists():
Expand All @@ -211,8 +211,8 @@ def modify_system_config_rewet_distribution(system_config, input_data_dir, rlz_r

def modify_system_config_residual_demand_distribution(system_config, input_data_dir, rlz_run_dir):
resources_config = system_config['Resources']
for resouces in resources_config.values():
distribution_model = resouces['DistributionModel']
for resources in resources_config.values():
distribution_model = resources['DistributionModel']
if distribution_model['ClassName'] == 'ResidualDemandTrafficDistributionModel':
distribution_model['Parameters']['EdgeFile'] = str(input_data_dir / distribution_model['Parameters']['EdgeFile'])
distribution_model['Parameters']['NodeFile'] = str(input_data_dir / distribution_model['Parameters']['NodeFile'])
Expand Down Expand Up @@ -406,7 +406,7 @@ def run_pyrecodes( # noqa: C901
with Path(main_file).open() as f:
main_file_dict = json.load(f)
else:
# Check the realziation value
# Check the realization value
if realization is None:
raise RuntimeError("Realization is not provided")
elif type(realization) is not str:
Expand Down Expand Up @@ -603,18 +603,18 @@ def create_system_configuration(rec_config): # noqa: D103
try:
cur_realization = int(float(cur_realization))
except:
raise RuntimeError(f"The realziation for {asset_types} is not an integer: {cur_realization}")
raise RuntimeError(f"The realization for {asset_types} is not an integer: {cur_realization}")

realization_asset_types += asset_types + " "
if realization is None:
realization = cur_realization
elif cur_realization < realization:
realization = cur_realization

print(f"The smallest realziation accross {realization_asset_types}is {realization}.")
print(f"The smallest realization across {realization_asset_types}is {realization}.")

if realization < 0:
raise ValueError(f"Realization should be more than 0: realziation = {realization}")
raise ValueError(f"Realization should be more than 0: realization = {realization}")

realization_text = ""
for i in range(realization):
Expand Down

0 comments on commit 1949a76

Please sign in to comment.