Skip to content

Commit f08c53f

Browse files
Merge pull request #6 from pvstorageoptimization/dev
Dev
2 parents 3197749 + 3af0d86 commit f08c53f

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ Optibess Algorithm - optimizing PV system combined with storage
55
It uses data from *pvgis* and algorithms from the *pvlib* and *Nevergrad* python libraries, and is the backend part of
66
the *Optibess* site.
77

8-
.. image:: https://github.com/pvstorageoptimization/Optibess_algorithm/workflows/Tests/badge.svg
8+
|tests status| |codecov status| |Documentation Status| |PyPI version shields.io|
9+
10+
.. |tests status| image:: https://github.com/pvstorageoptimization/Optibess_algorithm/workflows/Tests/badge.svg
911
:target: https://github.com/pvstorageoptimization/Optibess_algorithm/actions?query=workflow%3ATests
1012

11-
.. image:: https://codecov.io/gh/pvstorageoptimization/Optibess_algorithm/graph/badge.svg?token=L3VLK1Y1SM
13+
.. |codecov status| image:: https://codecov.io/gh/pvstorageoptimization/Optibess_algorithm/graph/badge.svg?token=L3VLK1Y1SM
1214
:target: https://codecov.io/gh/pvstorageoptimization/Optibess_algorithm
1315

14-
|Documentation Status| |PyPI version shields.io|
15-
1616
.. |Documentation Status| image:: https://readthedocs.org/projects/optibess-algorithm/badge/?version=latest
1717
:target: http://optibess-algorithm.readthedocs.io/?badge=latest
1818

optibess_algorithm/output_calculator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,8 @@ def producer_factor(self):
469469

470470
@producer_factor.setter
471471
def producer_factor(self, value):
472-
if not 0 < value <= 1:
473-
raise ValueError("Producer factor should be between 0 (Exclusive) and 1 (inclusive)")
472+
if not 0 < value <= 2:
473+
raise ValueError("Producer factor should be between 0 (Exclusive) and 2 (inclusive)")
474474
self._producer_factor = value
475475

476476
@property

optibess_algorithm/power_system_optimizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def _set_variables(self):
222222
set_integer_casting() for _ in range(self._initial_aug_num - 1)] + \
223223
[ng.p.Scalar(init=0, lower=0, upper=self._first_entry_bound // 2).set_integer_casting()
224224
for _ in range(self._max_aug_num - self._initial_aug_num)] + \
225-
[ng.p.Scalar(init=100, lower=1, upper=100).set_integer_casting()]
225+
[ng.p.Scalar(init=100, lower=1, upper=200).set_integer_casting()]
226226
self._instru = ng.p.Tuple(*params)
227227

228228
def _set_constraints(self):

optibess_algorithm/producers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,10 @@ def _calc_pv_output(self):
160160
self._losses))
161161
tf = TimezoneFinder()
162162
self._time_zone = tf.timezone_at(lng=self._longitude, lat=self._latitude)
163+
# take first 365 to deal with leap years
163164
year_one = datetime.datetime.today().year
164165
times = pd.date_range(start=f'{year_one}-01-01 00:00', end=f'{year_one}-12-31 23:00', freq='h',
165-
tz=self._time_zone)
166+
tz=self._time_zone)[:8760]
166167
self._power_output.index = times
167168
self._power_output.columns = ['pv_output']
168169

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ numpy>=1.24.2
22
numpy-financial==1.0.0
33
pandas>=2.1.3
44
matplotlib>=3.7.1
5-
nevergrad==0.6.0
5+
nevergrad==1.0.1
66
timezonefinder==6.1.9
77
pvlib==0.10.2
88
solarfactors>=1.5.3

tests/test_output_calculator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def test_producer_factor_incorrect_value(self):
253253
# check for error in setter
254254
with self.assertRaises(ValueError) as e:
255255
self.output.producer_factor = 0
256-
self.assertEqual(str(e.exception), "Producer factor should be between 0 (Exclusive) and 1 (inclusive)")
256+
self.assertEqual(str(e.exception), "Producer factor should be between 0 (Exclusive) and 2 (inclusive)")
257257

258258
def test_get_data_shape(self):
259259
# check first year values

0 commit comments

Comments
 (0)