Skip to content

Commit 3d0db58

Browse files
committed
updated hashdist/stack, cleaned up some print statements
1 parent f014c89 commit 3d0db58

File tree

5 files changed

+27
-27
lines changed

5 files changed

+27
-27
lines changed

.hashdist_default

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
aa9456db834541baaa15eda7ff3733d78be9dba9
1+
5b01e870f578137ab7a4f100c079f7e29f5cd183
2+

.hashstack_default

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9520ae64aa78ed3441859ffa02919e15134b0951
1+
83cd9b8bfa030ddc0ba0807eca742f63620de42c

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,9 @@ jupyter:
313313
@echo "************************************"
314314
@echo "Enabling jupyter notebook/lab/widgets"
315315
source ${PROTEUS_PREFIX}/bin/proteus_env.sh
316-
pip install jupyter jupyterlab ipywidgets ipyleaflet jupyter_dashboards pythreejs RISE cesiumpy bqplot mayavi
316+
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
317317
jupyter serverextension enable --py jupyterlab --sys-prefix
318318
jupyter nbextension enable --py --sys-prefix widgetsnbextension
319-
jupyter nbextension install --py --sys-prefix mayavi
320319
jupyter nbextension enable --py --sys-prefix bqplot
321320
jupyter nbextension enable --py --sys-prefix pythreejs
322321
jupyter nbextension enable --py --sys-prefix ipyleaflet

proteus/TriangleTools.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import triangleWrappers
1212
import TriangleUtils
1313
import TriangleFileUtils
14-
14+
from Profiling import logEvent
1515

1616
class TriangleBaseMesh:
1717
"""A triangulation interface wrapper.
@@ -56,8 +56,8 @@ def __init__(self,baseFlags="zen",nbase=0,verbose=0):
5656
if self.baseFlags.find('v') >= 0:
5757
self.makeVoronoi = True
5858
if verbose > 0:
59-
print """TriangleBaseMesh nbase=%d baseFlags= %s """ % (self.nbase,
60-
self.baseFlags)
59+
logEvent("""TriangleBaseMesh nbase=%d baseFlags= %s """ % (self.nbase,
60+
self.baseFlags))
6161
#end if
6262
#keep track of last set of flags used to generate rep
6363
self.lastFlags = None

proteus/TriangleUtils.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def writeOutTriangulation(tri,filebase="mesh",nbase=0,verbose=0):
3232
3333
"""
3434
failed = False
35-
if tri == None:
35+
if tri is None:
3636
failed = True
3737
return failed
3838
if not nbase in [0,1]:
@@ -89,7 +89,7 @@ def printNodeFile(nodes,filebase='mesh',attrib=None,markers=None,nbase=0):
8989
Remaining lines: <vertex #> <x> <y> [attributes] [boundary marker]
9090
"""
9191
failed = False
92-
if nodes == None: #ok to do nothing of nodes is empy
92+
if nodes is None: #ok to do nothing of nodes is empy
9393
return failed
9494
#end empty areas check
9595
if not nbase in [0,1]:
@@ -109,11 +109,11 @@ def printNodeFile(nodes,filebase='mesh',attrib=None,markers=None,nbase=0):
109109
nvert = nodes.shape[0]
110110
sdim = 2
111111
nattrib = 0
112-
if attrib != None:
112+
if attrib is not None:
113113
nattrib = attrib.shape[1]
114114
#end if
115115
nmarkers= 0
116-
if markers != None:
116+
if markers is not None:
117117
nmarkers = 1
118118
#end if
119119
line = """%d %d %d %d \n""" % (nvert,sdim,nattrib,nmarkers)
@@ -143,7 +143,7 @@ def printElemFile(elems,filebase='mesh',attrib=None,nbase=0):
143143
Remaining lines: <triangle #> <node> <node> <node> ... [attributes]
144144
"""
145145
failed = False
146-
if elems == None: #ok to do nothing of nodes is empy
146+
if elems is None: #ok to do nothing of nodes is empy
147147
return failed
148148
#end empty areas check
149149
if not nbase in [0,1]:
@@ -164,7 +164,7 @@ def printElemFile(elems,filebase='mesh',attrib=None,nbase=0):
164164
nelem = elems.shape[0]
165165
nodesPerTri = elems.shape[1] #should be 3 or 6
166166
nattrib = 0
167-
if attrib != None:
167+
if attrib is not None:
168168
nattrib = attrib.shape[1]
169169
#end if
170170
line = """%d %d %d \n""" % (nelem,nodesPerTri,nattrib)
@@ -203,10 +203,10 @@ def printPolyFile(nodes,segments,filebase='mesh',
203203
204204
"""
205205
failed = False
206-
if nodes == None: #ok to do nothing of nodes is empy
206+
if nodes is None: #ok to do nothing of nodes is empy
207207
return failed
208-
if segments == None:
209-
if nodes == None:
208+
if segments is None:
209+
if nodes is None:
210210
return failed
211211
else:
212212
failed = True
@@ -237,11 +237,11 @@ def printPolyFile(nodes,segments,filebase='mesh',
237237
nvert = nodes.shape[0]
238238
sdim = 2
239239
npattrib= 0
240-
if pattrib != None:
240+
if pattrib is not None:
241241
npattrib = pattrib.shape[1]
242242
#end if
243243
npmarkers= 0
244-
if pmarkers != None:
244+
if pmarkers is not None:
245245
npmarkers = 1
246246
#end if
247247
#write points out
@@ -261,7 +261,7 @@ def printPolyFile(nodes,segments,filebase='mesh',
261261
#write segments out
262262
nsegments = segments.shape[0]
263263
nsmarkers = 0
264-
if smarkers != None:
264+
if smarkers is not None:
265265
nsmarkers = 1
266266
line = """%d %d \n""" % (nsegments,nsmarkers)
267267
fout.write(line)
@@ -275,7 +275,7 @@ def printPolyFile(nodes,segments,filebase='mesh',
275275
#end i segment loop
276276

277277
nholes = 0
278-
if holes != None:
278+
if holes is not None:
279279
nholes = holes.shape[0]
280280
#end if
281281
line ="""%d\n""" % nholes
@@ -286,7 +286,7 @@ def printPolyFile(nodes,segments,filebase='mesh',
286286
fout.write(line)
287287
#end i for holes
288288
nregions = 0
289-
if regions != None:
289+
if regions is not None:
290290
nregions = regions.shape[0]
291291
#end if
292292
line = "#no regions specified"
@@ -317,7 +317,7 @@ def printAreaFile(elemAreas,filebase='mesh',nbase=0):
317317
note, negative area means that the area is unconstrained
318318
"""
319319
failed = False
320-
if elemAreas == None: #ok to do nothing if elemAreas is empty
320+
if elemAreas is None: #ok to do nothing if elemAreas is empty
321321
return failed
322322
#end elemAreas empty
323323
if not nbase in [0,1]:
@@ -357,7 +357,7 @@ def printEdgeFile(edges,filebase='mesh',markers=None,nbase=0):
357357
Following lines: <edge #> <endpoint> <endpoint> [boundary marker]
358358
"""
359359
failed = False
360-
if edges == None: #ok to do nothing if elemAreas is empty
360+
if edges is None: #ok to do nothing if elemAreas is empty
361361
return failed
362362
#end empty arrays check
363363

@@ -377,7 +377,7 @@ def printEdgeFile(edges,filebase='mesh',markers=None,nbase=0):
377377
fout.write(format)
378378
nedges = edges.shape[0]
379379
nmarkers = 0
380-
if markers != None:
380+
if markers is not None:
381381
nmarkers = 1
382382
#end if
383383
line = """%d %d \n""" % (nedges,nmarkers)
@@ -404,7 +404,7 @@ def printNeighborFile(neigs,filebase='mesh',nbase=0):
404404
Following lines: <triangle #> <neighbor> <neighbor> <neighbor>
405405
"""
406406
failed = False
407-
if neigs == None: #ok to do nothing if elemAreas is empty
407+
if neigs is None: #ok to do nothing if elemAreas is empty
408408
return failed
409409
#end
410410
if not nbase in [0,1]:
@@ -791,12 +791,12 @@ def readPoly(self,filebase,commchar='#',nbase=0,verbose=0):
791791
#end
792792
outputData['hole'] = {}
793793
outputData['hole']['holes'] = None
794-
if not holeData == None:
794+
if not holeData is None:
795795
outputData['hole']['holes'] = holeData[0]
796796

797797
outputData['region'] = {}
798798
outputData['region']['regions'] = None
799-
if not regionData == None:
799+
if not regionData is None:
800800
outputData['region']['regions'] = regionData[0]
801801

802802
return outputInfo,outputData

0 commit comments

Comments
 (0)