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

Add Medias to improve validation, plotting and interpretation #65

Open
FBumann opened this issue Nov 25, 2024 · 8 comments
Open

Add Medias to improve validation, plotting and interpretation #65

FBumann opened this issue Nov 25, 2024 · 8 comments
Assignees
Labels
New functionality New feature or request

Comments

@FBumann
Copy link
Collaborator

FBumann commented Nov 25, 2024

Medium

Properties of a Medium

  • label: A name for the Medium
  • unit: a unit for the medium like kg or MWh
  • description: a detailed description of the medium if needed
class Medium:
    def __init__(label: str, unit: str, description: str = ''):
        self.label = label
        ...

medium_a = Medium('Gas', 'MWh', 'Gas used as fuel')

Advantages

Assigning a Medium to a Flow means more information about the characteristics of the Flow.
Specifying Medias of a Bus and Flows can be used to validate that no Flow with a Medium that's not allowed is connected to the bus.
For a Flow that has a Medium assigned, its flow_rate can be interpreted by looking at the unit and label. This can also used for plotting!
Mediuas could also be used for coloring in plots or network visualizations.

What's not wanted

  • The Medium is not meant for unit conversions
  • Assigning a medium should be optional

Nice to haves

  • colors
  • automatic color assignments, that can be customized
@FBumann FBumann added the New functionality New feature or request label Nov 25, 2024
@FBumann
Copy link
Collaborator Author

FBumann commented Nov 25, 2024

This kind of information is already part of the class Effect (unit & description).
Maybe this can be combined?
Might be ok to check this later on.
fx.Effect(label='costs', unit='€', description='Cost')

@FBumann
Copy link
Collaborator Author

FBumann commented Nov 25, 2024

Filtering investment decisions based on the medium would also be possible

FBumann added a commit that referenced this issue Dec 17, 2024
@FBumann
Copy link
Collaborator Author

FBumann commented Dec 20, 2024

Instead of Medium, Commodity would be the better term.
This could also be used to replace the other Parameters in

Effect(label='costs', commodity = Commodity(label='costsA', unit='€', description='Costs occurring from trading with Partner A')

@baumbude
Copy link
Collaborator

commodity. mmm. weiß nicht. "Medium" finde ich schon auch gut.
Ich würde Effect nicht unbedingt mit reinnehmen. Weil das keine im Gegensatz zu Flows keine zeitbezogenen "Medien" sind.

@baumbude
Copy link
Collaborator

Für den Bus konnte man mehrere gültige Medien definieren (z.B. Dampf, Fernwärme,...), sodass man verschiedenes dort andocken konnte.

@FBumann
Copy link
Collaborator Author

FBumann commented Dec 23, 2024

Ja das ging.
Ich muss aber sagen dass ich Jedm Bus/Flow/Component mir ein Medium zuweisen würde.
Die Validierung ist aber nur als WARNING, man kann also trotzdem alles mit allem connecten.
Das macht die Umsetzung leichter und eindeutiger.

@FBumann
Copy link
Collaborator Author

FBumann commented Dec 23, 2024

Dann lassen wir Effekt ohne Medium.
Und nennen es Medium, nicht Commodity

@FBumann
Copy link
Collaborator Author

FBumann commented Jan 10, 2025

Logik:

  • Medium ist ein Objekt mit (label, unit, evtl color (sonst automatisch), Optional[List[str]]: categories)
  • Medium wird zu einem (oder mehreren) Bussen zugewiesen
  • Flows die an Bus connection bekommen das Medium zugewiesen
    • Wenn leer, einfach zuweisen
    • Wenn voll, dann checken, ob "category" des Mediums passt
  • Default "categories":
    • electricity
    • fuel
    • heat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New functionality New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants