From 23687c2e0c275e4b224cb0f44105f9ce76d95183 Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Tue, 3 Sep 2024 17:10:27 +0200 Subject: [PATCH] Update file headers --- etrago/cluster/electrical.py | 6 +++-- etrago/cluster/gas.py | 2 +- etrago/cluster/spatial.py | 4 +-- etrago/disaggregate/spatial.py | 43 ++++++++++++++++++++++++++++++--- etrago/disaggregate/temporal.py | 2 +- etrago/tools/io.py | 8 +++--- 6 files changed, 53 insertions(+), 12 deletions(-) diff --git a/etrago/cluster/electrical.py b/etrago/cluster/electrical.py index 25102865..1194101e 100755 --- a/etrago/cluster/electrical.py +++ b/etrago/cluster/electrical.py @@ -21,10 +21,13 @@ """ electrical.py defines the methods to cluster power grid networks spatially for applications within the tool eTraGo.""" +import logging import os +logger = logging.getLogger(__name__) + if "READTHEDOCS" not in os.environ: - import logging + from pypsa import Network from pypsa.clustering.spatial import ( @@ -50,7 +53,6 @@ ) from etrago.tools.utilities import set_control_strategies - logger = logging.getLogger(__name__) __copyright__ = ( "Flensburg University of Applied Sciences, " diff --git a/etrago/cluster/gas.py b/etrago/cluster/gas.py index b31f4e1e..d4cb72ec 100644 --- a/etrago/cluster/gas.py +++ b/etrago/cluster/gas.py @@ -21,10 +21,10 @@ """ gas.py defines the methods to cluster gas grid networks spatially for applications within the tool eTraGo.""" +import logging import os if "READTHEDOCS" not in os.environ: - import logging from pypsa.clustering.spatial import ( aggregatebuses, diff --git a/etrago/cluster/spatial.py b/etrago/cluster/spatial.py index 9f782c1d..cc214834 100755 --- a/etrago/cluster/spatial.py +++ b/etrago/cluster/spatial.py @@ -20,12 +20,12 @@ # File description for read-the-docs """ spatial.py defines the methods to run spatial clustering on networks.""" +import logging import os if "READTHEDOCS" not in os.environ: from itertools import product from math import ceil - import logging import multiprocessing as mp from networkx import NetworkXNoPath @@ -49,7 +49,7 @@ connected_transformer, ) - logger = logging.getLogger(__name__) +logger = logging.getLogger(__name__) __copyright__ = ( "Flensburg University of Applied Sciences, " diff --git a/etrago/disaggregate/spatial.py b/etrago/disaggregate/spatial.py index 70da2be5..733820f4 100644 --- a/etrago/disaggregate/spatial.py +++ b/etrago/disaggregate/spatial.py @@ -1,3 +1,27 @@ +# -*- coding: utf-8 -*- +# Copyright 2016-2023 Flensburg University of Applied Sciences, +# Europa-Universität Flensburg, +# Centre for Sustainable Energy Systems, +# DLR-Institute for Networked Energy Systems +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation; either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +# File description +""" +spatial.py defines the methods to run spatial disaggregation on networks. +""" + from functools import reduce from itertools import product from operator import methodcaller as mc, mul as multiply @@ -9,9 +33,22 @@ from pypsa import Network import pandas as pd -from etrago.tools import noops -from etrago.tools.utilities import residual_load - +if "READTHEDOCS" not in os.environ: + from etrago.tools import noops + from etrago.tools.utilities import residual_load + +__copyright__ = ( + "Flensburg University of Applied Sciences, " + "Europa-Universität Flensburg, " + "Centre for Sustainable Energy Systems, " + "DLR-Institute for Networked Energy Systems" +) +__license__ = "GNU Affero General Public License Version 3 (AGPL-3.0)" +__author__ = ( + "MGlauer, MarlonSchlemminger, mariusves, BartelsJ, gnn, lukasoldi, " + "ulfmueller, lukasol, ClaraBuettner, CarlosEpia, KathiEsterl, " + "pieterhexen, fwitte, AmeliaNadal, cjbernal071421" +) class Disaggregation: def __init__(self, original_network, clustered_network, busmap, skip=()): diff --git a/etrago/disaggregate/temporal.py b/etrago/disaggregate/temporal.py index 5e7b6ede..f30ebec9 100644 --- a/etrago/disaggregate/temporal.py +++ b/etrago/disaggregate/temporal.py @@ -19,7 +19,7 @@ # File description """ -execute.py defines optimization and simulation methods for the etrago object. +temporal.py defines the methods to run temporal disaggregation on networks. """ import logging import os diff --git a/etrago/tools/io.py b/etrago/tools/io.py index 16781c67..b648eef7 100644 --- a/etrago/tools/io.py +++ b/etrago/tools/io.py @@ -49,19 +49,21 @@ __author__ = "ulfmueller, mariusves, pieterhexen, ClaraBuettner" from importlib import import_module +import logging import os import numpy as np import pandas as pd import pypsa -if "READTHEDOCS" not in os.environ: - import logging +logger = logging.getLogger(__name__) + +if "READTHEDOCS" not in os.environ: from sqlalchemy.orm.exc import NoResultFound import saio - logger = logging.getLogger(__name__) + carr_ormclass = "Source"