Skip to content

Commit

Permalink
Merge pull request #142 from oemof/feature/bev_tests
Browse files Browse the repository at this point in the history
Tests for BEV facades
  • Loading branch information
nailend committed Dec 4, 2023
2 parents 976e218 + 3ea89f9 commit 3d30c87
Show file tree
Hide file tree
Showing 12 changed files with 2,066 additions and 280 deletions.
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ Authors
* Sarah Berendes
* Marie-Claire Gering
* Julian Endres
* Sabine Haas
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ Unreleased

Features

* Improve reading error message `#134 <https://github.com/oemof/oemof-tabular/pull/134>`_
* Remove facade relicts `#135 <https://github.com/oemof/oemof-tabular/pull/135>`_
* Add tests for BEV facades developed in #94 `#142 <https://github.com/oemof/oemof-tabular/pull/142>`_

Fixes

* Remove specific dirs from flake8 & isort `#136 <https://github.com/oemof/oemof-tabular/pull/136>`_
* Update lp-files to pyomo6.7 `#148 <https://github.com/oemof/oemof-tabular/pull/148>`_



Expand Down
9 changes: 7 additions & 2 deletions src/oemof/tabular/datapackage/reading.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,13 @@ def deserialize_energy_system(cls, path, typemap={}, attributemap={}):
for r in package.resources:
try:
r.read()
except dp.exceptions.CastError:
raise dp.exceptions.CastError((cast_error_msg).format(r.name))
except dp.exceptions.CastError as e:
raise dp.exceptions.CastError(
"\n"
+ (cast_error_msg).format(r.name)
+ "\n"
+ "\n ".join([str(i) for i in e.errors])
)
empty = HSN()
empty.read = lambda *xs, **ks: ()
empty.headers = ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Bev(GenericStorage, Facade):
Charging and discharging capacity is assumed to be equal.
Multiple fleets can be modelled and connected to a common bus
(mobility_bus) to apply one demand for all modelled fleets.
(commodity_bus) to apply one demand for all modelled fleets.
Parameters
----------
Expand Down Expand Up @@ -126,6 +126,7 @@ class Bev(GenericStorage, Facade):
The vehicle fleet is modelled as a storage together with an internal
sink with fixed flow:
todo check formula
.. math::
x^{level}(t) =
Expand Down Expand Up @@ -316,8 +317,9 @@ def build_solph_components(self):
)
},
# Includes storage charging efficiencies
conversion_factors={internal_bus: self.efficiency_mob_v2g},
# TODO check efficiencies
conversion_factors={
self.electricity_bus: (self.efficiency_mob_v2g)
},
)
subnodes.append(vehicle_to_grid)

Expand All @@ -336,14 +338,14 @@ def build_solph_components(self):
outputs={
self.commodity_bus: Flow(
nominal_value=self._nominal_value(self.charging_power),
max=self.availability,
# max=self.availability,
variable_costs=None,
# investment=self._investment(bev=True),
investment=self._converter_investment(),
)
},
conversion_factors={
self.bus: self.commodity_conversion_rate
self.commodity_bus: self.commodity_conversion_rate
* self.efficiency_mob_electrical
# * 100 # TODO pro 100 km?
},
Expand Down Expand Up @@ -425,17 +427,16 @@ def build_solph_components(self):
else:
flow_in = Flow(
nominal_value=self._nominal_value(self.charging_power),
max=self.availability,
# max=self.availability,
variable_costs=self.variable_costs,
**self.input_parameters,
)
flow_out = Flow(
nominal_value=self._nominal_value(self.charging_power),
# max=self.availability,
variable_costs=self.variable_costs,
**self.output_parameters,
)

# TODO check conversion factors
self.inflow_conversion_factor = solph_sequence(
self.efficiency_mob_g2v * self.efficiency_sto_in
)
Expand Down
Loading

0 comments on commit 3d30c87

Please sign in to comment.