Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add turbine Capex #196

Merged
merged 15 commits into from
Jan 27, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
handle zeroes in num_turbines_per_cable without printing
  • Loading branch information
crookp committed Dec 9, 2024
commit 8d0db0aa96a73211fd8f29b2fbcbe4662d55ed74
13 changes: 1 addition & 12 deletions landbosse/model/CollectionCost.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,18 +389,7 @@ def calc_num_turb_partial_strings(self, num_leftover_turb, num_turb_per_cable):
turb_per_partial_string.append(0.0)
num_remaining -= max_turb

perc_partial_string = np.divide(turb_per_partial_string, num_turb_per_cable)

# Check to make sure there aren't any zeros in num_turbines_per_cable, which is used as the denominator
# in the division above (this happens when not all of the cable types in the input sheet need to be used).
# If there is a zero, then print a warning and change NaN to 0 in perc_partial_string.
if 0.0 in num_turb_per_cable:
print(
f'Warning: {self.project_name} CollectionCost module generates number of turbines per string that '
f'includes a zero entry. Please confirm that there not all cable types need to be used for the number of turbines that are being run.'
f' num_turbines={self.input_dict["num_turbines"]} rating_MW={self.input_dict["turbine_rating_MW"]}'
f' num_turb_per_cable: {num_turb_per_cable}')
perc_partial_string = np.nan_to_num(perc_partial_string)
perc_partial_string = np.divide(turb_per_partial_string, [np.inf if n == 0 else n for n in num_turb_per_cable])

self.output_dict["turb_per_partial_string"] = turb_per_partial_string

Expand Down