Skip to content

Commit

Permalink
Avoiding the need to propagate global variables in python
Browse files Browse the repository at this point in the history
  • Loading branch information
poulson committed Nov 23, 2016
1 parent cfd5e58 commit 1ae0369
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
21 changes: 0 additions & 21 deletions python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down
20 changes: 20 additions & 0 deletions python/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ************

Expand Down

0 comments on commit 1ae0369

Please sign in to comment.