From d2d83df32bba3bff38e01974feb6d30a04523c31 Mon Sep 17 00:00:00 2001 From: xhlulu Date: Fri, 29 Jan 2021 14:52:58 -0500 Subject: [PATCH] Add random seed to ensure reproducibility --- demos/pyvista-terrain-following-mesh/app.py | 2 ++ demos/slice-rendering/app.py | 2 ++ demos/synthetic-volume-rendering/app.py | 2 ++ demos/usage-algorithm/app.py | 2 ++ demos/usage-vtk-cfd/app.py | 2 ++ 5 files changed, 10 insertions(+) diff --git a/demos/pyvista-terrain-following-mesh/app.py b/demos/pyvista-terrain-following-mesh/app.py index 5810c4f..f55e804 100644 --- a/demos/pyvista-terrain-following-mesh/app.py +++ b/demos/pyvista-terrain-following-mesh/app.py @@ -13,6 +13,8 @@ from dash_vtk.utils import presets +random.seed(42) + def toDropOption(name): return {"label": name, "value": name} diff --git a/demos/slice-rendering/app.py b/demos/slice-rendering/app.py index c2e2c4f..d1c8bf3 100644 --- a/demos/slice-rendering/app.py +++ b/demos/slice-rendering/app.py @@ -12,6 +12,8 @@ import vtk +random.seed(42) + # Data file path demo_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) head_vti = os.path.join(demo_dir, "data", "head.vti") diff --git a/demos/synthetic-volume-rendering/app.py b/demos/synthetic-volume-rendering/app.py index 9594480..ae398a2 100644 --- a/demos/synthetic-volume-rendering/app.py +++ b/demos/synthetic-volume-rendering/app.py @@ -4,6 +4,8 @@ import dash_vtk import dash_html_components as html +random.seed(42) + app = dash.Dash(__name__) server = app.server diff --git a/demos/usage-algorithm/app.py b/demos/usage-algorithm/app.py index 87fe15d..2b08179 100644 --- a/demos/usage-algorithm/app.py +++ b/demos/usage-algorithm/app.py @@ -7,6 +7,8 @@ import dash_core_components as dcc from dash.dependencies import Input, Output, State +random.seed(42) + app = dash.Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP]) server = app.server diff --git a/demos/usage-vtk-cfd/app.py b/demos/usage-vtk-cfd/app.py index 8c7dca2..4299396 100644 --- a/demos/usage-vtk-cfd/app.py +++ b/demos/usage-vtk-cfd/app.py @@ -14,6 +14,8 @@ import vtk +random.seed(42) + # ----------------------------------------------------------------------------- # VTK Pipeline # -----------------------------------------------------------------------------