langevin 2025.11.8a2__cp314-cp314-macosx_14_0_arm64.whl → 2025.11.10a3__cp314-cp314-macosx_14_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
langevin/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
- __version__ = "2025.11.8a2"
1
+ __version__ = "2025.11.10a3"
2
2
 
3
3
  __all__ = []
langevin/base/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "2025.11.8a2"
1
+ __version__ = "2025.11.10a3"
2
2
 
3
3
  __all__ = [
4
4
  "file",
Binary file
langevin/dp/simulation.py CHANGED
@@ -10,8 +10,14 @@ from datetime import datetime, timedelta
10
10
  from numpy.typing import NDArray
11
11
  import numpy as np
12
12
  from numpy.lib.npyio import NpzFile
13
+ try:
14
+ import ffmpeg
15
+ except:
16
+ # Quietly fail
17
+ pass
13
18
  import sys, os
14
- sys.path.insert(0, os.path.join(os.path.pardir, "Packages"))
19
+ from os.path import join, pardir
20
+ sys.path.insert(0, join(pardir, "Packages"))
15
21
  from langevin.base.file import (
16
22
  create_directories, export_info, export_plots,
17
23
  )
@@ -199,12 +205,12 @@ class Simulation:
199
205
  do_verbose: report how the exporting is going
200
206
  """
201
207
  if self.do_verbose | do_verbose:
202
- print(f"Outfo/graph/data path: {self.misc["path"]}")
208
+ print(f"Outfo/graphs/videos/data path: {self.misc["path"]}")
203
209
  seed_dir_name: str = f"rs{self.parameters["random_seed"]}"
204
210
 
205
211
  outfo_path: str = \
206
212
  create_directories(
207
- (os.path.pardir, *self.misc["path"]), seed_dir_name,
213
+ (pardir, *self.misc["path"]), seed_dir_name,
208
214
  )
209
215
  outfo: dict = {
210
216
  "Parameters" : self.parameters,
@@ -214,30 +220,56 @@ class Simulation:
214
220
  if not do_dummy:
215
221
  _ = export_info(outfo_path, "Outfo", outfo, module,)
216
222
 
217
- if self.misc["do_export_graphs"]:
218
- graphs_path: str = \
219
- create_directories(
220
- (os.path.pardir, *self.misc["path"], seed_dir_name,), ".",
221
- )
222
- if not do_dummy:
223
- _ = export_plots(
224
- self.graphs.fdict,
225
- graphs_path,
226
- do_verbose=self.do_verbose,
227
- )
228
-
229
223
  if self.misc["do_export_data"]:
230
224
  data_path: str = \
231
225
  create_directories(
232
- (os.path.pardir, *self.misc["path"], seed_dir_name,), ".",
226
+ (pardir, *self.misc["path"], seed_dir_name,), ".",
233
227
  )
234
228
  if not do_dummy:
235
229
  np.savez_compressed(
236
- os.path.join(data_path, "ρ_t",),
230
+ join(data_path, "ρ_t",),
237
231
  t_epochs=self.t_epochs,
238
232
  mean_densities=self.mean_densities,
239
233
  )
240
234
  data_npz: NpzFile = np.load(
241
- os.path.join(data_path, "ρ_t"+".npz",),
235
+ join(data_path, "ρ_t"+".npz",),
242
236
  )
243
237
  data_npz["t_epochs"][-10:], data_npz["mean_densities"][-10:]
238
+
239
+ if self.misc["do_export_graphs"]:
240
+ graphs_path: str = \
241
+ create_directories(
242
+ (pardir, *self.misc["path"], seed_dir_name,), ".",
243
+ )
244
+ if not do_dummy:
245
+ _ = export_plots(
246
+ self.graphs.fdict,
247
+ graphs_path,
248
+ do_verbose=self.do_verbose,
249
+ )
250
+
251
+ if self.misc["do_make_video"]:
252
+ print("Video export not working yet")
253
+ # videos_path: str = create_directories(
254
+ # (pardir, pardir, "experiments", sim_dir_name,), "Videos",
255
+ # )
256
+
257
+ # video_frame_rate: int = misc["video_frame_rate"]
258
+ # video_format: str = misc["video_format"]
259
+ # video_images_wildcard: str = "ρ_t"+"?"*n_digits+".png"
260
+ # input = ffmpeg.input(
261
+ # join(images_path, video_images_wildcard),
262
+ # pattern_type="glob",
263
+ # framerate=video_frame_rate,
264
+ # pix_fmt="yuv420p",
265
+ # )
266
+ # output = ffmpeg.output(
267
+ # input.video,
268
+ # join(
269
+ # videos_path,
270
+ # f"ρ_{sim_dir_name}_rs{parameters["random_seed"]}.{video_format}"
271
+ # ),
272
+ # vf="crop=floor(iw/2)*2:floor(ih/2)*2",
273
+ # vcodec="libx264",
274
+ # format=video_format,
275
+ # )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langevin
3
- Version: 2025.11.8a2
3
+ Version: 2025.11.10a3
4
4
  Summary: Tools to integrate Langevin equations of absorbing phase transition type
5
5
  Keywords: Langevin equation,directed percolation,operator splitting,stochastic differential equations,phase transition
6
6
  Author-Email: "Colin P. Stark" <cstarkjp@gmail.com>
@@ -31,8 +31,11 @@ Description-Content-Type: text/markdown
31
31
 
32
32
  Tools to integrate Langevin equations of absorbing phase transition (APT) type — with a focus on simulation of directed percolation (DP).
33
33
 
34
- ![](https://raw.githubusercontent.com/cstarkjp/Langevin/main/images/density_grid.png
35
- "Density grid")
34
+ ![](https://raw.githubusercontent.com/cstarkjp/Langevin/main/images/ρ_a1p18950_b1_D0p04_η1_x100_y50_Δx1_Δt0p1_rs1.gif
35
+ "Density field evolution over time")
36
+
37
+ <!-- ![](https://raw.githubusercontent.com/cstarkjp/Langevin/main/images/density_grid.png
38
+ "Density grid") -->
36
39
 
37
40
  The `langevin` package implements the operator-splitting method originally developed by Dornic et al (2005), Pechenik & Levine (1999) and others, and improved upon by Weissmann et al (2018).
38
41
  It provides a Python wrapper around core C++ heavily adapted from a code base written by [Paula Villa Martín](https://github.com/pvillamartin), extended by [Victor Buendía](https://github.com/VictorSeven) ("VMB"), and arising from earlier efforts by Ivan Dornic and Juan Bonachela. The wrapper provides easy access to the Langevin integrator, and broad opportunity to experiment, adapt, and extend it further.
@@ -1,8 +1,8 @@
1
- langevin-2025.11.8a2.dist-info/METADATA,sha256=zCmvObgPjM2ly7pCBZT5yRpIo9lkXFOMz3HLkymmUEE,10737
2
- langevin-2025.11.8a2.dist-info/WHEEL,sha256=2WELbI4DqHl1bnndfO7vTz5YnWqTyWkPR2epmRKfq6I,93
3
- langevin/dp/dplvn.cpython-314-darwin.so,sha256=r5Rke_bxu8iR4vn7USma-15d7tCuLjnzkIJ2tH6Nz0M,602552
4
- langevin/__init__.py,sha256=rSUnSFpUkpd-wJcGtQoXPOtmUrktCpFw1TIqFgtRP-E,41
5
- langevin/base/__init__.py,sha256=2VujHvnTfKgo_mdZS_2h07rkn0lB9Si0BKoq7mGhK5k,113
1
+ langevin-2025.11.10a3.dist-info/METADATA,sha256=32sNnoo58kfK3RT2rrfsecJ-1pXv44McyLhtDt-RyZ8,10909
2
+ langevin-2025.11.10a3.dist-info/WHEEL,sha256=2WELbI4DqHl1bnndfO7vTz5YnWqTyWkPR2epmRKfq6I,93
3
+ langevin/dp/dplvn.cpython-314-darwin.so,sha256=LD07o-cRbOQ03rzNkj21qP6ViudyHbfpkKUlmEplS28,602584
4
+ langevin/__init__.py,sha256=WoLN8adDEd6ya-WOkhELYDBgzgPHaO0pg6PTzajux80,42
5
+ langevin/base/__init__.py,sha256=Crse0vlDi722sOZiW3CaMinKNLl0wCgYVeaqDGwHMew,114
6
6
  langevin/base/file.py,sha256=pvdPSXlRy2u05L8sR5zWUlrUI8Any_OpUO-PXPtUwSc,7380
7
7
  langevin/base/initialize.py,sha256=1y-yRyFLC2U-1qriOxMWycjfLUrPmzZxNgJp8mgEk_8,3017
8
8
  langevin/base/serialize.py,sha256=ArW2O-OVtOhVfwRKWl2Wh_3XvWgdqbkXC2NHINafMQw,5313
@@ -10,6 +10,6 @@ langevin/base/utils.py,sha256=isNapp1JdGhE8jJ1bBvGYRo4-cq6qFwcsthk2PvBMNQ,6786
10
10
  langevin/base/viz.py,sha256=JAEaxsMz7a-ob69EpFJLBFkeMzDM_d3ZKnpaabH-WWo,6350
11
11
  langevin/dp/__init__.py,sha256=IVrwOm-19xhtvmLhXazGEh2EGd5ri2BzaLEchKbhRBw,139
12
12
  langevin/dp/ensemble.py,sha256=HAUa3j-cUk-xsj1Gn7v3ENw-aX5ObBwde6tWaJ4rdI0,9279
13
- langevin/dp/simulation.py,sha256=JCrx341twQZe73sgWHHpGZYP13-I8d1BGJx2rHdJI2s,8601
13
+ langevin/dp/simulation.py,sha256=PjIH4tijWweuj6p5p5hcuAPomCJteJcp9wW62BJcUWo,9692
14
14
  langevin/dp/vizdp.py,sha256=8SPw7ZCs6l7SeUZp0GutgPAF-QjTr8fr3EOSAR07_94,12447
15
- langevin-2025.11.8a2.dist-info/RECORD,,
15
+ langevin-2025.11.10a3.dist-info/RECORD,,