Skip to content

Commit

Permalink
Add simple source facade
Browse files Browse the repository at this point in the history
  • Loading branch information
Bachibouzouk committed Oct 14, 2024
1 parent c346880 commit ac0e3ef
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/oemof_tabular_plugins/general/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,12 @@
from .pre_processing.pre_processing import calculate_annuity
from .pre_processing.pre_processing import logger
from .post_processing.gui import prepare_app

from oemof.tabular.facades import TYPEMAP
from .facades import SimpleSource

OTP_TYPEMAP = {
"source": SimpleSource,
}

OTP_TYPEMAP.update(TYPEMAP)
1 change: 1 addition & 0 deletions src/oemof_tabular_plugins/general/facades/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .source import SimpleSource
32 changes: 32 additions & 0 deletions src/oemof_tabular_plugins/general/facades/source.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from dataclasses import field
from typing import Sequence, Union

from oemof.solph.buses import Bus
from oemof.solph.components import Source
from oemof.solph.flows import Flow

from oemof.tabular._facade import Facade, dataclass_facade


@dataclass_facade
class SimpleSource(Source, Facade):
r"""Volatile element with one output. This class can be used to model
Sun when connected to a converter with adequate conversion factors
Parameters
----------
bus: oemof.solph.Bus
An oemof bus instance where the generator is connected to
"""

bus: Bus

carrier: str = ""

tech: str = ""

def build_solph_components(self):
""" """

self.outputs.update({self.bus: Flow()})
4 changes: 2 additions & 2 deletions src/oemof_tabular_plugins/wefe/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from oemof_tabular_plugins.wefe.constraints.constraint_facades import (
CONSTRAINT_TYPE_MAP,
)
from oemof.tabular.facades import TYPEMAP
from oemof.tabular.facades import OTP_TYPEMAP
from .facades import (
PVPanel,
MIMO,
Expand All @@ -22,4 +22,4 @@
"apv": APV,
}

WEFE_TYPEMAP.update(TYPEMAP)
WEFE_TYPEMAP.update(OTP_TYPEMAP)

0 comments on commit ac0e3ef

Please sign in to comment.