zoomy-core 0.1.6__tar.gz → 0.1.11__tar.gz

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.

Potentially problematic release.


This version of zoomy-core might be problematic. Click here for more details.

Files changed (57) hide show
  1. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/PKG-INFO +6 -6
  2. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/mesh/mesh.py +0 -2
  3. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/misc/io.py +2 -1
  4. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/misc/misc.py +0 -3
  5. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core.egg-info/PKG-INFO +6 -6
  6. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core.egg-info/SOURCES.txt +0 -1
  7. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core.egg-info/requires.txt +5 -6
  8. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/pyproject.toml +6 -7
  9. zoomy_core-0.1.6/library/zoomy_core/misc/static_class.py +0 -96
  10. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/LICENSE +0 -0
  11. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/README.md +0 -0
  12. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/__init__.py +0 -0
  13. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/decorators/decorators.py +0 -0
  14. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/fvm/flux.py +0 -0
  15. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/fvm/nonconservative_flux.py +0 -0
  16. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/fvm/ode.py +0 -0
  17. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/fvm/solver_numpy.py +0 -0
  18. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/fvm/timestepping.py +0 -0
  19. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/mesh/mesh_extrude.py +0 -0
  20. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/mesh/mesh_util.py +0 -0
  21. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/misc/custom_types.py +0 -0
  22. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/misc/interpolation.py +0 -0
  23. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/misc/logger_config.py +0 -0
  24. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/model/analysis.py +0 -0
  25. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/model/basefunction.py +0 -0
  26. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/model/basemodel.py +0 -0
  27. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/model/boundary_conditions.py +0 -0
  28. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/model/initial_conditions.py +0 -0
  29. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/model/model.py +0 -0
  30. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/model/models/GN.py +0 -0
  31. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/model/models/advection.py +0 -0
  32. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/model/models/basisfunctions.py +0 -0
  33. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/model/models/basismatrices.py +0 -0
  34. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/model/models/core.py +0 -0
  35. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/model/models/coupled_constrained.py +0 -0
  36. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/model/models/poisson.py +0 -0
  37. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/model/models/shallow_moments.py +0 -0
  38. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/model/models/shallow_moments_sediment.py +0 -0
  39. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/model/models/shallow_moments_topo.py +0 -0
  40. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/model/models/shallow_moments_variants.py +0 -0
  41. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/model/models/shallow_water.py +0 -0
  42. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/model/models/shallow_water_topo.py +0 -0
  43. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/model/models/shear_shallow_flow.py +0 -0
  44. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/model/models/sme_turbulent.py +0 -0
  45. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/model/models/vam.py +0 -0
  46. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/postprocessing/postprocessing.py +0 -0
  47. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/preprocessing/openfoam_moments.py +0 -0
  48. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/transformation/helpers.py +0 -0
  49. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/transformation/to_amrex.py +0 -0
  50. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/transformation/to_c.py +0 -0
  51. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/transformation/to_jax.py +0 -0
  52. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/transformation/to_numpy.py +0 -0
  53. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/transformation/to_openfoam.py +0 -0
  54. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core/transformation/to_ufl.py +0 -0
  55. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core.egg-info/dependency_links.txt +0 -0
  56. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/library/zoomy_core.egg-info/top_level.txt +0 -0
  57. {zoomy_core-0.1.6 → zoomy_core-0.1.11}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zoomy_core
3
- Version: 0.1.6
3
+ Version: 0.1.11
4
4
  Summary: A simulation software for dimensionally-reduced free surface flows.
5
5
  Author-email: Ingo Steldermann <steldermann@mbd.rwth-aachen.de>
6
6
  License: GNU
@@ -17,18 +17,20 @@ Requires-Python: >=3.9
17
17
  Description-Content-Type: text/markdown
18
18
  License-File: LICENSE
19
19
  Requires-Dist: attrs
20
- Requires-Dist: sympy>=1.13.3
20
+ Requires-Dist: sympy>=1.14
21
21
  Requires-Dist: numpy
22
22
  Requires-Dist: scipy
23
23
  Requires-Dist: loguru
24
+ Requires-Dist: h5py
25
+ Requires-Dist: matplotlib
26
+ Requires-Dist: meshio
27
+ Requires-Dist: pytest
24
28
  Provides-Extra: gui
25
29
  Requires-Dist: pyvista; extra == "gui"
26
30
  Requires-Dist: trame; extra == "gui"
27
31
  Requires-Dist: trame-vtk; extra == "gui"
28
32
  Requires-Dist: trame-vuetify; extra == "gui"
29
33
  Requires-Dist: panel; extra == "gui"
30
- Provides-Extra: hdf5
31
- Requires-Dist: h5py; extra == "hdf5"
32
34
  Provides-Extra: coupling
33
35
  Requires-Dist: precice; extra == "coupling"
34
36
  Provides-Extra: testing
@@ -37,12 +39,10 @@ Requires-Dist: pyswashes; extra == "testing"
37
39
  Provides-Extra: mesh
38
40
  Requires-Dist: gmsh; extra == "mesh"
39
41
  Requires-Dist: python-gmsh; extra == "mesh"
40
- Requires-Dist: meshio; extra == "mesh"
41
42
  Requires-Dist: rasterio; extra == "mesh"
42
43
  Provides-Extra: dev
43
44
  Requires-Dist: watchfiles; extra == "dev"
44
45
  Requires-Dist: Cython; extra == "dev"
45
- Requires-Dist: pytest; extra == "dev"
46
46
  Requires-Dist: pytest-html; extra == "dev"
47
47
  Dynamic: license-file
48
48
 
@@ -33,7 +33,6 @@ import zoomy_core.mesh.mesh_extrude as extrude
33
33
  import zoomy_core.mesh.mesh_util as mesh_util
34
34
  from zoomy_core.mesh.mesh_util import compute_subvolume, get_extruded_mesh_type
35
35
  from zoomy_core.misc.custom_types import CArray, FArray, IArray
36
- from zoomy_core.misc.static_class import register_static_pytree
37
36
  from zoomy_core.model.boundary_conditions import Periodic
38
37
 
39
38
  # petsc4py.init(sys.argv)
@@ -364,7 +363,6 @@ def _fill_neighborhood(dm, neighbors, max_neighbors, cStart=0):
364
363
  return _fill_neighborhood(dm, neighbors, max_neighbors, cStart=cStart)
365
364
 
366
365
 
367
- @register_static_pytree
368
366
  @define(slots=True, frozen=True)
369
367
  class Mesh:
370
368
  dimension: int
@@ -370,7 +370,8 @@ def generate_vtk(
370
370
  filename="out",
371
371
  warp=False,
372
372
  ):
373
- main_dir = os.getenv("ZOOMY_DIR")
373
+ # main_dir = os.getenv("ZOOMY_DIR")
374
+ main_dir = ""
374
375
  abs_filepath = os.path.join(main_dir, filepath)
375
376
  path = os.path.dirname(abs_filepath)
376
377
  full_filepath_out = os.path.join(path, filename)
@@ -12,7 +12,6 @@ from sympy import MatrixSymbol
12
12
  from sympy import MutableDenseNDimArray as ZArray
13
13
 
14
14
  from zoomy_core.misc.custom_types import FArray
15
- from zoomy_core.misc.static_class import register_static_pytree
16
15
  from zoomy_core.misc.logger_config import logger
17
16
 
18
17
 
@@ -20,7 +19,6 @@ from zoomy_core.misc.logger_config import logger
20
19
 
21
20
 
22
21
 
23
- @register_static_pytree
24
22
  @define(slots=True, frozen=False, kw_only=True)
25
23
  class Zstruct(SimpleNamespace):
26
24
  def __init__(self, **kwargs):
@@ -118,7 +116,6 @@ class Zstruct(SimpleNamespace):
118
116
  return cls(**d)
119
117
 
120
118
 
121
- @register_static_pytree
122
119
  @define(slots=True, frozen=False, kw_only=True)
123
120
  class Settings(Zstruct):
124
121
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zoomy_core
3
- Version: 0.1.6
3
+ Version: 0.1.11
4
4
  Summary: A simulation software for dimensionally-reduced free surface flows.
5
5
  Author-email: Ingo Steldermann <steldermann@mbd.rwth-aachen.de>
6
6
  License: GNU
@@ -17,18 +17,20 @@ Requires-Python: >=3.9
17
17
  Description-Content-Type: text/markdown
18
18
  License-File: LICENSE
19
19
  Requires-Dist: attrs
20
- Requires-Dist: sympy>=1.13.3
20
+ Requires-Dist: sympy>=1.14
21
21
  Requires-Dist: numpy
22
22
  Requires-Dist: scipy
23
23
  Requires-Dist: loguru
24
+ Requires-Dist: h5py
25
+ Requires-Dist: matplotlib
26
+ Requires-Dist: meshio
27
+ Requires-Dist: pytest
24
28
  Provides-Extra: gui
25
29
  Requires-Dist: pyvista; extra == "gui"
26
30
  Requires-Dist: trame; extra == "gui"
27
31
  Requires-Dist: trame-vtk; extra == "gui"
28
32
  Requires-Dist: trame-vuetify; extra == "gui"
29
33
  Requires-Dist: panel; extra == "gui"
30
- Provides-Extra: hdf5
31
- Requires-Dist: h5py; extra == "hdf5"
32
34
  Provides-Extra: coupling
33
35
  Requires-Dist: precice; extra == "coupling"
34
36
  Provides-Extra: testing
@@ -37,12 +39,10 @@ Requires-Dist: pyswashes; extra == "testing"
37
39
  Provides-Extra: mesh
38
40
  Requires-Dist: gmsh; extra == "mesh"
39
41
  Requires-Dist: python-gmsh; extra == "mesh"
40
- Requires-Dist: meshio; extra == "mesh"
41
42
  Requires-Dist: rasterio; extra == "mesh"
42
43
  Provides-Extra: dev
43
44
  Requires-Dist: watchfiles; extra == "dev"
44
45
  Requires-Dist: Cython; extra == "dev"
45
- Requires-Dist: pytest; extra == "dev"
46
46
  Requires-Dist: pytest-html; extra == "dev"
47
47
  Dynamic: license-file
48
48
 
@@ -21,7 +21,6 @@ library/zoomy_core/misc/interpolation.py
21
21
  library/zoomy_core/misc/io.py
22
22
  library/zoomy_core/misc/logger_config.py
23
23
  library/zoomy_core/misc/misc.py
24
- library/zoomy_core/misc/static_class.py
25
24
  library/zoomy_core/model/analysis.py
26
25
  library/zoomy_core/model/basefunction.py
27
26
  library/zoomy_core/model/basemodel.py
@@ -1,8 +1,12 @@
1
1
  attrs
2
- sympy>=1.13.3
2
+ sympy>=1.14
3
3
  numpy
4
4
  scipy
5
5
  loguru
6
+ h5py
7
+ matplotlib
8
+ meshio
9
+ pytest
6
10
 
7
11
  [coupling]
8
12
  precice
@@ -10,7 +14,6 @@ precice
10
14
  [dev]
11
15
  watchfiles
12
16
  Cython
13
- pytest
14
17
  pytest-html
15
18
 
16
19
  [gui]
@@ -20,13 +23,9 @@ trame-vtk
20
23
  trame-vuetify
21
24
  panel
22
25
 
23
- [hdf5]
24
- h5py
25
-
26
26
  [mesh]
27
27
  gmsh
28
28
  python-gmsh
29
- meshio
30
29
  rasterio
31
30
 
32
31
  [testing]
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
 
6
6
  [project]
7
7
  name = "zoomy_core"
8
- version = "0.1.6"
8
+ version = "0.1.11"
9
9
  description = "A simulation software for dimensionally-reduced free surface flows."
10
10
  readme = "README.md"
11
11
  requires-python = ">=3.9"
@@ -23,10 +23,14 @@ classifiers = [
23
23
 
24
24
  dependencies = [
25
25
  "attrs",
26
- "sympy>=1.13.3",
26
+ "sympy>=1.14",
27
27
  "numpy",
28
28
  "scipy",
29
29
  "loguru",
30
+ "h5py",
31
+ "matplotlib",
32
+ "meshio",
33
+ "pytest",
30
34
  ]
31
35
 
32
36
 
@@ -38,9 +42,6 @@ gui = [
38
42
  "trame-vuetify",
39
43
  "panel",
40
44
  ]
41
- hdf5 = [
42
- "h5py",
43
- ]
44
45
  coupling = [
45
46
  "precice",
46
47
  ]
@@ -51,13 +52,11 @@ testing = [
51
52
  mesh = [
52
53
  "gmsh",
53
54
  "python-gmsh",
54
- "meshio",
55
55
  "rasterio"
56
56
  ]
57
57
  dev = [
58
58
  "watchfiles",
59
59
  "Cython",
60
- "pytest",
61
60
  "pytest-html"
62
61
  ]
63
62
 
@@ -1,96 +0,0 @@
1
- import attrs
2
- from functools import partial
3
- from typing import Any, Tuple, Type
4
- import attr
5
-
6
- try:
7
- import jax
8
- import jax.numpy as jnp
9
-
10
- _HAVE_JAX = True
11
- except ImportError:
12
- import numpy as jnp
13
-
14
- _HAVE_JAX = False
15
-
16
-
17
- def register_static_pytree(cls: Type[Any]) -> Type[Any]:
18
- """
19
- Class decorator that registers the class as a JAX pytree node,
20
- treating all member variables as static.
21
-
22
- Parameters:
23
- cls (Type[Any]): The class to register.
24
-
25
- Returns:
26
- Type[Any]: The registered class.
27
- """
28
- if not _HAVE_JAX:
29
- # no-op decorator
30
- return cls
31
- if not attrs.has(cls):
32
- raise TypeError(
33
- "register_static_pytree can only be applied to classes decorated with @attrs.define or @attr.s"
34
- )
35
-
36
- # Extract field names from attrs
37
- field_names = [field.name for field in attrs.fields(cls)]
38
-
39
- # Define the flatten function
40
- def flatten(instance: Any) -> Tuple[Tuple, Tuple]:
41
- aux_data = tuple(getattr(instance, name) for name in field_names)
42
- children = () # No dynamic children since all are static
43
- return children, aux_data
44
-
45
- # Define the unflatten function
46
- def unflatten(aux_data: Tuple, children: Tuple) -> Any:
47
- return cls(*aux_data)
48
-
49
- # Register the class as a pytree node with JAX
50
- jax.tree_util.register_pytree_node(cls, flatten, unflatten)
51
-
52
- return cls
53
-
54
-
55
- # 2. Define the Mesh class using attrs and the decorator
56
- @register_static_pytree
57
- @attrs.define(frozen=True)
58
- class Mesh:
59
- x: jnp.ndarray
60
- y: jnp.ndarray
61
- # Use factory for mutable default fields
62
- z: jnp.ndarray = attr.field(factory=lambda: jnp.array([0.0]))
63
- # Example additional fields
64
- w: jnp.ndarray = attr.field(factory=lambda: jnp.array([[1.0, 2.0], [3.0, 4.0]]))
65
- description: str = "Default Mesh Description"
66
-
67
-
68
- # 3. Define the SpaceOperator class with JAX's jit
69
- class SpaceOperator:
70
- @partial(jax.jit, static_argnums=(0,)) # Marks 'self' as static
71
- def solve(self, q: jnp.ndarray, mesh: Mesh) -> jnp.ndarray:
72
- """
73
- Example operation: Element-wise multiplication of mesh.x with q,
74
- then add mesh.y for demonstration.
75
- """
76
- return mesh.x * q + mesh.y
77
-
78
-
79
- if __name__ == "__main__":
80
- # Create mesh data using JAX arrays
81
- x = jnp.linspace(0, 1, 10)
82
- y = jnp.linspace(1, 2, 10)
83
- # Initialize Mesh with x and y; z and w use default_factory
84
- mesh = Mesh(x, y)
85
-
86
- # Initialize the operator
87
- space_op = SpaceOperator()
88
-
89
- # Define the input Q as a JAX array
90
- Q = jnp.linspace(0, 1, 10)
91
-
92
- # Use the solve method
93
- Q_result = space_op.solve(Q, mesh)
94
-
95
- # Print the result
96
- print("Q_result:", Q_result)
File without changes
File without changes
File without changes