fvsparcs 0.2.0__tar.gz → 0.3.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: fvsparcs
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: A reader for the output files of the FV-SPARCS toolkit
5
5
  Author-email: Christian Huettig <christian.huettig@dlr.de>
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "fvsparcs"
7
- version = "0.2.0"
7
+ version = "0.3.0"
8
8
  authors = [
9
9
  { name="Christian Huettig", email="christian.huettig@dlr.de" },
10
10
  ]
@@ -28,9 +28,9 @@ sources = ["src"]
28
28
  # The "fvsparcs-X.Y.Z.data" prefix below must match [project] version exactly:
29
29
  # pip only installs scripts as executables when the .data dir name equals the
30
30
  # distribution name-version. Update all three targets when bumping the version.
31
- "src/fast_spiral_projected.py" = "fvsparcs-0.2.0.data/scripts/fast_spiral_projected"
32
- "src/circle.py" = "fvsparcs-0.2.0.data/scripts/circle"
33
- "src/sph_shell3.py" = "fvsparcs-0.2.0.data/scripts/sph_shell3"
31
+ "src/fast_spiral_projected.py" = "fvsparcs-0.3.0.data/scripts/fast_spiral_projected"
32
+ "src/circle.py" = "fvsparcs-0.3.0.data/scripts/circle"
33
+ "src/sph_shell3.py" = "fvsparcs-0.3.0.data/scripts/sph_shell3"
34
34
 
35
35
  [tool.hatch.build.targets.sdist]
36
36
  include = ["src"]
@@ -12,6 +12,7 @@ file runs argparse at import time.
12
12
 
13
13
  @author: CH
14
14
  """
15
+ import argparse as ap
15
16
  import numpy as np
16
17
  from gridgen import *
17
18
 
@@ -19,15 +20,33 @@ from gridgen import *
19
20
 
20
21
  shells = list() # Holding np arrays with (N_points_in_shell,3), N varies per shell
21
22
 
22
- gridfile = "test.grid"
23
-
24
- ir_ = 1.222222222 # Inner radius
25
- or_ = 2.222222222 # Outer radius
26
- ns = 10 # Number of shells
27
- res_ = 1 / ns # Predicted average resolution
28
- lat_res = 1.0 # Lateral resolution multiplier (1: isotropic, >1: finer lateral)
29
-
30
- rng = np.random.default_rng(42) # Fixed seed: reproducible shell orientations
23
+ #sys.argv=["sph_shell3", "1.222222222", "2.222222222", "10", "--out", "test.grid"]
24
+ parser = ap.ArgumentParser("sph_shell3", description="Builds a spherical shell grid where each shell is an individually generated golden-spiral point sphere, with roughly equal resolution throughout the shell. Each shell's point count scales with its radius so lateral spacing matches radial resolution.")
25
+ parser.add_argument("inner_radius", nargs="?", help="Inner radius of the shell. Default: 1.222222222", type=float, default=1.222222222)
26
+ parser.add_argument("outer_radius", nargs="?", help="Outer radius of the shell. Default: 2.222222222", type=float, default=2.222222222)
27
+ parser.add_argument("shells", nargs="?", help="Number of shells. Determines radial resolution. Thickness is always or - ir. Default: 10", type=int, default=10)
28
+ parser.add_argument("--lat_res", help="Lateral resolution multiplier (1: isotropic, >1: finer lateral). Default: 1.0", type=float, default=1.0)
29
+ parser.add_argument("--seed", help="Seed for the random rotation applied to each shell, so shells do not stack into radial columns. Default: 42", type=int, default=42)
30
+ parser.add_argument("--out", help="Filename to save the grid. Default: test.grid", type=str, default="test.grid")
31
+ args = parser.parse_args()
32
+
33
+ if args.inner_radius <= 0:
34
+ parser.error("inner_radius must be positive")
35
+ if args.outer_radius <= args.inner_radius:
36
+ parser.error("outer_radius must be greater than inner_radius")
37
+ if args.shells <= 5:
38
+ parser.error("Number of shells must be greater than 5")
39
+ if args.lat_res <= 0:
40
+ parser.error("lat_res must be positive")
41
+
42
+ gridfile = args.out
43
+ ir_ = args.inner_radius
44
+ or_ = args.outer_radius
45
+ ns = args.shells
46
+ res_ = (or_ - ir_) / ns # Predicted average resolution
47
+ lat_res = args.lat_res
48
+
49
+ rng = np.random.default_rng(args.seed) # Fixed seed: reproducible shell orientations
31
50
 
32
51
 
33
52
  def golden_spiral(num_pts, radius):
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes