Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
# Conflicts:
#	docs/whats_new/v0-0-7.rst
#	src/oemof/thermal/__init__.py
  • Loading branch information
p-snft committed Dec 13, 2024
2 parents 2b02786 + d322528 commit 6816010
Show file tree
Hide file tree
Showing 20 changed files with 40 additions and 18 deletions.
1 change: 1 addition & 0 deletions docs/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Discover noteable new features and improvements in each release.
:local:
:backlinks: top

.. include:: whats_new/v0-0-8.rst
.. include:: whats_new/v0-0-7.rst
.. include:: whats_new/v0-0-6.rst
.. include:: whats_new/v0-0-5.rst
Expand Down
13 changes: 13 additions & 0 deletions docs/whats_new/v0-0-8.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
v0.0.8 (December 13, 2024)
==========================

Other changes
-------------

* Make compatible to Pandas 2
* Make compatible to PVLib 0.11

Contributors
------------

* Patrik Schönfeldt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def absorption_chiller_example():
solver_verbose = True

date_time_index = pd.date_range(
"1/1/2012", periods=number_of_time_steps, freq="H"
"1/1/2012", periods=number_of_time_steps, freq="h"
)
energysystem = solph.EnergySystem(timeindex=date_time_index)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def airource_hp_const_example():
solver_verbose = False

date_time_index = pd.date_range(
"1/1/2012", periods=number_of_time_steps, freq="H"
"1/1/2012", periods=number_of_time_steps, freq="h"
)

energysystem = solph.EnergySystem(timeindex=date_time_index)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def airource_hp_variable_example():
solver_verbose = False

date_time_index = pd.date_range(
"1/1/2012", periods=number_of_time_steps, freq="H"
"1/1/2012", periods=number_of_time_steps, freq="h"
)

energysystem = solph.EnergySystem(timeindex=date_time_index)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def chiller_cop_timeseries_example():
23,
]

timestamps = pd.date_range("20200101", periods=24, freq="H")
timestamps = pd.date_range("20200101", periods=24, freq="h")

# Convert temp_ambient to pandas DataFrame
df_temp_ambient = pd.DataFrame(temp_ambient, timestamps)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def groundsource_hp_example():
solver_verbose = False

date_time_index = pd.date_range(
"1/1/2012", periods=number_of_time_steps, freq="H"
"1/1/2012", periods=number_of_time_steps, freq="h"
)

energysystem = solph.EnergySystem(timeindex=date_time_index)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ def csp_andasol_example():
E_dir_hor=df_temp_amb_series["E_dir_hor"],
)

df_result = df_result.append(data_precalc_temp_amb, ignore_index=True)
df_result = pd.concat(
[df_result, data_precalc_temp_amb], ignore_index=True
)

_, ax = plt.subplots()
ax.plot(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def fixed_ratio_invest_facade_example():
# Set up an energy system model
solver = "cbc"
periods = 100
datetimeindex = pd.date_range("1/1/2019", periods=periods, freq="H")
datetimeindex = pd.date_range("1/1/2019", periods=periods, freq="h")
demand_timeseries = np.zeros(periods)
demand_timeseries[-5:] = 1
heat_feedin_timeseries = np.zeros(periods)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def print_parameters():
# Set up an energy system model
solver = "cbc"
periods = 100
datetimeindex = pd.date_range("1/1/2019", periods=periods, freq="H")
datetimeindex = pd.date_range("1/1/2019", periods=periods, freq="h")
demand_timeseries = np.zeros(periods)
demand_timeseries[-5:] = 1
heat_feedin_timeseries = np.zeros(periods)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def invest_independent_facade_example():
# Set up an energy system model
solver = "cbc"
periods = 100
datetimeindex = pd.date_range("1/1/2019", periods=periods, freq="H")
datetimeindex = pd.date_range("1/1/2019", periods=periods, freq="h")
demand_timeseries = np.zeros(periods)
demand_timeseries[-5:] = 1
heat_feedin_timeseries = np.zeros(periods)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def print_parameters():
# Set up an energy system model
solver = "cbc"
periods = 100
datetimeindex = pd.date_range("1/1/2019", periods=periods, freq="H")
datetimeindex = pd.date_range("1/1/2019", periods=periods, freq="h")
demand_timeseries = np.zeros(periods)
demand_timeseries[-5:] = 1
heat_feedin_timeseries = np.zeros(periods)
Expand Down
2 changes: 1 addition & 1 deletion examples/stratified_thermal_storage/model_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def run_storage_model(initial_storage_level, temp_h, temp_c):

# Set up an energy system model
periods = 10
datetimeindex = pd.date_range("1/1/2019", periods=periods, freq="H")
datetimeindex = pd.date_range("1/1/2019", periods=periods, freq="h")
demand_timeseries = np.zeros(periods)
heat_feedin_timeseries = np.zeros(periods)

Expand Down
2 changes: 1 addition & 1 deletion examples/stratified_thermal_storage/operation_facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def print_parameters():

# Set up an energy system model
periods = 100
datetimeindex = pd.date_range("1/1/2019", periods=periods, freq="H")
datetimeindex = pd.date_range("1/1/2019", periods=periods, freq="h")
demand_timeseries = np.zeros(periods)
demand_timeseries[-5:] = 1
heat_feedin_timeseries = np.zeros(periods)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def print_parameters():
# Set up an energy system model
solver = "cbc"
periods = 100
datetimeindex = pd.date_range("1/1/2019", periods=periods, freq="H")
datetimeindex = pd.date_range("1/1/2019", periods=periods, freq="h")
demand_timeseries = np.zeros(periods)
demand_timeseries[-5:] = 1
heat_feedin_timeseries = np.zeros(periods)
Expand Down
2 changes: 1 addition & 1 deletion examples/stratified_thermal_storage/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def print_results():
# Set up an energy system model
solver = "cbc"
periods = 800
datetimeindex = pd.date_range("1/1/2019", periods=periods, freq="H")
datetimeindex = pd.date_range("1/1/2019", periods=periods, freq="h")

energysystem = EnergySystem(timeindex=datetimeindex)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ requires-python = ">=3.9"
dependencies = [
'oemof.solph <= 0.5.5',
'matplotlib',
'pvlib <= 0.9.0',
'pvlib',
'numpy >= 1.16.5',
'pandas >= 0.18.0'
]
Expand Down
2 changes: 1 addition & 1 deletion src/oemof/thermal/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.0.7"
__version__ = "0.0.8"
__project__ = "oemof.thermal"

from . import absorption_heatpumps_and_chillers
Expand Down
8 changes: 7 additions & 1 deletion src/oemof/thermal/concentrating_solar_power.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,15 @@ def calc_irradiance(
"""
if irradiance_method == "horizontal":
poa_horizontal_ratio = pvlib.irradiance.poa_horizontal_ratio(
cos_poa_zen = pvlib.irradiance.aoi_projection(
surface_tilt, surface_azimuth, apparent_zenith, azimuth
)

cos_solar_zenith = pvlib.tools.cosd(apparent_zenith)

# ratio of tilted and horizontal beam irradiance
poa_horizontal_ratio = cos_poa_zen / cos_solar_zenith

poa_horizontal_ratio[poa_horizontal_ratio < 0] = 0
irradiance_on_collector = irradiance * poa_horizontal_ratio

Expand Down
2 changes: 1 addition & 1 deletion tests/test_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def setup_class(cls):
r"^objective.*(?=s\.t\.)", re.DOTALL | re.MULTILINE
)

cls.date_time_index = pd.date_range("1/1/2012", periods=3, freq="H")
cls.date_time_index = pd.date_range("1/1/2012", periods=3, freq="h")

cls.tmpdir = helpers.extend_basic_path("tmp")
logging.info(cls.tmpdir)
Expand Down

0 comments on commit 6816010

Please sign in to comment.