Skip to content

Commit

Permalink
Devs/file headers (#90)
Browse files Browse the repository at this point in the history
* Changing file headers of flixOpt

* Updating setup.py to be all english

* Changing headers in examples and __init__.py
  • Loading branch information
FBumann authored Dec 11, 2024
1 parent 5b53be3 commit 075ef4e
Show file tree
Hide file tree
Showing 25 changed files with 56 additions and 94 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
results/
.idea/
.venv/
~/.venv
venv/
.DS_Store
lib/
Expand Down
5 changes: 1 addition & 4 deletions examples/Ex00_minmal/minimal_example.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# -*- coding: utf-8 -*-
"""
Energy System Optimization Example
Developed by Felix Panitz and Peter Stange
Chair of Building Energy Systems and Heat Supply, Technische Universität Dresden
This script shows how to use the flixOpt framework to model a super minimalistic energy system.
"""

import numpy as np
Expand Down
5 changes: 1 addition & 4 deletions examples/Ex01_simple/simple_example.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 16 11:19:17 2022
developed by Felix Panitz* and Peter Stange*
* at Chair of Building Energy Systems and Heat Supply, Technische Universität Dresden
THis script shows how to use the flixOpt framework to model a simple energy system.
"""

import numpy as np
Expand Down
5 changes: 1 addition & 4 deletions examples/Ex02_complex/complex_example.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 16 11:19:17 2022
developed by Felix Panitz* and Peter Stange*
* at Chair of Building Energy Systems and Heat Supply, Technische Universität Dresden
This script shows how to use the flixOpt framework to model a more complex energy system.
"""

import numpy as np
Expand Down
5 changes: 1 addition & 4 deletions examples/Ex02_complex/complex_example_results.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 16 11:19:17 2022
developed by Felix Panitz* and Peter Stange*
* at Chair of Building Energy Systems and Heat Supply, Technische Universität Dresden
This script shows how load results of a prior calcualtion and how to analyze them.
"""

import pandas as pd
Expand Down
6 changes: 2 additions & 4 deletions examples/Ex03_calculation_types/example_calculation_types.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 4 11:26:10 2020
Developed by Felix Panitz* and Peter Stange*
* at Chair of Building Energy Systems and Heat Supply, Technische Universität Dresden
This script demonstrates how to use the different calcualtion types in the flixOPt framework
to model the same energy system. THe Results will be compared to each other.
"""

import pathlib
Expand Down
5 changes: 1 addition & 4 deletions flixOpt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 16 09:16:58 2021
@author: Panitz
This module bundles all common functionality of flixOpt and sets up the logging
"""

from .commons import *
Expand Down
8 changes: 2 additions & 6 deletions flixOpt/aggregation.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 26 10:23:49 2021
developed by Felix Panitz* and Peter Stange*
* at Chair of Building Energy Systems and Heat Supply, Technische Universität Dresden
Modul zur aggregierten Berechnung eines Energiesystemmodells.
This module contains the Aggregation functionality for the flixOpt framework.
Through this, aggregating TimeSeriesData is possible.
"""

import copy
Expand Down
11 changes: 7 additions & 4 deletions flixOpt/calculation.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 16 12:40:23 2020
developed by Felix Panitz* and Peter Stange*
* at Chair of Building Energy Systems and Heat Supply, Technische Universität Dresden
This module contains the Calculation functionality for the flixOpt framework.
It is used to calculate a SystemModel for a given FlowSystem through a solver.
There are three different Calculation types:
1. FullCalculation: Calculates the SystemModel for the full FlowSystem
2. AggregatedCalculation: Calculates the SystemModel for the full FlowSystem, but aggregates the TimeSeriesData.
This simplifies the mathematical model and usually speeds up the solving process.
3. SegmentedCalculation: Solves a SystemModel for each individual Segment of the FlowSystem.
"""

import datetime
Expand Down
4 changes: 3 additions & 1 deletion flixOpt/commons.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
"""
This module makes the commonly used classes and functions available in the flixOpt framework.
"""

from .core import setup_logging, change_logging_level, TimeSeriesData

Expand Down
5 changes: 1 addition & 4 deletions flixOpt/components.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 10 13:45:12 2020
developed by Felix Panitz* and Peter Stange*
* at Chair of Building Energy Systems and Heat Supply, Technische Universität Dresden
This module contains the basic components of the flixOpt framework.
"""

import numpy as np
Expand Down
7 changes: 3 additions & 4 deletions flixOpt/core.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 31 22:51:38 2021
developed by Felix Panitz* and Peter Stange*
* at Chair of Building Energy Systems and Heat Supply, Technische Universität Dresden
This module contains the core functionality of the flixOpt framework.
It provides Datatypes, logging functionality, and some functions to transform data structures.
"""

from typing import Union, Optional, List, Dict, Any, Literal
import logging
import inspect
Expand Down
8 changes: 4 additions & 4 deletions flixOpt/effects.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 16 12:40:23 2020
developed by Felix Panitz* and Peter Stange*
* at Chair of Building Energy Systems and Heat Supply, Technische Universität Dresden
This module contains the effects of the flixOpt framework.
Furthermore, it contains the EffectCollection, which is used to collect all effects of a system.
Different Datatypes are used to represent the effects with assigned values by the user,
which are then transformed into the internal data structure.
"""

from typing import List, Dict, Union, Optional, Literal
Expand Down
5 changes: 1 addition & 4 deletions flixOpt/elements.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 16 12:40:23 2020
developed by Felix Panitz* and Peter Stange*
* at Chair of Building Energy Systems and Heat Supply, Technische Universität Dresden
This module contains the basic elements of the flixOpt framework.
"""

from typing import List, Tuple, Union, Optional, Dict
Expand Down
6 changes: 2 additions & 4 deletions flixOpt/features.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 16 12:40:23 2020
developed by Felix Panitz* and Peter Stange*
* at Chair of Building Energy Systems and Heat Supply, Technische Universität Dresden
This module contains the features of the flixOpt framework.
Features extend the functionality of Elements.
"""

from typing import List, Tuple, Dict, Union, Optional, TYPE_CHECKING
Expand Down
6 changes: 2 additions & 4 deletions flixOpt/flow_system.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 16 12:40:23 2020
developed by Felix Panitz* and Peter Stange*
* at Chair of Building Energy Systems and Heat Supply, Technische Universität Dresden
This module contains the FlowSystem class, which is used to collect instances of many other classes by the end User.
"""

import pathlib
from typing import List, Set, Tuple, Dict, Union, Optional, Literal
import logging
Expand Down
7 changes: 3 additions & 4 deletions flixOpt/interface.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 6 15:25:43 2022
developed by Felix Panitz* and Peter Stange*
* at Chair of Building Energy Systems and Heat Supply, Technische Universität Dresden
This module contains classes to collect Parameters for the Investment and OnOff decisions.
These are tightly connected to features.py
"""

import logging
from typing import Union, Optional, Dict, List, Tuple, TYPE_CHECKING

Expand Down
6 changes: 2 additions & 4 deletions flixOpt/linear_converters.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 10 13:45:12 2020
developed by Felix Panitz* and Peter Stange*
* at Chair of Building Energy Systems and Heat Supply, Technische Universität Dresden
This Module contains high-level classes to easily model a FlowSystem.
"""

import logging
from typing import Optional, Dict

Expand Down
9 changes: 5 additions & 4 deletions flixOpt/math_modeling.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 17 14:09:02 2020
developed by Felix Panitz* and Peter Stange*
* at Chair of Building Energy Systems and Heat Supply, Technische Universität Dresden
This module contains the mathematical core of the flixOpt framework.
THe module is designed to be used by other modules than flixOpt itself.
It holds all necessary classes and functions to create a mathematical model, consisting of Varaibles and constraints,
and translate it into a ModelingLanguage like Pyomo, and the solve it through a solver.
Multiple solvers are supported.
"""

import logging
Expand Down
8 changes: 4 additions & 4 deletions flixOpt/plotting.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 26 09:43:09 2021
developed by Felix Panitz* and Peter Stange*
* at Chair of Building Energy Systems and Heat Supply, Technische Universität Dresden
This module contains the plotting functionality of the flixOpt framework.
It provides high level functions to plot data with plotly and matplotlib.
It's meant to be used in results.py, but is designed to be used by the end user as well.
"""

import logging
import pathlib
from typing import Literal, Tuple, Union, Optional, List
Expand Down
8 changes: 4 additions & 4 deletions flixOpt/results.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 14 16:05:50 2022
developed by Felix Panitz* and Peter Stange*
* at Chair of Building Energy Systems and Heat Supply, Technische Universität Dresden
This module contains the Results functionality of the flixOpt framework.
It provides high level functions to analyze the results of a calculation.
It leverages the plotting.py module to plot the results.
The results can also be analyzed without this module, as the results are stored in a widely supported format.
"""

import logging
Expand Down
7 changes: 1 addition & 6 deletions flixOpt/solvers.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 16 12:40:23 2020
developed by Felix Panitz* and Peter Stange*
* at Chair of Building Energy Systems and Heat Supply, Technische Universität Dresden
This module contains the solvers of the flixOpt framework, making them available to the end user in a compact way.
"""

# This module is simply for convenience

from .math_modeling import Solver, HighsSolver, GurobiSolver, CbcSolver, CplexSolver, GlpkSolver
6 changes: 2 additions & 4 deletions flixOpt/structure.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 16 12:40:23 2020
developed by Felix Panitz* and Peter Stange*
* at Chair of Building Energy Systems and Heat Supply, Technische Universität Dresden
This module contains the core structure of the flixOpt framework.
These classes are not directly used by the end user, but are used by other modules.
"""

from typing import List, Dict, Union, Optional, Literal, TYPE_CHECKING, Any
Expand Down
5 changes: 1 addition & 4 deletions flixOpt/utils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 12 13:13:31 2020
developed by Felix Panitz* and Peter Stange*
* at Chair of Building Energy Systems and Heat Supply, Technische Universität Dresden
This module contains several utility functions used throughout the flixOpt framework.
"""

import logging
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def read_requirements(file_path):
python_requires='>=3.10, <3.13',
author='Felix Bumann, Felix Panitz, Peter Stange',
author_email='[email protected], [email protected], [email protected]',
maintainer='Professur für Gebäudeenergietechnik und Wärmeversorgung (GEWV), TU Dresden',
maintainer='Chair of Building Energy Systems and Heat Supply, TU Dresden',
maintainer_email='[email protected]',
description='Vector based energy and material flow optimization framework in python.',
long_description=open('README.md').read(),
Expand Down

0 comments on commit 075ef4e

Please sign in to comment.