Coverage for /builds/kinetik161/ase/ase/visualize/paraview_script.py: 10.53%
19 statements
« prev ^ index » next coverage.py v7.2.7, created at 2023-12-10 11:04 +0000
« prev ^ index » next coverage.py v7.2.7, created at 2023-12-10 11:04 +0000
1def main():
2 import paraview.simple as para
3 version_major = para.servermanager.vtkSMProxyManager.GetVersionMajor()
4 source = para.GetActiveSource()
5 renderView1 = para.GetRenderView()
6 atoms = para.Glyph(
7 Input=source,
8 GlyphType='Sphere',
9 Scalars='radii',
10 ScaleMode='scalar',
11 )
12 para.RenameSource('Atoms', atoms)
13 atomsDisplay = para.Show(atoms, renderView1)
14 if version_major <= 4:
15 atoms.SetScaleFactor = 0.8
16 atomicnumbers_PVLookupTable = para.GetLookupTableForArray(
17 'atomic numbers', 1)
18 atomsDisplay.ColorArrayName = ('POINT_DATA', 'atomic numbers')
19 atomsDisplay.LookupTable = atomicnumbers_PVLookupTable
20 else:
21 atoms.ScaleFactor = 0.8
22 para.ColorBy(atomsDisplay, 'atomic numbers')
23 atomsDisplay.SetScalarBarVisibility(renderView1, True)
24 para.Render()
27if __name__ == '__main__':
28 main()