PrintTolTest 0.2.1__tar.gz → 0.2.2.1__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.4
2
2
  Name: PrintTolTest
3
- Version: 0.2.1
3
+ Version: 0.2.2.1
4
4
  Summary: A simple CLI tool to calculate 3D print dimensional tolerance.
5
5
  Author: NanashiTheNameless
6
6
  Author-email: NanashiTheNameless <NanashiTheNameless@NamelessNanashi.dev>
@@ -40,15 +40,11 @@ It does have issues and is not a perfect representation of printer performance.
40
40
  Get the Latest
41
41
 
42
42
  ```sh
43
- python3 -m pip install --upgrade 'PrintTolTest @ git+https://github.com/NanashiTheNameless/PrintTolTest@main'
43
+ pipx install --force 'PrintTolTest @ git+https://github.com/NanashiTheNameless/PrintTolTest@main'
44
44
  ```
45
45
 
46
46
  Or get from [PyPi](<https://pypi.org/project/PrintTolTest/>) (not recommended, may be out of date)
47
47
 
48
- ```sh
49
- python3 -m pip install --upgrade PrintTolTest
50
- ```
51
-
52
48
  ## Get started
53
49
 
54
50
  ### Interactively
@@ -1,6 +1,7 @@
1
1
  import argparse
2
2
  from .tolerance import calculate_tolerance
3
3
 
4
+
4
5
  def prompt_for_dimensions(label):
5
6
  print(f"\nEnter {label} dimensions (in mm):")
6
7
  x = float(input(" X: "))
@@ -8,6 +9,7 @@ def prompt_for_dimensions(label):
8
9
  z = float(input(" Z: "))
9
10
  return (x, y, z)
10
11
 
12
+
11
13
  def main():
12
14
  parser = argparse.ArgumentParser(
13
15
  description="PrintTolTest - Calculate 3D print dimensional tolerance.",
@@ -21,18 +23,32 @@ Examples:
21
23
 
22
24
  All dimensions must be in millimeters (mm).
23
25
  """,
24
- formatter_class=argparse.RawDescriptionHelpFormatter
26
+ formatter_class=argparse.RawDescriptionHelpFormatter,
25
27
  )
26
28
 
27
- parser.add_argument('--expected', type=float, nargs=3, metavar=('X', 'Y', 'Z'),
28
- help='Expected dimensions in mm (e.g. --expected 20 20 20)')
29
- parser.add_argument('--measured', type=float, nargs=3, metavar=('X', 'Y', 'Z'),
30
- help='Measured dimensions in mm (e.g. --measured 19.99 19.95 20.10)')
29
+ parser.add_argument(
30
+ "--expected",
31
+ type=float,
32
+ nargs=3,
33
+ metavar=("X", "Y", "Z"),
34
+ help="Expected dimensions in mm (e.g. --expected 20 20 20)",
35
+ )
36
+ parser.add_argument(
37
+ "--measured",
38
+ type=float,
39
+ nargs=3,
40
+ metavar=("X", "Y", "Z"),
41
+ help="Measured dimensions in mm (e.g. --measured 19.99 19.95 20.10)",
42
+ )
31
43
 
32
44
  args = parser.parse_args()
33
45
 
34
- expected = args.expected if args.expected else prompt_for_dimensions("expected")
35
- measured = args.measured if args.measured else prompt_for_dimensions("measured")
46
+ expected = (
47
+ args.expected if args.expected else prompt_for_dimensions("expected")
48
+ )
49
+ measured = (
50
+ args.measured if args.measured else prompt_for_dimensions("measured")
51
+ )
36
52
 
37
53
  tolerances = calculate_tolerance(expected, measured)
38
54
 
@@ -44,11 +60,14 @@ All dimensions must be in millimeters (mm).
44
60
  print(f"Measured Y dimension (mm): {measured[1]:.2f}")
45
61
  print(f"Measured Z dimension (mm): {measured[2]:.2f}")
46
62
  print("\nTolerance Results:")
47
- for axis in ['X', 'Y', 'Z']:
48
- signed = tolerances[axis]['signed']
49
- absolute = tolerances[axis]['absolute']
50
- sign_prefix = '+' if signed > 0 else ''
51
- print(f"{axis}-axis: Signed = {sign_prefix}{signed:.3f}%, Absolute = {absolute:.3f}%")
63
+ for axis in ["X", "Y", "Z"]:
64
+ signed = tolerances[axis]["signed"]
65
+ absolute = tolerances[axis]["absolute"]
66
+ sign_prefix = "+" if signed > 0 else ""
67
+ print(
68
+ f"{axis}-axis: Signed = {sign_prefix}{signed:.3f}%, Absolute = {absolute:.3f}%"
69
+ )
70
+
52
71
 
53
72
  if __name__ == "__main__":
54
73
  main()
@@ -1,7 +1,7 @@
1
1
  def calculate_tolerance(expected, measured):
2
2
  tolerances = {}
3
- for axis, e, m in zip(['X', 'Y', 'Z'], expected, measured):
3
+ for axis, e, m in zip(["X", "Y", "Z"], expected, measured):
4
4
  signed = ((m - e) / e) * 100
5
5
  absolute = abs(signed)
6
- tolerances[axis] = {'signed': signed, 'absolute': absolute}
6
+ tolerances[axis] = {"signed": signed, "absolute": absolute}
7
7
  return tolerances
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PrintTolTest
3
- Version: 0.2.1
3
+ Version: 0.2.2.1
4
4
  Summary: A simple CLI tool to calculate 3D print dimensional tolerance.
5
5
  Author: NanashiTheNameless
6
6
  Author-email: NanashiTheNameless <NanashiTheNameless@NamelessNanashi.dev>
@@ -40,15 +40,11 @@ It does have issues and is not a perfect representation of printer performance.
40
40
  Get the Latest
41
41
 
42
42
  ```sh
43
- python3 -m pip install --upgrade 'PrintTolTest @ git+https://github.com/NanashiTheNameless/PrintTolTest@main'
43
+ pipx install --force 'PrintTolTest @ git+https://github.com/NanashiTheNameless/PrintTolTest@main'
44
44
  ```
45
45
 
46
46
  Or get from [PyPi](<https://pypi.org/project/PrintTolTest/>) (not recommended, may be out of date)
47
47
 
48
- ```sh
49
- python3 -m pip install --upgrade PrintTolTest
50
- ```
51
-
52
48
  ## Get started
53
49
 
54
50
  ### Interactively
@@ -12,15 +12,11 @@ It does have issues and is not a perfect representation of printer performance.
12
12
  Get the Latest
13
13
 
14
14
  ```sh
15
- python3 -m pip install --upgrade 'PrintTolTest @ git+https://github.com/NanashiTheNameless/PrintTolTest@main'
15
+ pipx install --force 'PrintTolTest @ git+https://github.com/NanashiTheNameless/PrintTolTest@main'
16
16
  ```
17
17
 
18
18
  Or get from [PyPi](<https://pypi.org/project/PrintTolTest/>) (not recommended, may be out of date)
19
19
 
20
- ```sh
21
- python3 -m pip install --upgrade PrintTolTest
22
- ```
23
-
24
20
  ## Get started
25
21
 
26
22
  ### Interactively
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "PrintTolTest"
7
- version = "0.2.1"
7
+ version = "0.2.2.1"
8
8
  description = "A simple CLI tool to calculate 3D print dimensional tolerance."
9
9
  readme = "README.md"
10
10
  license = { text = "OQL-1.2" }
File without changes
File without changes