Skip to content

Commit

Permalink
updated hashdist/stack, cleaned up some print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
cekees committed Mar 30, 2017
1 parent f014c89 commit 3d0db58
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
3 changes: 2 additions & 1 deletion .hashdist_default
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
aa9456db834541baaa15eda7ff3733d78be9dba9
5b01e870f578137ab7a4f100c079f7e29f5cd183

2 changes: 1 addition & 1 deletion .hashstack_default
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9520ae64aa78ed3441859ffa02919e15134b0951
83cd9b8bfa030ddc0ba0807eca742f63620de42c
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,9 @@ jupyter:
@echo "************************************"
@echo "Enabling jupyter notebook/lab/widgets"
source ${PROTEUS_PREFIX}/bin/proteus_env.sh
pip install jupyter jupyterlab ipywidgets ipyleaflet jupyter_dashboards pythreejs RISE cesiumpy bqplot mayavi
pip install ipyparallel==6.0.2 ipython==5.3.0 terminado==0.6 jupyter==1.0.0 jupyterlab==0.18.1 ipywidgets==6.0.0 ipyleaflet==0.3.0 jupyter_dashboards==0.6.1 pythreejs==0.3.0 rise==4.0.0b1 cesiumpy==0.3.3 bqplot==0.9.0
jupyter serverextension enable --py jupyterlab --sys-prefix
jupyter nbextension enable --py --sys-prefix widgetsnbextension
jupyter nbextension install --py --sys-prefix mayavi
jupyter nbextension enable --py --sys-prefix bqplot
jupyter nbextension enable --py --sys-prefix pythreejs
jupyter nbextension enable --py --sys-prefix ipyleaflet
Expand Down
6 changes: 3 additions & 3 deletions proteus/TriangleTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import triangleWrappers
import TriangleUtils
import TriangleFileUtils

from Profiling import logEvent

class TriangleBaseMesh:
"""A triangulation interface wrapper.
Expand Down Expand Up @@ -56,8 +56,8 @@ def __init__(self,baseFlags="zen",nbase=0,verbose=0):
if self.baseFlags.find('v') >= 0:
self.makeVoronoi = True
if verbose > 0:
print """TriangleBaseMesh nbase=%d baseFlags= %s """ % (self.nbase,
self.baseFlags)
logEvent("""TriangleBaseMesh nbase=%d baseFlags= %s """ % (self.nbase,
self.baseFlags))
#end if
#keep track of last set of flags used to generate rep
self.lastFlags = None
Expand Down
40 changes: 20 additions & 20 deletions proteus/TriangleUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def writeOutTriangulation(tri,filebase="mesh",nbase=0,verbose=0):
"""
failed = False
if tri == None:
if tri is None:
failed = True
return failed
if not nbase in [0,1]:
Expand Down Expand Up @@ -89,7 +89,7 @@ def printNodeFile(nodes,filebase='mesh',attrib=None,markers=None,nbase=0):
Remaining lines: <vertex #> <x> <y> [attributes] [boundary marker]
"""
failed = False
if nodes == None: #ok to do nothing of nodes is empy
if nodes is None: #ok to do nothing of nodes is empy
return failed
#end empty areas check
if not nbase in [0,1]:
Expand All @@ -109,11 +109,11 @@ def printNodeFile(nodes,filebase='mesh',attrib=None,markers=None,nbase=0):
nvert = nodes.shape[0]
sdim = 2
nattrib = 0
if attrib != None:
if attrib is not None:
nattrib = attrib.shape[1]
#end if
nmarkers= 0
if markers != None:
if markers is not None:
nmarkers = 1
#end if
line = """%d %d %d %d \n""" % (nvert,sdim,nattrib,nmarkers)
Expand Down Expand Up @@ -143,7 +143,7 @@ def printElemFile(elems,filebase='mesh',attrib=None,nbase=0):
Remaining lines: <triangle #> <node> <node> <node> ... [attributes]
"""
failed = False
if elems == None: #ok to do nothing of nodes is empy
if elems is None: #ok to do nothing of nodes is empy
return failed
#end empty areas check
if not nbase in [0,1]:
Expand All @@ -164,7 +164,7 @@ def printElemFile(elems,filebase='mesh',attrib=None,nbase=0):
nelem = elems.shape[0]
nodesPerTri = elems.shape[1] #should be 3 or 6
nattrib = 0
if attrib != None:
if attrib is not None:
nattrib = attrib.shape[1]
#end if
line = """%d %d %d \n""" % (nelem,nodesPerTri,nattrib)
Expand Down Expand Up @@ -203,10 +203,10 @@ def printPolyFile(nodes,segments,filebase='mesh',
"""
failed = False
if nodes == None: #ok to do nothing of nodes is empy
if nodes is None: #ok to do nothing of nodes is empy
return failed
if segments == None:
if nodes == None:
if segments is None:
if nodes is None:
return failed
else:
failed = True
Expand Down Expand Up @@ -237,11 +237,11 @@ def printPolyFile(nodes,segments,filebase='mesh',
nvert = nodes.shape[0]
sdim = 2
npattrib= 0
if pattrib != None:
if pattrib is not None:
npattrib = pattrib.shape[1]
#end if
npmarkers= 0
if pmarkers != None:
if pmarkers is not None:
npmarkers = 1
#end if
#write points out
Expand All @@ -261,7 +261,7 @@ def printPolyFile(nodes,segments,filebase='mesh',
#write segments out
nsegments = segments.shape[0]
nsmarkers = 0
if smarkers != None:
if smarkers is not None:
nsmarkers = 1
line = """%d %d \n""" % (nsegments,nsmarkers)
fout.write(line)
Expand All @@ -275,7 +275,7 @@ def printPolyFile(nodes,segments,filebase='mesh',
#end i segment loop

nholes = 0
if holes != None:
if holes is not None:
nholes = holes.shape[0]
#end if
line ="""%d\n""" % nholes
Expand All @@ -286,7 +286,7 @@ def printPolyFile(nodes,segments,filebase='mesh',
fout.write(line)
#end i for holes
nregions = 0
if regions != None:
if regions is not None:
nregions = regions.shape[0]
#end if
line = "#no regions specified"
Expand Down Expand Up @@ -317,7 +317,7 @@ def printAreaFile(elemAreas,filebase='mesh',nbase=0):
note, negative area means that the area is unconstrained
"""
failed = False
if elemAreas == None: #ok to do nothing if elemAreas is empty
if elemAreas is None: #ok to do nothing if elemAreas is empty
return failed
#end elemAreas empty
if not nbase in [0,1]:
Expand Down Expand Up @@ -357,7 +357,7 @@ def printEdgeFile(edges,filebase='mesh',markers=None,nbase=0):
Following lines: <edge #> <endpoint> <endpoint> [boundary marker]
"""
failed = False
if edges == None: #ok to do nothing if elemAreas is empty
if edges is None: #ok to do nothing if elemAreas is empty
return failed
#end empty arrays check

Expand All @@ -377,7 +377,7 @@ def printEdgeFile(edges,filebase='mesh',markers=None,nbase=0):
fout.write(format)
nedges = edges.shape[0]
nmarkers = 0
if markers != None:
if markers is not None:
nmarkers = 1
#end if
line = """%d %d \n""" % (nedges,nmarkers)
Expand All @@ -404,7 +404,7 @@ def printNeighborFile(neigs,filebase='mesh',nbase=0):
Following lines: <triangle #> <neighbor> <neighbor> <neighbor>
"""
failed = False
if neigs == None: #ok to do nothing if elemAreas is empty
if neigs is None: #ok to do nothing if elemAreas is empty
return failed
#end
if not nbase in [0,1]:
Expand Down Expand Up @@ -791,12 +791,12 @@ def readPoly(self,filebase,commchar='#',nbase=0,verbose=0):
#end
outputData['hole'] = {}
outputData['hole']['holes'] = None
if not holeData == None:
if not holeData is None:
outputData['hole']['holes'] = holeData[0]

outputData['region'] = {}
outputData['region']['regions'] = None
if not regionData == None:
if not regionData is None:
outputData['region']['regions'] = regionData[0]

return outputInfo,outputData
Expand Down

0 comments on commit 3d0db58

Please sign in to comment.