Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 8, 2023
1 parent 9afc966 commit adad1e4
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions scripts/build_ship_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,27 @@ def build_ship_profile(export_volume, ship_opts):
pause_time = 8760 / landing - (fill_time + travel_time)
full_cycle = fill_time + travel_time + unload_time + pause_time

max_transport = ship_capacity * 8760/(fill_time + travel_time + unload_time)
max_transport = ship_capacity * 8760 / (fill_time + travel_time + unload_time)
print(f"The maximum transport capacity per ship is {max_transport:.2f} TWh/year")

# throw error if max_transport < export_volume
if max_transport < export_volume:
ships = np.ceil(export_volume / max_transport)
print(f"Number of ships needed to export {export_volume} TWh/year is {ships}")
logger.info('Not enough ship capacity to export all hydrogen in one ship. Extending the number of shipts to {}'.format(ships))

logger.info(
"Not enough ship capacity to export all hydrogen in one ship. Extending the number of shipts to {}".format(
ships
)
)

# Set fill_time -> 1 and travel_time, unload_time, pause_time -> 0
ship = pd.Series([1.0] * fill_time + [0.0] * int(travel_time + unload_time + pause_time)) #, index)
ship = pd.Series(
[1.0] * fill_time + [0.0] * int(travel_time + unload_time + pause_time)
) # , index)
ship.name = "profile"
ship = pd.concat([ship]*1000, ignore_index=True) # extend ship series to above 8760 hours
ship = pd.concat(
[ship] * 1000, ignore_index=True
) # extend ship series to above 8760 hours
ship = ship[:8760]

# Add index
Expand Down

0 comments on commit adad1e4

Please sign in to comment.