Fix importing plot_p_nom_max module for documentation

This commit is contained in:
Jonas Hoersch 2019-08-13 10:53:18 +02:00
parent 3a94d4f5ef
commit ce3b897649

View File

@ -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 pypsa
import pandas as pd import pandas as pd
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
@ -43,7 +37,7 @@ def cum_p_nom_max(net, tech, country=None):
return generators return generators
if __name__ == __main__: if __name__ == "__main__":
# Detect running outside of snakemake and mock snakemake for testing # Detect running outside of snakemake and mock snakemake for testing
if 'snakemake' not in globals(): if 'snakemake' not in globals():
from vresutils.snakemake import MockSnakemake, Dict from vresutils.snakemake import MockSnakemake, Dict