-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix visualisation crashes in notebooks #21
Labels
bug
Something isn't working
Comments
To Reproduce import chaste
from chaste.cell_based import (
CellsGeneratorNoCellCycleModel_2,
ConstantTargetAreaModifier2,
DifferentiatedCellProliferativeType,
FarhadifarForce2,
OffLatticeSimulation2_2,
SetupNotebookTest,
VertexBasedCellPopulation2
)
from chaste.core import RandomNumberGenerator
from chaste.mesh import VoronoiVertexMeshGenerator
from chaste.visualization import JupyterNotebookManager, VtkScene2
chaste.init()
SetupNotebookTest() RandomNumberGenerator.Instance().Reseed(1)
generator = chaste.mesh.VoronoiVertexMeshGenerator(6, 6, 1)
mesh = generator.GetMesh()
mesh.SetDistanceForT3SwapChecking(1.0)
cell_type = DifferentiatedCellProliferativeType()
cell_generator = CellsGeneratorNoCellCycleModel_2()
cells = cell_generator.GenerateBasicRandom(mesh.GetNumElements(), cell_type)
cell_population = VertexBasedCellPopulation2(mesh, cells)
cell_population.AddCellWriterCellVolumesWriter() scene = VtkScene2()
scene.SetCellPopulation(cell_population)
nb_manager = JupyterNotebookManager()
nb_manager.vtk_show(scene, height=300)
simulation = OffLatticeSimulation2_2(cell_population)
output_path = "Results"
file_handler = chaste.core.OutputFileHandler(output_path)
simulation.SetOutputDirectory(output_path)
simulation.SetEndTime(100)
simulation.SetDt(0.01)
simulation.SetSamplingTimestepMultiple(10)
force = FarhadifarForce2()
force.SetAreaElasticityParameter(1.0)
force.SetPerimeterContractilityParameter(0.04)
force.SetLineTensionParameter(0.12)
force.SetBoundaryLineTensionParameter(0.12)
simulation.AddForce(force)
target_area_modifier = ConstantTargetAreaModifier2()
simulation.AddSimulationModifier(target_area_modifier)
simulation.Solve() nb_manager.vtk_show(scene, height=300)
scene = VtkScene2()
scene.SetCellPopulation(simulation.rGetCellPopulation())
nb_manager.vtk_show(scene, height=300)
scene = VtkScene2()
scene.SetCellPopulation(simulation.rGetCellPopulation())
nb_manager.vtk_show(scene, height=300)
|
Fix Reset renderer list after each call to
|
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
PyChaste visualisations crash routinely in notebooks.
To Do
The text was updated successfully, but these errors were encountered: