Skip to content

Commit

Permalink
Refactor logging (#295)
Browse files Browse the repository at this point in the history
* Refactor logging

* Delete edisgo_run file

* Add logger module to API doc

* Delete edisgo_run from API doc

* Changes to docstring

* Change logger

* Expand docstring

* Add setup_logger to examples

* Add check if dingo example grid directory is empty

* Add logging to whatsnew

* Move logger setup to function

* Add class teardown to enable caplog

* Minor change in docstring

Co-authored-by: birgits <birgit.schachler@rl-institut.de>
  • Loading branch information
mltja and birgits committed Sep 8, 2022
1 parent 10d0b3b commit 4735c19
Show file tree
Hide file tree
Showing 10 changed files with 317 additions and 625 deletions.
16 changes: 8 additions & 8 deletions doc/api/edisgo.tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ edisgo.tools.config module
:undoc-members:
:show-inheritance:

edisgo.tools.edisgo\_run module
--------------------------------

.. automodule:: edisgo.tools.edisgo_run
:members:
:undoc-members:
:show-inheritance:

edisgo.tools.geo module
------------------------

Expand All @@ -33,6 +25,14 @@ edisgo.tools.geopandas\_helper module
:undoc-members:
:show-inheritance:

edisgo.tools.logger module
----------------------------------------

.. automodule:: edisgo.tools.logger
:members:
:undoc-members:
:show-inheritance:

edisgo.tools.networkx\_helper module
----------------------------------------

Expand Down
1 change: 1 addition & 0 deletions doc/whatsnew/v0-2-0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Changes
* added pre-commit hooks (flake8, black, isort, pyupgrade) `#229 <https://github.com/openego/eDisGo/pull/229>`_
* added issue and pull request templates `#220 <https://github.com/openego/eDisGo/issues/220>`_
* added Windows installation yml and documentation
* added functionality to set up different loggers with individual logging levels and where to write output `#295 <https://github.com/openego/eDisGo/issues/295>`_
* added integrity checks of eDisGo object `#231 <https://github.com/openego/eDisGo/issues/231>`_
* added functionality to save to and load from zip archive `#216 <https://github.com/openego/eDisGo/pull/216>`_
* added option to not raise error in case power flow did not converge `#207 <https://github.com/openego/eDisGo/issues/207>`_
Expand Down
2 changes: 1 addition & 1 deletion edisgo/flex_opt/charging_strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
],
}

logger = logging.getLogger("edisgo")
logger = logging.getLogger(__name__)


# TODO: the dummy timeseries should be as long as the simulated days and not
Expand Down
2 changes: 1 addition & 1 deletion edisgo/network/electromobility.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
if "READTHEDOCS" not in os.environ:
import geopandas as gpd

logger = logging.getLogger("edisgo")
logger = logging.getLogger(__name__)

COLUMNS = {
"charging_processes_df": [
Expand Down

0 comments on commit 4735c19

Please sign in to comment.