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

Solved import Error of Rasterio | Solved 3 Warnings #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions get_weather_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

"""
import logging
from osgeo import gdal
import atlite
# import geopandas as gpd
import pandas as pd
Expand Down
1 change: 1 addition & 0 deletions map_costs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
This script visualizes the spatial cost of hydrogen for each demand center.
"""

from osgeo import gdal
import geopandas as gpd
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
Expand Down
7 changes: 4 additions & 3 deletions optimize_hydrogen_plant.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

"""

from osgeo import gdal
import atlite
import geopandas as gpd
import pypsa
Expand Down Expand Up @@ -60,9 +61,9 @@ def demand_schedule(quantity, transport_state, transport_excel_path,
# schedule for trucking
annual_deliveries = quantity/truck_capacity
quantity_per_delivery = quantity/annual_deliveries
index = pd.date_range(start_date, end_date, periods=annual_deliveries)
index = pd.date_range(start_date, end_date, periods=int(annual_deliveries))
trucking_demand_schedule = pd.DataFrame(quantity_per_delivery, index=index, columns = ['Demand'])
trucking_hourly_demand_schedule = trucking_demand_schedule.resample('H').sum().fillna(0.)
trucking_hourly_demand_schedule = trucking_demand_schedule.resample('h').sum().fillna(0.)

# schedule for pipeline
index = pd.date_range(start_date, end_date, freq = 'H')
Expand Down Expand Up @@ -171,7 +172,7 @@ def optimize_hydrogen_plant(wind_potential, pv_potential, times, demand_profile,
)
# Output results

lcoh = n.objective/(n.loads_t.p_set.sum()[0]/39.4*1000) # convert back to kg H2
lcoh = n.objective/(n.loads_t.p_set.sum().iloc[0]/39.4*1000) # convert back to kg H2
wind_capacity = n.generators.p_nom_opt['Wind']
solar_capacity = n.generators.p_nom_opt['Solar']
electrolyzer_capacity = n.links.p_nom_opt['Electrolysis']
Expand Down