simulation.py¶
Simulation
¶
Simulation(
name: str | None,
path: list[str],
info: dict,
do_snapshot_grid: bool = False,
do_verbose: bool = True,
)
Class to manage a single DP Langevin field integration.
Parameters:
-
(name¶str | None) –of sim constructed from parameters etc
-
(path¶list[str]) –path to file
-
(info¶dict) –dictionary containing sim coefficients, model parameters, etc
-
(do_snapshot_grid¶bool, default:False) –flag whether to copy out final time-slice density grid into numpy array
-
(do_verbose¶bool, default:True) –flag whether to use tqdm progress bar, report from
dplvn.SimDP
-
Python modules
dp
Ensemble - Simulation tools Notebooks DPSimulation.ipynb
-
Python modules
dp
Ensemblesim_exec_wrapper
Methods:
-
exec–Carry out all simulation steps, including initialization & running.
-
initialize–Create and initialize a
dpvln.SimSPclass instance. -
plot–Plot everything
-
plot_graphs–Generate all the required graphs and images.
-
run–Execute a
dpvln.SimSPsimulation. -
run_wrapper–Wrapper around
dpvln.SimSPrun to provide timing. -
save–Export outfo JSON, graphs, and data files.
Source code in .venv/lib/python3.14/site-packages/langevin/dp/simulation.py
exec
¶
Carry out all simulation steps, including initialization & running.
Returns:
-
Sequence[tuple]–serialized versions of sim epoch times, mean grid densities, and
-
Sequence[tuple]–computation run time.
Source code in .venv/lib/python3.14/site-packages/langevin/dp/simulation.py
initialize
¶
Create and initialize a dpvln.SimSP class instance.
Source code in .venv/lib/python3.14/site-packages/langevin/dp/simulation.py
plot
¶
plot_graphs
¶
plot_graphs(do_profile: bool = False) -> None
Generate all the required graphs and images.
Source code in .venv/lib/python3.14/site-packages/langevin/dp/simulation.py
run
¶
Execute a dpvln.SimSP simulation.
Source code in .venv/lib/python3.14/site-packages/langevin/dp/simulation.py
run_wrapper
¶
run_wrapper() -> str
Wrapper around dpvln.SimSP run to provide timing.
Returns:
-
str–printable string describing computation (sim run) time
Source code in .venv/lib/python3.14/site-packages/langevin/dp/simulation.py
save
¶
Export outfo JSON, graphs, and data files.
Parameters:
-
(module¶Any) –dplvn or other class module
-
(do_dummy¶bool, default:False) –just print (possibly create) the output folders
-
(do_verbose¶bool, default:False) –report how the exporting is going
Source code in .venv/lib/python3.14/site-packages/langevin/dp/simulation.py
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | |