33from vtkmodules .numpy_interface import dataset_adapter as dsa
44from vtkmodules .vtkCommonCore import (
55 vtkPoints ,
6- vtkIdList ,
76)
87from vtkmodules .vtkCommonDataModel import (
98 vtkPolyData ,
@@ -58,6 +57,7 @@ def ProcessPoint(point, radius):
5857 z = rho * math .cos (math .radians (phi ))
5958 return [x , y , z ]
6059
60+
6161@smproxy .filter ()
6262@smproperty .input (name = "Input" )
6363@smdomain .datatype (
@@ -412,9 +412,7 @@ def RequestData(self, request, inInfo, outInfo):
412412
413413@smproxy .filter ()
414414@smproperty .input (name = "Input" )
415- @smdomain .datatype (
416- dataTypes = ["vtkPolyData" ], composite_data_supported = False
417- )
415+ @smdomain .datatype (dataTypes = ["vtkPolyData" ], composite_data_supported = False )
418416@smproperty .xml (
419417 """
420418 <DoubleVectorProperty name="Longitude Range"
@@ -475,11 +473,10 @@ def RequestData(self, request, inInfo, outInfo):
475473 return 1
476474
477475
478-
479476@smproxy .filter ()
480477@smproperty .input (name = "Input" )
481478@smproperty .xml (
482- """
479+ """
483480 <IntVectorProperty name="Meridian"
484481 command="SetMeridian"
485482 number_of_elements="1"
@@ -502,11 +499,12 @@ def RequestData(self, request, inInfo, outInfo):
502499 dataTypes = ["vtkPolyData" , "vtkUnstructuredGrid" ], composite_data_supported = False
503500)
504501class EAMCenterMeridian (VTKPythonAlgorithmBase ):
505- ''' Cuts an unstructured grid and re-arranges the pieces such that
502+ """ Cuts an unstructured grid and re-arranges the pieces such that
506503 the specified meridian is in the middle. Note that the mesh is
507504 specified with bounds [0, 360], but the meridian is specified in the more
508505 common bounds [-180, 180].
509- '''
506+ """
507+
510508 def __init__ (self ):
511509 super ().__init__ (
512510 nInputPorts = 1 , nOutputPorts = 1 , outputType = "vtkUnstructuredGrid"
@@ -516,19 +514,23 @@ def __init__(self):
516514 self ._cached_output = None
517515
518516 def SetMeridian (self , meridian_ ):
519- '''
517+ """
520518 Specifies the central meridian (longitude in the middle of the map)
521- '''
519+ """
522520 if meridian_ < - 180 or meridian_ > 180 :
523- print_error ("SetMeridian called with parameter outside [-180, 180]: {}" .format (meridian_ ))
521+ print_error (
522+ "SetMeridian called with parameter outside [-180, 180]: {}" .format (
523+ meridian_
524+ )
525+ )
524526 return
525527 self ._center_meridian = meridian_
526528 self .Modified ()
527529
528530 def GetMeridian (self ):
529- '''
531+ """
530532 Returns the central meridian
531- '''
533+ """
532534 return self ._center_meridian
533535
534536 def RequestData (self , request , inInfo , outInfo ):
@@ -537,8 +539,11 @@ def RequestData(self, request, inInfo, outInfo):
537539 inCellArray = inData .GetCells ()
538540
539541 outData = self .GetOutputData (outInfo , 0 )
540- if self ._cached_output and self ._cached_output .GetMTime () > inPoints .GetMTime () and \
541- self ._cached_output .GetMTime () > inCellArray .GetMTime ():
542+ if (
543+ self ._cached_output
544+ and self ._cached_output .GetMTime () > inPoints .GetMTime ()
545+ and self ._cached_output .GetMTime () > inCellArray .GetMTime ()
546+ ):
542547 # only scalars have been added or removed
543548 cached_cell_data = self ._cached_output .GetCellData ()
544549
@@ -564,7 +569,9 @@ def RequestData(self, request, inInfo, outInfo):
564569 out_array .SetNumberOfTuples (array0 .GetNumberOfTuples ())
565570 out_array .SetName (in_array .GetName ())
566571 out_cell_data .AddArray (out_array )
567- outData .cell_data [out_array .GetName ()] = inData .cell_data [i ][self ._cached_output .cell_data ['PedigreeIds' ]]
572+ outData .cell_data [out_array .GetName ()] = inData .cell_data [i ][
573+ self ._cached_output .cell_data ["PedigreeIds" ]
574+ ]
568575 else :
569576 generate_ids = vtkGenerateIds ()
570577 generate_ids .SetInputData (inData )
0 commit comments