Skip to content

Commit

Permalink
Clean modules
Browse files Browse the repository at this point in the history
  • Loading branch information
uvchik committed Oct 24, 2019
1 parent 3244820 commit 272e94c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
2 changes: 0 additions & 2 deletions deflex/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@


_loaded = False
print('count')
if not _loaded:
init(paths=[os.path.dirname(__file__)])
_loaded = True
print('load!!!!!!!!!')
8 changes: 2 additions & 6 deletions deflex/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
import time
import traceback

# oemof packages
from oemof.tools import logger

# internal modules
import reegis.config as cfg
from deflex import scenario_tools
Expand Down Expand Up @@ -65,7 +62,7 @@ def main(year, rmap, plot_graph=False):

if not os.path.isdir(csv_path):
fn = basic_scenario.create_basic_scenario(year, path=path,
csv_dir=csv_dir)
csv_dir=csv_dir)
if csv_path != fn.csv:
msg = ("\n{0}\n{1}\nThe wrong path is checked. This will recreate "
"the scenario every time!".format(csv_path, fn.csv))
Expand Down Expand Up @@ -117,9 +114,8 @@ def main_secure(year, rmap, plot_graph=False):
--------
>>> main_secure(2014, 'de21', False) # doctest: +SKIP
"""
cfg.tmp_set('init', 'map', rmap)
try:
main(year, plot_graph=plot_graph)
main(year, rmap, plot_graph=plot_graph)
except Exception as e:
logging.error(traceback.format_exc())
time.sleep(0.5)
Expand Down
6 changes: 3 additions & 3 deletions deflex/powerplants.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
import deflex.geometries


#Todo: Revise and test.
# Todo: Revise and test.


def pp_reegis2deflex(clean_offshore=True):
def pp_reegis2deflex():
filename_out = os.path.join(cfg.get('paths', 'powerplants'),
cfg.get('powerplants', 'deflex_pp')).format(
map=cfg.get('init', 'map'))
Expand Down Expand Up @@ -74,7 +74,7 @@ def remove_onshore_technology_from_offshore_regions(df):
'NI': 'DE14'},
'de22': {'MV': 'DE01',
'SH': 'DE13',
'NI': 'DE14'},}
'NI': 'DE14'}}
try:
dc = coast_regions[cfg.get('init', 'map')]
except KeyError:
Expand Down
2 changes: 0 additions & 2 deletions deflex/scenario_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
from oemof import outputlib
from oemof import graph

from reegis import config as cfg


class NodeDict(dict):
__slots__ = ()
Expand Down

0 comments on commit 272e94c

Please sign in to comment.