Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v.view(interactive=True) causes kernel to die on BinderHub #2

Open
matthewfeickert opened this issue Oct 9, 2023 · 1 comment
Open

Comments

@matthewfeickert
Copy link
Contributor

@stewartboogert a note for the future, probably too late to revise it today, is that the cell in the notebook that contains

import numpy as _np
reg = _g4.Registry()
reg.clear()

worldSize = _gdml.Constant("boxSize", 200, reg)
boxSize = worldSize/20

# materials 
worldMaterial = _g4.nist_material_2geant4Material("G4_Galactic", reg)
boxMaterial   = _g4.nist_material_2geant4Material("G4_Au", reg)

# solids 
worldSolid = _g4.solid.Box("ws", worldSize, worldSize, worldSize, reg, "mm")
boxSolid = _g4.solid.Box("bs", boxSize, boxSize, boxSize, reg, "mm")

ringRadius = _gdml.Constant("ringSize", 50, reg)

# structure
worldLogical = _g4.LogicalVolume(worldSolid, worldMaterial, "worldLogical", reg)
boxLogical   = _g4.LogicalVolume(boxSolid, boxMaterial, "boxlogical", reg)

for i in range(0,20,1) :
    ic = _gdml.Constant("i_"+str(i),i/20,reg)
    phi = 2*_np.pi*ic
    x = ringRadius*_gdml.cos(phi)
    y = ringRadius*_gdml.sin(phi)
    
    boxPhysical  = _g4.PhysicalVolume([0, 0, -phi], [x, y, 0], boxLogical, "boxPhysical_"+str(i), worldLogical, reg)

# visualise
reg.setWorld(worldLogical.name)
v = _vi.VtkViewerNew()
v.addLogicalVolume(reg.getWorldVolume())
v.buildPipelinesAppend()
v.view(interactive=True)

causes the kernel to die when

v.view(interactive=True)

is executed.

That might be an issue with visualisation libraries getting loaded though.

@stewartboogert
Copy link
Member

I thought I commented all the view lines out. I'll check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants