From ce3b89764952cfd91c144394b6b3a6be3e2e1e30 Mon Sep 17 00:00:00 2001 From: Jonas Hoersch Date: Tue, 13 Aug 2019 10:53:18 +0200 Subject: [PATCH] Fix importing plot_p_nom_max module for documentation --- scripts/plot_p_nom_max.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/scripts/plot_p_nom_max.py b/scripts/plot_p_nom_max.py index d1df54ad..92f9e49a 100644 --- a/scripts/plot_p_nom_max.py +++ b/scripts/plot_p_nom_max.py @@ -15,12 +15,6 @@ Description """ -# Dirty work-around so that sphinx can import this module and get the -# doc-string -if __name__ != "__main__": - import sys - sys.exit(0) - import pypsa import pandas as pd import matplotlib.pyplot as plt @@ -43,7 +37,7 @@ def cum_p_nom_max(net, tech, country=None): return generators -if __name__ == __main__: +if __name__ == "__main__": # Detect running outside of snakemake and mock snakemake for testing if 'snakemake' not in globals(): from vresutils.snakemake import MockSnakemake, Dict