From 1ae036925f12552f98ab934a66c8225cd15470a4 Mon Sep 17 00:00:00 2001 From: Jack Poulson Date: Tue, 22 Nov 2016 23:13:27 -0800 Subject: [PATCH] Avoiding the need to propagate global variables in python --- python/__init__.py | 21 --------------------- python/io.py | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/python/__init__.py b/python/__init__.py index 00df2e69b3..ce6302efa4 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -6,27 +6,6 @@ # which can be found in the LICENSE file in the root directory, or at # http://opensource.org/licenses/BSD-2-Clause # - -# Attempt to import matplotlib.pyplot and save whether or not this succeeded -try: - import numpy as np - import matplotlib as mpl - import matplotlib.pyplot as plt - havePyPlot=True -except: - havePyPlot=False - print 'Could not import matplotlib.pyplot' - -if havePyPlot: - try: - import networkx as nx - haveNetworkX = True - except: - haveNetworkX = False - print 'Could not import networkx' -else: - haveNetworkX = False - from core import * from blas_like import * from io import * diff --git a/python/io.py b/python/io.py index a4523aed61..d5dae26c8b 100644 --- a/python/io.py +++ b/python/io.py @@ -9,6 +9,26 @@ from El.core import * from El.blas_like import Copy, CopyFromRoot, CopyFromNonRoot, RealPart, ImagPart +# Attempt to import matplotlib.pyplot and save whether or not this succeeded +try: + import numpy as np + import matplotlib as mpl + import matplotlib.pyplot as plt + havePyPlot=True +except: + havePyPlot=False + print 'Could not import matplotlib.pyplot' + +if havePyPlot: + try: + import networkx as nx + haveNetworkX = True + except: + haveNetworkX = False + print 'Could not import networkx' +else: + haveNetworkX = False + # Input/Output # ************