qnty 0.0.9__py3-none-any.whl → 0.1.1__py3-none-any.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.
Files changed (92) hide show
  1. qnty/__init__.py +2 -3
  2. qnty/constants/__init__.py +10 -0
  3. qnty/constants/numerical.py +18 -0
  4. qnty/constants/solvers.py +6 -0
  5. qnty/constants/tests.py +6 -0
  6. qnty/dimensions/__init__.py +23 -0
  7. qnty/dimensions/base.py +97 -0
  8. qnty/dimensions/field_dims.py +126 -0
  9. qnty/dimensions/field_dims.pyi +128 -0
  10. qnty/dimensions/signature.py +111 -0
  11. qnty/equations/__init__.py +1 -1
  12. qnty/equations/equation.py +118 -155
  13. qnty/equations/system.py +68 -65
  14. qnty/expressions/__init__.py +25 -46
  15. qnty/expressions/formatter.py +188 -0
  16. qnty/expressions/functions.py +46 -68
  17. qnty/expressions/nodes.py +540 -384
  18. qnty/expressions/types.py +70 -0
  19. qnty/problems/__init__.py +145 -0
  20. qnty/problems/composition.py +1101 -0
  21. qnty/problems/problem.py +737 -0
  22. qnty/problems/rules.py +145 -0
  23. qnty/problems/solving.py +1216 -0
  24. qnty/problems/validation.py +127 -0
  25. qnty/quantities/__init__.py +28 -5
  26. qnty/quantities/base_qnty.py +677 -0
  27. qnty/quantities/field_converters.py +24004 -0
  28. qnty/quantities/field_qnty.py +1012 -0
  29. qnty/{generated/setters.py → quantities/field_setter.py} +3071 -2961
  30. qnty/{generated/quantities.py → quantities/field_vars.py} +829 -444
  31. qnty/{generated/quantities.pyi → quantities/field_vars.pyi} +1289 -1290
  32. qnty/solving/manager.py +50 -44
  33. qnty/solving/order.py +181 -133
  34. qnty/solving/solvers/__init__.py +2 -9
  35. qnty/solving/solvers/base.py +27 -37
  36. qnty/solving/solvers/iterative.py +115 -135
  37. qnty/solving/solvers/simultaneous.py +93 -165
  38. qnty/units/__init__.py +1 -0
  39. qnty/{generated/units.py → units/field_units.py} +1700 -991
  40. qnty/units/field_units.pyi +2461 -0
  41. qnty/units/prefixes.py +58 -105
  42. qnty/units/registry.py +76 -89
  43. qnty/utils/__init__.py +16 -0
  44. qnty/utils/caching/__init__.py +23 -0
  45. qnty/utils/caching/manager.py +401 -0
  46. qnty/utils/error_handling/__init__.py +66 -0
  47. qnty/utils/error_handling/context.py +39 -0
  48. qnty/utils/error_handling/exceptions.py +96 -0
  49. qnty/utils/error_handling/handlers.py +171 -0
  50. qnty/utils/logging.py +4 -4
  51. qnty/utils/protocols.py +164 -0
  52. qnty/utils/scope_discovery.py +420 -0
  53. {qnty-0.0.9.dist-info → qnty-0.1.1.dist-info}/METADATA +1 -1
  54. qnty-0.1.1.dist-info/RECORD +60 -0
  55. qnty/_backup/problem_original.py +0 -1251
  56. qnty/_backup/quantity.py +0 -63
  57. qnty/codegen/cli.py +0 -125
  58. qnty/codegen/generators/data/unit_data.json +0 -8807
  59. qnty/codegen/generators/data_processor.py +0 -345
  60. qnty/codegen/generators/dimensions_gen.py +0 -434
  61. qnty/codegen/generators/doc_generator.py +0 -141
  62. qnty/codegen/generators/out/dimension_mapping.json +0 -974
  63. qnty/codegen/generators/out/dimension_metadata.json +0 -123
  64. qnty/codegen/generators/out/units_metadata.json +0 -223
  65. qnty/codegen/generators/quantities_gen.py +0 -159
  66. qnty/codegen/generators/setters_gen.py +0 -178
  67. qnty/codegen/generators/stubs_gen.py +0 -167
  68. qnty/codegen/generators/units_gen.py +0 -295
  69. qnty/expressions/cache.py +0 -94
  70. qnty/generated/dimensions.py +0 -514
  71. qnty/problem/__init__.py +0 -91
  72. qnty/problem/base.py +0 -142
  73. qnty/problem/composition.py +0 -385
  74. qnty/problem/composition_mixin.py +0 -382
  75. qnty/problem/equations.py +0 -413
  76. qnty/problem/metaclass.py +0 -302
  77. qnty/problem/reconstruction.py +0 -1016
  78. qnty/problem/solving.py +0 -180
  79. qnty/problem/validation.py +0 -64
  80. qnty/problem/variables.py +0 -239
  81. qnty/quantities/expression_quantity.py +0 -314
  82. qnty/quantities/quantity.py +0 -428
  83. qnty/quantities/typed_quantity.py +0 -215
  84. qnty/validation/__init__.py +0 -0
  85. qnty/validation/registry.py +0 -0
  86. qnty/validation/rules.py +0 -167
  87. qnty-0.0.9.dist-info/RECORD +0 -63
  88. /qnty/{codegen → extensions}/__init__.py +0 -0
  89. /qnty/{codegen/generators → extensions/integration}/__init__.py +0 -0
  90. /qnty/{codegen/generators/utils → extensions/plotting}/__init__.py +0 -0
  91. /qnty/{generated → extensions/reporting}/__init__.py +0 -0
  92. {qnty-0.0.9.dist-info → qnty-0.1.1.dist-info}/WHEEL +0 -0
@@ -4,17 +4,18 @@ Quantity Classes Module - Static Edition
4
4
 
5
5
  Static quantity class definitions for maximum import performance.
6
6
  Uses static class generation instead of dynamic type() calls.
7
- Auto-generated from unit_data.json.
7
+ Auto-generated by codegen/generators/field_vars.py
8
+ DO NOT EDIT MANUALLY - changes will be overwritten.
8
9
  """
9
10
 
10
- from ..quantities.typed_quantity import TypedQuantity
11
- from . import dimensions as dim
12
- from . import setters as ts
11
+ from ..dimensions import field_dims as dim
12
+ from . import field_setter as ts
13
+ from .field_qnty import FieldQnty
13
14
 
14
15
  # ===== QUANTITY CLASSES =====
15
16
  # Static quantity class definitions with __slots__ optimization
16
17
 
17
- class AbsorbedDose(TypedQuantity):
18
+ class AbsorbedDose(FieldQnty):
18
19
  """
19
20
  Type-safe absorbed radiation dose quantity with expression capabilities.
20
21
 
@@ -30,10 +31,11 @@ class AbsorbedDose(TypedQuantity):
30
31
 
31
32
  Available units: "erg_per_gram", "gram_rad", "gray"
32
33
  """
34
+
33
35
  __slots__ = ()
34
36
  _setter_class = ts.AbsorbedDoseSetter
35
- _expected_dimension = dim.ABSORBED_DOSE
36
-
37
+ _dimension = dim.ABSORBED_DOSE
38
+
37
39
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
38
40
  """
39
41
  Initialize absorbed radiation dose quantity.
@@ -52,13 +54,15 @@ class AbsorbedDose(TypedQuantity):
52
54
  super().__init__(name_or_value, unit, name, is_known=is_known)
53
55
  else:
54
56
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
57
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
55
58
 
56
- def set(self, value: int | float) -> ts.AbsorbedDoseSetter:
59
+ def set(self, value: float, unit: str | None = None) -> ts.AbsorbedDoseSetter:
57
60
  """
58
61
  Create a setter for this absorbed radiation dose quantity.
59
62
 
60
63
  Args:
61
64
  value: The numeric value to set
65
+ unit: Optional unit string (for compatibility with base class)
62
66
 
63
67
  Returns:
64
68
  AbsorbedDoseSetter: A setter with unit properties like .meters, .inches, etc.
@@ -70,7 +74,7 @@ class AbsorbedDose(TypedQuantity):
70
74
  return ts.AbsorbedDoseSetter(self, value)
71
75
 
72
76
 
73
- class Acceleration(TypedQuantity):
77
+ class Acceleration(FieldQnty):
74
78
  """
75
79
  Type-safe acceleration quantity with expression capabilities.
76
80
 
@@ -86,10 +90,11 @@ class Acceleration(TypedQuantity):
86
90
 
87
91
  Available units: "meter_per_second_squared", "foot_per_second_squared"
88
92
  """
93
+
89
94
  __slots__ = ()
90
95
  _setter_class = ts.AccelerationSetter
91
- _expected_dimension = dim.ACCELERATION
92
-
96
+ _dimension = dim.ACCELERATION
97
+
93
98
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
94
99
  """
95
100
  Initialize acceleration quantity.
@@ -108,13 +113,15 @@ class Acceleration(TypedQuantity):
108
113
  super().__init__(name_or_value, unit, name, is_known=is_known)
109
114
  else:
110
115
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
116
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
111
117
 
112
- def set(self, value: int | float) -> ts.AccelerationSetter:
118
+ def set(self, value: float, unit: str | None = None) -> ts.AccelerationSetter:
113
119
  """
114
120
  Create a setter for this acceleration quantity.
115
121
 
116
122
  Args:
117
123
  value: The numeric value to set
124
+ unit: Optional unit string (for compatibility with base class)
118
125
 
119
126
  Returns:
120
127
  AccelerationSetter: A setter with unit properties like .meters, .inches, etc.
@@ -126,7 +133,7 @@ class Acceleration(TypedQuantity):
126
133
  return ts.AccelerationSetter(self, value)
127
134
 
128
135
 
129
- class ActivationEnergy(TypedQuantity):
136
+ class ActivationEnergy(FieldQnty):
130
137
  """
131
138
  Type-safe activation energy quantity with expression capabilities.
132
139
 
@@ -142,10 +149,11 @@ class ActivationEnergy(TypedQuantity):
142
149
 
143
150
  Available units: "btu_per_pound_mole", "calorie_mean_per_gram_mole", "joule_per_gram_mole"
144
151
  """
152
+
145
153
  __slots__ = ()
146
154
  _setter_class = ts.ActivationEnergySetter
147
- _expected_dimension = dim.ACTIVATION_ENERGY
148
-
155
+ _dimension = dim.ACTIVATION_ENERGY
156
+
149
157
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
150
158
  """
151
159
  Initialize activation energy quantity.
@@ -164,13 +172,15 @@ class ActivationEnergy(TypedQuantity):
164
172
  super().__init__(name_or_value, unit, name, is_known=is_known)
165
173
  else:
166
174
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
175
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
167
176
 
168
- def set(self, value: int | float) -> ts.ActivationEnergySetter:
177
+ def set(self, value: float, unit: str | None = None) -> ts.ActivationEnergySetter:
169
178
  """
170
179
  Create a setter for this activation energy quantity.
171
180
 
172
181
  Args:
173
182
  value: The numeric value to set
183
+ unit: Optional unit string (for compatibility with base class)
174
184
 
175
185
  Returns:
176
186
  ActivationEnergySetter: A setter with unit properties like .meters, .inches, etc.
@@ -182,7 +192,7 @@ class ActivationEnergy(TypedQuantity):
182
192
  return ts.ActivationEnergySetter(self, value)
183
193
 
184
194
 
185
- class AmountOfSubstance(TypedQuantity):
195
+ class AmountOfSubstance(FieldQnty):
186
196
  """
187
197
  Type-safe amount of substance quantity with expression capabilities.
188
198
 
@@ -198,10 +208,11 @@ class AmountOfSubstance(TypedQuantity):
198
208
 
199
209
  Available units: "kilogram_mol", "mole", "pound_mole"
200
210
  """
211
+
201
212
  __slots__ = ()
202
213
  _setter_class = ts.AmountOfSubstanceSetter
203
- _expected_dimension = dim.AMOUNT_OF_SUBSTANCE
204
-
214
+ _dimension = dim.AMOUNT_OF_SUBSTANCE
215
+
205
216
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
206
217
  """
207
218
  Initialize amount of substance quantity.
@@ -220,13 +231,15 @@ class AmountOfSubstance(TypedQuantity):
220
231
  super().__init__(name_or_value, unit, name, is_known=is_known)
221
232
  else:
222
233
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
234
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
223
235
 
224
- def set(self, value: int | float) -> ts.AmountOfSubstanceSetter:
236
+ def set(self, value: float, unit: str | None = None) -> ts.AmountOfSubstanceSetter:
225
237
  """
226
238
  Create a setter for this amount of substance quantity.
227
239
 
228
240
  Args:
229
241
  value: The numeric value to set
242
+ unit: Optional unit string (for compatibility with base class)
230
243
 
231
244
  Returns:
232
245
  AmountOfSubstanceSetter: A setter with unit properties like .meters, .inches, etc.
@@ -238,7 +251,7 @@ class AmountOfSubstance(TypedQuantity):
238
251
  return ts.AmountOfSubstanceSetter(self, value)
239
252
 
240
253
 
241
- class AnglePlane(TypedQuantity):
254
+ class AnglePlane(FieldQnty):
242
255
  """
243
256
  Type-safe angle, plane quantity with expression capabilities.
244
257
 
@@ -254,10 +267,11 @@ class AnglePlane(TypedQuantity):
254
267
 
255
268
  Available units: "degree", "gon", "grade"
256
269
  """
270
+
257
271
  __slots__ = ()
258
272
  _setter_class = ts.AnglePlaneSetter
259
- _expected_dimension = dim.ANGLE_PLANE
260
-
273
+ _dimension = dim.ANGLE_PLANE
274
+
261
275
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
262
276
  """
263
277
  Initialize angle, plane quantity.
@@ -276,13 +290,15 @@ class AnglePlane(TypedQuantity):
276
290
  super().__init__(name_or_value, unit, name, is_known=is_known)
277
291
  else:
278
292
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
293
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
279
294
 
280
- def set(self, value: int | float) -> ts.AnglePlaneSetter:
295
+ def set(self, value: float, unit: str | None = None) -> ts.AnglePlaneSetter:
281
296
  """
282
297
  Create a setter for this angle, plane quantity.
283
298
 
284
299
  Args:
285
300
  value: The numeric value to set
301
+ unit: Optional unit string (for compatibility with base class)
286
302
 
287
303
  Returns:
288
304
  AnglePlaneSetter: A setter with unit properties like .meters, .inches, etc.
@@ -294,7 +310,7 @@ class AnglePlane(TypedQuantity):
294
310
  return ts.AnglePlaneSetter(self, value)
295
311
 
296
312
 
297
- class AngleSolid(TypedQuantity):
313
+ class AngleSolid(FieldQnty):
298
314
  """
299
315
  Type-safe angle, solid quantity with expression capabilities.
300
316
 
@@ -310,10 +326,11 @@ class AngleSolid(TypedQuantity):
310
326
 
311
327
  Available units: "spat", "square_degree", "square_gon"
312
328
  """
329
+
313
330
  __slots__ = ()
314
331
  _setter_class = ts.AngleSolidSetter
315
- _expected_dimension = dim.ANGLE_SOLID
316
-
332
+ _dimension = dim.ANGLE_SOLID
333
+
317
334
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
318
335
  """
319
336
  Initialize angle, solid quantity.
@@ -332,13 +349,15 @@ class AngleSolid(TypedQuantity):
332
349
  super().__init__(name_or_value, unit, name, is_known=is_known)
333
350
  else:
334
351
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
352
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
335
353
 
336
- def set(self, value: int | float) -> ts.AngleSolidSetter:
354
+ def set(self, value: float, unit: str | None = None) -> ts.AngleSolidSetter:
337
355
  """
338
356
  Create a setter for this angle, solid quantity.
339
357
 
340
358
  Args:
341
359
  value: The numeric value to set
360
+ unit: Optional unit string (for compatibility with base class)
342
361
 
343
362
  Returns:
344
363
  AngleSolidSetter: A setter with unit properties like .meters, .inches, etc.
@@ -350,7 +369,7 @@ class AngleSolid(TypedQuantity):
350
369
  return ts.AngleSolidSetter(self, value)
351
370
 
352
371
 
353
- class AngularAcceleration(TypedQuantity):
372
+ class AngularAcceleration(FieldQnty):
354
373
  """
355
374
  Type-safe angular acceleration quantity with expression capabilities.
356
375
 
@@ -366,10 +385,11 @@ class AngularAcceleration(TypedQuantity):
366
385
 
367
386
  Available units: "radian_per_second_squared", "revolution_per_second_squared", "rpm_or_revolution_per_minute"
368
387
  """
388
+
369
389
  __slots__ = ()
370
390
  _setter_class = ts.AngularAccelerationSetter
371
- _expected_dimension = dim.ANGULAR_ACCELERATION
372
-
391
+ _dimension = dim.ANGULAR_ACCELERATION
392
+
373
393
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
374
394
  """
375
395
  Initialize angular acceleration quantity.
@@ -388,13 +408,15 @@ class AngularAcceleration(TypedQuantity):
388
408
  super().__init__(name_or_value, unit, name, is_known=is_known)
389
409
  else:
390
410
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
411
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
391
412
 
392
- def set(self, value: int | float) -> ts.AngularAccelerationSetter:
413
+ def set(self, value: float, unit: str | None = None) -> ts.AngularAccelerationSetter:
393
414
  """
394
415
  Create a setter for this angular acceleration quantity.
395
416
 
396
417
  Args:
397
418
  value: The numeric value to set
419
+ unit: Optional unit string (for compatibility with base class)
398
420
 
399
421
  Returns:
400
422
  AngularAccelerationSetter: A setter with unit properties like .meters, .inches, etc.
@@ -406,7 +428,7 @@ class AngularAcceleration(TypedQuantity):
406
428
  return ts.AngularAccelerationSetter(self, value)
407
429
 
408
430
 
409
- class AngularMomentum(TypedQuantity):
431
+ class AngularMomentum(FieldQnty):
410
432
  """
411
433
  Type-safe angular momentum quantity with expression capabilities.
412
434
 
@@ -422,10 +444,11 @@ class AngularMomentum(TypedQuantity):
422
444
 
423
445
  Available units: "gram_centimeter_squared_per_second", "kilogram_meter_squared_per_second", "pound_force_square_foot_per_second"
424
446
  """
447
+
425
448
  __slots__ = ()
426
449
  _setter_class = ts.AngularMomentumSetter
427
- _expected_dimension = dim.ANGULAR_MOMENTUM
428
-
450
+ _dimension = dim.ANGULAR_MOMENTUM
451
+
429
452
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
430
453
  """
431
454
  Initialize angular momentum quantity.
@@ -444,13 +467,15 @@ class AngularMomentum(TypedQuantity):
444
467
  super().__init__(name_or_value, unit, name, is_known=is_known)
445
468
  else:
446
469
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
470
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
447
471
 
448
- def set(self, value: int | float) -> ts.AngularMomentumSetter:
472
+ def set(self, value: float, unit: str | None = None) -> ts.AngularMomentumSetter:
449
473
  """
450
474
  Create a setter for this angular momentum quantity.
451
475
 
452
476
  Args:
453
477
  value: The numeric value to set
478
+ unit: Optional unit string (for compatibility with base class)
454
479
 
455
480
  Returns:
456
481
  AngularMomentumSetter: A setter with unit properties like .meters, .inches, etc.
@@ -462,7 +487,7 @@ class AngularMomentum(TypedQuantity):
462
487
  return ts.AngularMomentumSetter(self, value)
463
488
 
464
489
 
465
- class Area(TypedQuantity):
490
+ class Area(FieldQnty):
466
491
  """
467
492
  Type-safe area quantity with expression capabilities.
468
493
 
@@ -478,10 +503,11 @@ class Area(TypedQuantity):
478
503
 
479
504
  Available units: "acre_general", "are", "arpent_quebec"
480
505
  """
506
+
481
507
  __slots__ = ()
482
508
  _setter_class = ts.AreaSetter
483
- _expected_dimension = dim.AREA
484
-
509
+ _dimension = dim.AREA
510
+
485
511
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
486
512
  """
487
513
  Initialize area quantity.
@@ -500,13 +526,15 @@ class Area(TypedQuantity):
500
526
  super().__init__(name_or_value, unit, name, is_known=is_known)
501
527
  else:
502
528
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
529
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
503
530
 
504
- def set(self, value: int | float) -> ts.AreaSetter:
531
+ def set(self, value: float, unit: str | None = None) -> ts.AreaSetter:
505
532
  """
506
533
  Create a setter for this area quantity.
507
534
 
508
535
  Args:
509
536
  value: The numeric value to set
537
+ unit: Optional unit string (for compatibility with base class)
510
538
 
511
539
  Returns:
512
540
  AreaSetter: A setter with unit properties like .meters, .inches, etc.
@@ -518,7 +546,7 @@ class Area(TypedQuantity):
518
546
  return ts.AreaSetter(self, value)
519
547
 
520
548
 
521
- class AreaPerUnitVolume(TypedQuantity):
549
+ class AreaPerUnitVolume(FieldQnty):
522
550
  """
523
551
  Type-safe area per unit volume quantity with expression capabilities.
524
552
 
@@ -534,10 +562,11 @@ class AreaPerUnitVolume(TypedQuantity):
534
562
 
535
563
  Available units: "square_centimeter_per_cubic_centimeter", "square_foot_per_cubic_foot", "square_inch_per_cubic_inch"
536
564
  """
565
+
537
566
  __slots__ = ()
538
567
  _setter_class = ts.AreaPerUnitVolumeSetter
539
- _expected_dimension = dim.AREA_PER_UNIT_VOLUME
540
-
568
+ _dimension = dim.AREA_PER_UNIT_VOLUME
569
+
541
570
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
542
571
  """
543
572
  Initialize area per unit volume quantity.
@@ -556,13 +585,15 @@ class AreaPerUnitVolume(TypedQuantity):
556
585
  super().__init__(name_or_value, unit, name, is_known=is_known)
557
586
  else:
558
587
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
588
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
559
589
 
560
- def set(self, value: int | float) -> ts.AreaPerUnitVolumeSetter:
590
+ def set(self, value: float, unit: str | None = None) -> ts.AreaPerUnitVolumeSetter:
561
591
  """
562
592
  Create a setter for this area per unit volume quantity.
563
593
 
564
594
  Args:
565
595
  value: The numeric value to set
596
+ unit: Optional unit string (for compatibility with base class)
566
597
 
567
598
  Returns:
568
599
  AreaPerUnitVolumeSetter: A setter with unit properties like .meters, .inches, etc.
@@ -574,7 +605,7 @@ class AreaPerUnitVolume(TypedQuantity):
574
605
  return ts.AreaPerUnitVolumeSetter(self, value)
575
606
 
576
607
 
577
- class AtomicWeight(TypedQuantity):
608
+ class AtomicWeight(FieldQnty):
578
609
  """
579
610
  Type-safe atomic weight quantity with expression capabilities.
580
611
 
@@ -590,10 +621,11 @@ class AtomicWeight(TypedQuantity):
590
621
 
591
622
  Available units: "atomic_mass_unit_12c", "grams_per_mole", "kilograms_per_kilomole"
592
623
  """
624
+
593
625
  __slots__ = ()
594
626
  _setter_class = ts.AtomicWeightSetter
595
- _expected_dimension = dim.ATOMIC_WEIGHT
596
-
627
+ _dimension = dim.ATOMIC_WEIGHT
628
+
597
629
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
598
630
  """
599
631
  Initialize atomic weight quantity.
@@ -612,13 +644,15 @@ class AtomicWeight(TypedQuantity):
612
644
  super().__init__(name_or_value, unit, name, is_known=is_known)
613
645
  else:
614
646
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
647
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
615
648
 
616
- def set(self, value: int | float) -> ts.AtomicWeightSetter:
649
+ def set(self, value: float, unit: str | None = None) -> ts.AtomicWeightSetter:
617
650
  """
618
651
  Create a setter for this atomic weight quantity.
619
652
 
620
653
  Args:
621
654
  value: The numeric value to set
655
+ unit: Optional unit string (for compatibility with base class)
622
656
 
623
657
  Returns:
624
658
  AtomicWeightSetter: A setter with unit properties like .meters, .inches, etc.
@@ -630,7 +664,7 @@ class AtomicWeight(TypedQuantity):
630
664
  return ts.AtomicWeightSetter(self, value)
631
665
 
632
666
 
633
- class Concentration(TypedQuantity):
667
+ class Concentration(FieldQnty):
634
668
  """
635
669
  Type-safe concentration quantity with expression capabilities.
636
670
 
@@ -646,10 +680,11 @@ class Concentration(TypedQuantity):
646
680
 
647
681
  Available units: "grains_of_i_per_cubic_foot", "grains_of_i_per_gallon_us"
648
682
  """
683
+
649
684
  __slots__ = ()
650
685
  _setter_class = ts.ConcentrationSetter
651
- _expected_dimension = dim.CONCENTRATION
652
-
686
+ _dimension = dim.CONCENTRATION
687
+
653
688
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
654
689
  """
655
690
  Initialize concentration quantity.
@@ -668,13 +703,15 @@ class Concentration(TypedQuantity):
668
703
  super().__init__(name_or_value, unit, name, is_known=is_known)
669
704
  else:
670
705
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
706
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
671
707
 
672
- def set(self, value: int | float) -> ts.ConcentrationSetter:
708
+ def set(self, value: float, unit: str | None = None) -> ts.ConcentrationSetter:
673
709
  """
674
710
  Create a setter for this concentration quantity.
675
711
 
676
712
  Args:
677
713
  value: The numeric value to set
714
+ unit: Optional unit string (for compatibility with base class)
678
715
 
679
716
  Returns:
680
717
  ConcentrationSetter: A setter with unit properties like .meters, .inches, etc.
@@ -686,7 +723,7 @@ class Concentration(TypedQuantity):
686
723
  return ts.ConcentrationSetter(self, value)
687
724
 
688
725
 
689
- class Dimensionless(TypedQuantity):
726
+ class Dimensionless(FieldQnty):
690
727
  """
691
728
  Type-safe dimensionless quantity with expression capabilities.
692
729
 
@@ -700,10 +737,11 @@ class Dimensionless(TypedQuantity):
700
737
  >>> unknown = Dimensionless("efficiency") # Unknown dimensionless
701
738
  >>> known = Dimensionless(0.85, "thermal_efficiency") # Known dimensionless
702
739
  """
740
+
703
741
  __slots__ = ()
704
742
  _setter_class = ts.DimensionlessSetter
705
- _expected_dimension = dim.DIMENSIONLESS
706
-
743
+ _dimension = dim.DIMENSIONLESS
744
+
707
745
  def __init__(self, name_or_value: str | int | float, name: str | None = None, is_known: bool = True):
708
746
  """
709
747
  Initialize dimensionless quantity.
@@ -719,25 +757,45 @@ class Dimensionless(TypedQuantity):
719
757
  else:
720
758
  # Two arguments: value and name (known variable)
721
759
  super().__init__(name_or_value, name, is_known=is_known)
760
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
722
761
 
723
- def set(self, value: int | float) -> ts.DimensionlessSetter:
762
+ def set(self, value: float, unit: str | None = None) -> ts.DimensionlessSetter:
724
763
  """
725
764
  Create a setter for this dimensionless quantity.
726
765
 
727
766
  Args:
728
767
  value: The numeric value to set
768
+ unit: Optional unit string (for direct setting)
729
769
 
730
770
  Returns:
731
- DimensionlessSetter: A setter with unit properties like .meters, .inches, etc.
771
+ DimensionlessSetter: A setter with unit properties like .dimensionless
732
772
 
733
773
  Example:
734
- >>> length = Length("beam_length")
735
- >>> length.set(100).millimeters # Sets to 100 mm
736
- """
737
- return ts.DimensionlessSetter(self, value)
774
+ >>> factor = Dimensionless("factor")
775
+ >>> factor.set(2.5).dimensionless # Sets to 2.5
776
+ >>> factor.set(2.5, "dimensionless") # Direct setting
777
+ """
778
+ if unit is not None:
779
+ # Direct setting with unit
780
+ setter = ts.DimensionlessSetter(self, value)
781
+ # Get the unit property and call it to set the value
782
+ if hasattr(setter, unit):
783
+ getattr(setter, unit)
784
+ else:
785
+ # Try common aliases
786
+ unit_aliases = {
787
+ "dimensionless": "dimensionless", "": "dimensionless"
788
+ }
789
+ if unit in unit_aliases and hasattr(setter, unit_aliases[unit]):
790
+ getattr(setter, unit_aliases[unit])
791
+ else:
792
+ raise ValueError(f"Unknown unit: {unit}")
793
+ return self # Return the variable itself for consistency
794
+ else:
795
+ return ts.DimensionlessSetter(self, value)
738
796
 
739
797
 
740
- class DynamicFluidity(TypedQuantity):
798
+ class DynamicFluidity(FieldQnty):
741
799
  """
742
800
  Type-safe dynamic fluidity quantity with expression capabilities.
743
801
 
@@ -753,10 +811,11 @@ class DynamicFluidity(TypedQuantity):
753
811
 
754
812
  Available units: "meter_seconds_per_kilogram", "rhe", "square_foot_per_pound_second"
755
813
  """
814
+
756
815
  __slots__ = ()
757
816
  _setter_class = ts.DynamicFluiditySetter
758
- _expected_dimension = dim.DYNAMIC_FLUIDITY
759
-
817
+ _dimension = dim.DYNAMIC_FLUIDITY
818
+
760
819
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
761
820
  """
762
821
  Initialize dynamic fluidity quantity.
@@ -775,13 +834,15 @@ class DynamicFluidity(TypedQuantity):
775
834
  super().__init__(name_or_value, unit, name, is_known=is_known)
776
835
  else:
777
836
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
837
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
778
838
 
779
- def set(self, value: int | float) -> ts.DynamicFluiditySetter:
839
+ def set(self, value: float, unit: str | None = None) -> ts.DynamicFluiditySetter:
780
840
  """
781
841
  Create a setter for this dynamic fluidity quantity.
782
842
 
783
843
  Args:
784
844
  value: The numeric value to set
845
+ unit: Optional unit string (for compatibility with base class)
785
846
 
786
847
  Returns:
787
848
  DynamicFluiditySetter: A setter with unit properties like .meters, .inches, etc.
@@ -793,7 +854,7 @@ class DynamicFluidity(TypedQuantity):
793
854
  return ts.DynamicFluiditySetter(self, value)
794
855
 
795
856
 
796
- class ElectricCapacitance(TypedQuantity):
857
+ class ElectricCapacitance(FieldQnty):
797
858
  """
798
859
  Type-safe electric capacitance quantity with expression capabilities.
799
860
 
@@ -809,10 +870,11 @@ class ElectricCapacitance(TypedQuantity):
809
870
 
810
871
  Available units: "cm", "abfarad", "farad"
811
872
  """
873
+
812
874
  __slots__ = ()
813
875
  _setter_class = ts.ElectricCapacitanceSetter
814
- _expected_dimension = dim.ELECTRIC_CAPACITANCE
815
-
876
+ _dimension = dim.ELECTRIC_CAPACITANCE
877
+
816
878
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
817
879
  """
818
880
  Initialize electric capacitance quantity.
@@ -831,13 +893,15 @@ class ElectricCapacitance(TypedQuantity):
831
893
  super().__init__(name_or_value, unit, name, is_known=is_known)
832
894
  else:
833
895
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
896
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
834
897
 
835
- def set(self, value: int | float) -> ts.ElectricCapacitanceSetter:
898
+ def set(self, value: float, unit: str | None = None) -> ts.ElectricCapacitanceSetter:
836
899
  """
837
900
  Create a setter for this electric capacitance quantity.
838
901
 
839
902
  Args:
840
903
  value: The numeric value to set
904
+ unit: Optional unit string (for compatibility with base class)
841
905
 
842
906
  Returns:
843
907
  ElectricCapacitanceSetter: A setter with unit properties like .meters, .inches, etc.
@@ -849,7 +913,7 @@ class ElectricCapacitance(TypedQuantity):
849
913
  return ts.ElectricCapacitanceSetter(self, value)
850
914
 
851
915
 
852
- class ElectricCharge(TypedQuantity):
916
+ class ElectricCharge(FieldQnty):
853
917
  """
854
918
  Type-safe electric charge quantity with expression capabilities.
855
919
 
@@ -865,10 +929,11 @@ class ElectricCharge(TypedQuantity):
865
929
 
866
930
  Available units: "abcoulomb", "ampere_hour", "coulomb"
867
931
  """
932
+
868
933
  __slots__ = ()
869
934
  _setter_class = ts.ElectricChargeSetter
870
- _expected_dimension = dim.ELECTRIC_CHARGE
871
-
935
+ _dimension = dim.ELECTRIC_CHARGE
936
+
872
937
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
873
938
  """
874
939
  Initialize electric charge quantity.
@@ -887,13 +952,15 @@ class ElectricCharge(TypedQuantity):
887
952
  super().__init__(name_or_value, unit, name, is_known=is_known)
888
953
  else:
889
954
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
955
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
890
956
 
891
- def set(self, value: int | float) -> ts.ElectricChargeSetter:
957
+ def set(self, value: float, unit: str | None = None) -> ts.ElectricChargeSetter:
892
958
  """
893
959
  Create a setter for this electric charge quantity.
894
960
 
895
961
  Args:
896
962
  value: The numeric value to set
963
+ unit: Optional unit string (for compatibility with base class)
897
964
 
898
965
  Returns:
899
966
  ElectricChargeSetter: A setter with unit properties like .meters, .inches, etc.
@@ -905,7 +972,7 @@ class ElectricCharge(TypedQuantity):
905
972
  return ts.ElectricChargeSetter(self, value)
906
973
 
907
974
 
908
- class ElectricCurrentIntensity(TypedQuantity):
975
+ class ElectricCurrentIntensity(FieldQnty):
909
976
  """
910
977
  Type-safe electric current intensity quantity with expression capabilities.
911
978
 
@@ -921,10 +988,11 @@ class ElectricCurrentIntensity(TypedQuantity):
921
988
 
922
989
  Available units: "abampere", "ampere_intl_mean", "ampere_intl_us"
923
990
  """
991
+
924
992
  __slots__ = ()
925
993
  _setter_class = ts.ElectricCurrentIntensitySetter
926
- _expected_dimension = dim.ELECTRIC_CURRENT_INTENSITY
927
-
994
+ _dimension = dim.ELECTRIC_CURRENT_INTENSITY
995
+
928
996
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
929
997
  """
930
998
  Initialize electric current intensity quantity.
@@ -943,13 +1011,15 @@ class ElectricCurrentIntensity(TypedQuantity):
943
1011
  super().__init__(name_or_value, unit, name, is_known=is_known)
944
1012
  else:
945
1013
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
1014
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
946
1015
 
947
- def set(self, value: int | float) -> ts.ElectricCurrentIntensitySetter:
1016
+ def set(self, value: float, unit: str | None = None) -> ts.ElectricCurrentIntensitySetter:
948
1017
  """
949
1018
  Create a setter for this electric current intensity quantity.
950
1019
 
951
1020
  Args:
952
1021
  value: The numeric value to set
1022
+ unit: Optional unit string (for compatibility with base class)
953
1023
 
954
1024
  Returns:
955
1025
  ElectricCurrentIntensitySetter: A setter with unit properties like .meters, .inches, etc.
@@ -961,7 +1031,7 @@ class ElectricCurrentIntensity(TypedQuantity):
961
1031
  return ts.ElectricCurrentIntensitySetter(self, value)
962
1032
 
963
1033
 
964
- class ElectricDipoleMoment(TypedQuantity):
1034
+ class ElectricDipoleMoment(FieldQnty):
965
1035
  """
966
1036
  Type-safe electric dipole moment quantity with expression capabilities.
967
1037
 
@@ -977,10 +1047,11 @@ class ElectricDipoleMoment(TypedQuantity):
977
1047
 
978
1048
  Available units: "ampere_meter_second", "coulomb_meter", "debye"
979
1049
  """
1050
+
980
1051
  __slots__ = ()
981
1052
  _setter_class = ts.ElectricDipoleMomentSetter
982
- _expected_dimension = dim.ELECTRIC_DIPOLE_MOMENT
983
-
1053
+ _dimension = dim.ELECTRIC_DIPOLE_MOMENT
1054
+
984
1055
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
985
1056
  """
986
1057
  Initialize electric dipole moment quantity.
@@ -999,13 +1070,15 @@ class ElectricDipoleMoment(TypedQuantity):
999
1070
  super().__init__(name_or_value, unit, name, is_known=is_known)
1000
1071
  else:
1001
1072
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
1073
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
1002
1074
 
1003
- def set(self, value: int | float) -> ts.ElectricDipoleMomentSetter:
1075
+ def set(self, value: float, unit: str | None = None) -> ts.ElectricDipoleMomentSetter:
1004
1076
  """
1005
1077
  Create a setter for this electric dipole moment quantity.
1006
1078
 
1007
1079
  Args:
1008
1080
  value: The numeric value to set
1081
+ unit: Optional unit string (for compatibility with base class)
1009
1082
 
1010
1083
  Returns:
1011
1084
  ElectricDipoleMomentSetter: A setter with unit properties like .meters, .inches, etc.
@@ -1017,7 +1090,7 @@ class ElectricDipoleMoment(TypedQuantity):
1017
1090
  return ts.ElectricDipoleMomentSetter(self, value)
1018
1091
 
1019
1092
 
1020
- class ElectricFieldStrength(TypedQuantity):
1093
+ class ElectricFieldStrength(FieldQnty):
1021
1094
  """
1022
1095
  Type-safe electric field strength quantity with expression capabilities.
1023
1096
 
@@ -1033,10 +1106,11 @@ class ElectricFieldStrength(TypedQuantity):
1033
1106
 
1034
1107
  Available units: "volt_per_centimeter", "volt_per_meter"
1035
1108
  """
1109
+
1036
1110
  __slots__ = ()
1037
1111
  _setter_class = ts.ElectricFieldStrengthSetter
1038
- _expected_dimension = dim.ELECTRIC_FIELD_STRENGTH
1039
-
1112
+ _dimension = dim.ELECTRIC_FIELD_STRENGTH
1113
+
1040
1114
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
1041
1115
  """
1042
1116
  Initialize electric field strength quantity.
@@ -1055,13 +1129,15 @@ class ElectricFieldStrength(TypedQuantity):
1055
1129
  super().__init__(name_or_value, unit, name, is_known=is_known)
1056
1130
  else:
1057
1131
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
1132
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
1058
1133
 
1059
- def set(self, value: int | float) -> ts.ElectricFieldStrengthSetter:
1134
+ def set(self, value: float, unit: str | None = None) -> ts.ElectricFieldStrengthSetter:
1060
1135
  """
1061
1136
  Create a setter for this electric field strength quantity.
1062
1137
 
1063
1138
  Args:
1064
1139
  value: The numeric value to set
1140
+ unit: Optional unit string (for compatibility with base class)
1065
1141
 
1066
1142
  Returns:
1067
1143
  ElectricFieldStrengthSetter: A setter with unit properties like .meters, .inches, etc.
@@ -1073,7 +1149,7 @@ class ElectricFieldStrength(TypedQuantity):
1073
1149
  return ts.ElectricFieldStrengthSetter(self, value)
1074
1150
 
1075
1151
 
1076
- class ElectricInductance(TypedQuantity):
1152
+ class ElectricInductance(FieldQnty):
1077
1153
  """
1078
1154
  Type-safe electric inductance quantity with expression capabilities.
1079
1155
 
@@ -1089,10 +1165,11 @@ class ElectricInductance(TypedQuantity):
1089
1165
 
1090
1166
  Available units: "abhenry", "cm", "henry"
1091
1167
  """
1168
+
1092
1169
  __slots__ = ()
1093
1170
  _setter_class = ts.ElectricInductanceSetter
1094
- _expected_dimension = dim.ELECTRIC_INDUCTANCE
1095
-
1171
+ _dimension = dim.ELECTRIC_INDUCTANCE
1172
+
1096
1173
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
1097
1174
  """
1098
1175
  Initialize electric inductance quantity.
@@ -1111,13 +1188,15 @@ class ElectricInductance(TypedQuantity):
1111
1188
  super().__init__(name_or_value, unit, name, is_known=is_known)
1112
1189
  else:
1113
1190
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
1191
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
1114
1192
 
1115
- def set(self, value: int | float) -> ts.ElectricInductanceSetter:
1193
+ def set(self, value: float, unit: str | None = None) -> ts.ElectricInductanceSetter:
1116
1194
  """
1117
1195
  Create a setter for this electric inductance quantity.
1118
1196
 
1119
1197
  Args:
1120
1198
  value: The numeric value to set
1199
+ unit: Optional unit string (for compatibility with base class)
1121
1200
 
1122
1201
  Returns:
1123
1202
  ElectricInductanceSetter: A setter with unit properties like .meters, .inches, etc.
@@ -1129,7 +1208,7 @@ class ElectricInductance(TypedQuantity):
1129
1208
  return ts.ElectricInductanceSetter(self, value)
1130
1209
 
1131
1210
 
1132
- class ElectricPotential(TypedQuantity):
1211
+ class ElectricPotential(FieldQnty):
1133
1212
  """
1134
1213
  Type-safe electric potential quantity with expression capabilities.
1135
1214
 
@@ -1145,10 +1224,11 @@ class ElectricPotential(TypedQuantity):
1145
1224
 
1146
1225
  Available units: "abvolt", "statvolt", "u_a_potential"
1147
1226
  """
1227
+
1148
1228
  __slots__ = ()
1149
1229
  _setter_class = ts.ElectricPotentialSetter
1150
- _expected_dimension = dim.ELECTRIC_POTENTIAL
1151
-
1230
+ _dimension = dim.ELECTRIC_POTENTIAL
1231
+
1152
1232
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
1153
1233
  """
1154
1234
  Initialize electric potential quantity.
@@ -1167,13 +1247,15 @@ class ElectricPotential(TypedQuantity):
1167
1247
  super().__init__(name_or_value, unit, name, is_known=is_known)
1168
1248
  else:
1169
1249
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
1250
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
1170
1251
 
1171
- def set(self, value: int | float) -> ts.ElectricPotentialSetter:
1252
+ def set(self, value: float, unit: str | None = None) -> ts.ElectricPotentialSetter:
1172
1253
  """
1173
1254
  Create a setter for this electric potential quantity.
1174
1255
 
1175
1256
  Args:
1176
1257
  value: The numeric value to set
1258
+ unit: Optional unit string (for compatibility with base class)
1177
1259
 
1178
1260
  Returns:
1179
1261
  ElectricPotentialSetter: A setter with unit properties like .meters, .inches, etc.
@@ -1185,7 +1267,7 @@ class ElectricPotential(TypedQuantity):
1185
1267
  return ts.ElectricPotentialSetter(self, value)
1186
1268
 
1187
1269
 
1188
- class ElectricResistance(TypedQuantity):
1270
+ class ElectricResistance(FieldQnty):
1189
1271
  """
1190
1272
  Type-safe electric resistance quantity with expression capabilities.
1191
1273
 
@@ -1201,10 +1283,11 @@ class ElectricResistance(TypedQuantity):
1201
1283
 
1202
1284
  Available units: "abohm", "jacobi", "lenz"
1203
1285
  """
1286
+
1204
1287
  __slots__ = ()
1205
1288
  _setter_class = ts.ElectricResistanceSetter
1206
- _expected_dimension = dim.ELECTRIC_RESISTANCE
1207
-
1289
+ _dimension = dim.ELECTRIC_RESISTANCE
1290
+
1208
1291
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
1209
1292
  """
1210
1293
  Initialize electric resistance quantity.
@@ -1223,13 +1306,15 @@ class ElectricResistance(TypedQuantity):
1223
1306
  super().__init__(name_or_value, unit, name, is_known=is_known)
1224
1307
  else:
1225
1308
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
1309
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
1226
1310
 
1227
- def set(self, value: int | float) -> ts.ElectricResistanceSetter:
1311
+ def set(self, value: float, unit: str | None = None) -> ts.ElectricResistanceSetter:
1228
1312
  """
1229
1313
  Create a setter for this electric resistance quantity.
1230
1314
 
1231
1315
  Args:
1232
1316
  value: The numeric value to set
1317
+ unit: Optional unit string (for compatibility with base class)
1233
1318
 
1234
1319
  Returns:
1235
1320
  ElectricResistanceSetter: A setter with unit properties like .meters, .inches, etc.
@@ -1241,7 +1326,7 @@ class ElectricResistance(TypedQuantity):
1241
1326
  return ts.ElectricResistanceSetter(self, value)
1242
1327
 
1243
1328
 
1244
- class ElectricalConductance(TypedQuantity):
1329
+ class ElectricalConductance(FieldQnty):
1245
1330
  """
1246
1331
  Type-safe electrical conductance quantity with expression capabilities.
1247
1332
 
@@ -1257,10 +1342,11 @@ class ElectricalConductance(TypedQuantity):
1257
1342
 
1258
1343
  Available units: "emu_cgs", "esu_cgs", "mho"
1259
1344
  """
1345
+
1260
1346
  __slots__ = ()
1261
1347
  _setter_class = ts.ElectricalConductanceSetter
1262
- _expected_dimension = dim.ELECTRICAL_CONDUCTANCE
1263
-
1348
+ _dimension = dim.ELECTRICAL_CONDUCTANCE
1349
+
1264
1350
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
1265
1351
  """
1266
1352
  Initialize electrical conductance quantity.
@@ -1279,13 +1365,15 @@ class ElectricalConductance(TypedQuantity):
1279
1365
  super().__init__(name_or_value, unit, name, is_known=is_known)
1280
1366
  else:
1281
1367
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
1368
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
1282
1369
 
1283
- def set(self, value: int | float) -> ts.ElectricalConductanceSetter:
1370
+ def set(self, value: float, unit: str | None = None) -> ts.ElectricalConductanceSetter:
1284
1371
  """
1285
1372
  Create a setter for this electrical conductance quantity.
1286
1373
 
1287
1374
  Args:
1288
1375
  value: The numeric value to set
1376
+ unit: Optional unit string (for compatibility with base class)
1289
1377
 
1290
1378
  Returns:
1291
1379
  ElectricalConductanceSetter: A setter with unit properties like .meters, .inches, etc.
@@ -1297,7 +1385,7 @@ class ElectricalConductance(TypedQuantity):
1297
1385
  return ts.ElectricalConductanceSetter(self, value)
1298
1386
 
1299
1387
 
1300
- class ElectricalPermittivity(TypedQuantity):
1388
+ class ElectricalPermittivity(FieldQnty):
1301
1389
  """
1302
1390
  Type-safe electrical permittivity quantity with expression capabilities.
1303
1391
 
@@ -1313,10 +1401,11 @@ class ElectricalPermittivity(TypedQuantity):
1313
1401
 
1314
1402
  Available units: "farad_per_meter"
1315
1403
  """
1404
+
1316
1405
  __slots__ = ()
1317
1406
  _setter_class = ts.ElectricalPermittivitySetter
1318
- _expected_dimension = dim.ELECTRICAL_PERMITTIVITY
1319
-
1407
+ _dimension = dim.ELECTRICAL_PERMITTIVITY
1408
+
1320
1409
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
1321
1410
  """
1322
1411
  Initialize electrical permittivity quantity.
@@ -1335,13 +1424,15 @@ class ElectricalPermittivity(TypedQuantity):
1335
1424
  super().__init__(name_or_value, unit, name, is_known=is_known)
1336
1425
  else:
1337
1426
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
1427
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
1338
1428
 
1339
- def set(self, value: int | float) -> ts.ElectricalPermittivitySetter:
1429
+ def set(self, value: float, unit: str | None = None) -> ts.ElectricalPermittivitySetter:
1340
1430
  """
1341
1431
  Create a setter for this electrical permittivity quantity.
1342
1432
 
1343
1433
  Args:
1344
1434
  value: The numeric value to set
1435
+ unit: Optional unit string (for compatibility with base class)
1345
1436
 
1346
1437
  Returns:
1347
1438
  ElectricalPermittivitySetter: A setter with unit properties like .meters, .inches, etc.
@@ -1353,7 +1444,7 @@ class ElectricalPermittivity(TypedQuantity):
1353
1444
  return ts.ElectricalPermittivitySetter(self, value)
1354
1445
 
1355
1446
 
1356
- class ElectricalResistivity(TypedQuantity):
1447
+ class ElectricalResistivity(FieldQnty):
1357
1448
  """
1358
1449
  Type-safe electrical resistivity quantity with expression capabilities.
1359
1450
 
@@ -1369,10 +1460,11 @@ class ElectricalResistivity(TypedQuantity):
1369
1460
 
1370
1461
  Available units: "circular_mil_ohm_per_foot", "emu_cgs", "microhm_inch"
1371
1462
  """
1463
+
1372
1464
  __slots__ = ()
1373
1465
  _setter_class = ts.ElectricalResistivitySetter
1374
- _expected_dimension = dim.ELECTRICAL_RESISTIVITY
1375
-
1466
+ _dimension = dim.ELECTRICAL_RESISTIVITY
1467
+
1376
1468
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
1377
1469
  """
1378
1470
  Initialize electrical resistivity quantity.
@@ -1391,13 +1483,15 @@ class ElectricalResistivity(TypedQuantity):
1391
1483
  super().__init__(name_or_value, unit, name, is_known=is_known)
1392
1484
  else:
1393
1485
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
1486
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
1394
1487
 
1395
- def set(self, value: int | float) -> ts.ElectricalResistivitySetter:
1488
+ def set(self, value: float, unit: str | None = None) -> ts.ElectricalResistivitySetter:
1396
1489
  """
1397
1490
  Create a setter for this electrical resistivity quantity.
1398
1491
 
1399
1492
  Args:
1400
1493
  value: The numeric value to set
1494
+ unit: Optional unit string (for compatibility with base class)
1401
1495
 
1402
1496
  Returns:
1403
1497
  ElectricalResistivitySetter: A setter with unit properties like .meters, .inches, etc.
@@ -1409,7 +1503,7 @@ class ElectricalResistivity(TypedQuantity):
1409
1503
  return ts.ElectricalResistivitySetter(self, value)
1410
1504
 
1411
1505
 
1412
- class EnergyFlux(TypedQuantity):
1506
+ class EnergyFlux(FieldQnty):
1413
1507
  """
1414
1508
  Type-safe energy flux quantity with expression capabilities.
1415
1509
 
@@ -1425,10 +1519,11 @@ class EnergyFlux(TypedQuantity):
1425
1519
 
1426
1520
  Available units: "btu_per_square_foot_per_hour", "calorie_per_square_centimeter_per_second", "celsius_heat_units_chu"
1427
1521
  """
1522
+
1428
1523
  __slots__ = ()
1429
1524
  _setter_class = ts.EnergyFluxSetter
1430
- _expected_dimension = dim.ENERGY_FLUX
1431
-
1525
+ _dimension = dim.ENERGY_FLUX
1526
+
1432
1527
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
1433
1528
  """
1434
1529
  Initialize energy flux quantity.
@@ -1447,13 +1542,15 @@ class EnergyFlux(TypedQuantity):
1447
1542
  super().__init__(name_or_value, unit, name, is_known=is_known)
1448
1543
  else:
1449
1544
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
1545
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
1450
1546
 
1451
- def set(self, value: int | float) -> ts.EnergyFluxSetter:
1547
+ def set(self, value: float, unit: str | None = None) -> ts.EnergyFluxSetter:
1452
1548
  """
1453
1549
  Create a setter for this energy flux quantity.
1454
1550
 
1455
1551
  Args:
1456
1552
  value: The numeric value to set
1553
+ unit: Optional unit string (for compatibility with base class)
1457
1554
 
1458
1555
  Returns:
1459
1556
  EnergyFluxSetter: A setter with unit properties like .meters, .inches, etc.
@@ -1465,7 +1562,7 @@ class EnergyFlux(TypedQuantity):
1465
1562
  return ts.EnergyFluxSetter(self, value)
1466
1563
 
1467
1564
 
1468
- class EnergyHeatWork(TypedQuantity):
1565
+ class EnergyHeatWork(FieldQnty):
1469
1566
  """
1470
1567
  Type-safe energy, heat, work quantity with expression capabilities.
1471
1568
 
@@ -1481,10 +1578,11 @@ class EnergyHeatWork(TypedQuantity):
1481
1578
 
1482
1579
  Available units: "barrel_oil_equivalent_or_equivalent_barrel", "billion_electronvolt", "british_thermal_unit_4circ_mathrmc"
1483
1580
  """
1581
+
1484
1582
  __slots__ = ()
1485
1583
  _setter_class = ts.EnergyHeatWorkSetter
1486
- _expected_dimension = dim.ENERGY_HEAT_WORK
1487
-
1584
+ _dimension = dim.ENERGY_HEAT_WORK
1585
+
1488
1586
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
1489
1587
  """
1490
1588
  Initialize energy, heat, work quantity.
@@ -1503,13 +1601,15 @@ class EnergyHeatWork(TypedQuantity):
1503
1601
  super().__init__(name_or_value, unit, name, is_known=is_known)
1504
1602
  else:
1505
1603
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
1604
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
1506
1605
 
1507
- def set(self, value: int | float) -> ts.EnergyHeatWorkSetter:
1606
+ def set(self, value: float, unit: str | None = None) -> ts.EnergyHeatWorkSetter:
1508
1607
  """
1509
1608
  Create a setter for this energy, heat, work quantity.
1510
1609
 
1511
1610
  Args:
1512
1611
  value: The numeric value to set
1612
+ unit: Optional unit string (for compatibility with base class)
1513
1613
 
1514
1614
  Returns:
1515
1615
  EnergyHeatWorkSetter: A setter with unit properties like .meters, .inches, etc.
@@ -1521,7 +1621,7 @@ class EnergyHeatWork(TypedQuantity):
1521
1621
  return ts.EnergyHeatWorkSetter(self, value)
1522
1622
 
1523
1623
 
1524
- class EnergyPerUnitArea(TypedQuantity):
1624
+ class EnergyPerUnitArea(FieldQnty):
1525
1625
  """
1526
1626
  Type-safe energy per unit area quantity with expression capabilities.
1527
1627
 
@@ -1537,10 +1637,11 @@ class EnergyPerUnitArea(TypedQuantity):
1537
1637
 
1538
1638
  Available units: "british_thermal_unit_per_square_foot", "joule_per_square_meter", "langley"
1539
1639
  """
1640
+
1540
1641
  __slots__ = ()
1541
1642
  _setter_class = ts.EnergyPerUnitAreaSetter
1542
- _expected_dimension = dim.ENERGY_PER_UNIT_AREA
1543
-
1643
+ _dimension = dim.ENERGY_PER_UNIT_AREA
1644
+
1544
1645
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
1545
1646
  """
1546
1647
  Initialize energy per unit area quantity.
@@ -1559,13 +1660,15 @@ class EnergyPerUnitArea(TypedQuantity):
1559
1660
  super().__init__(name_or_value, unit, name, is_known=is_known)
1560
1661
  else:
1561
1662
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
1663
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
1562
1664
 
1563
- def set(self, value: int | float) -> ts.EnergyPerUnitAreaSetter:
1665
+ def set(self, value: float, unit: str | None = None) -> ts.EnergyPerUnitAreaSetter:
1564
1666
  """
1565
1667
  Create a setter for this energy per unit area quantity.
1566
1668
 
1567
1669
  Args:
1568
1670
  value: The numeric value to set
1671
+ unit: Optional unit string (for compatibility with base class)
1569
1672
 
1570
1673
  Returns:
1571
1674
  EnergyPerUnitAreaSetter: A setter with unit properties like .meters, .inches, etc.
@@ -1577,7 +1680,7 @@ class EnergyPerUnitArea(TypedQuantity):
1577
1680
  return ts.EnergyPerUnitAreaSetter(self, value)
1578
1681
 
1579
1682
 
1580
- class Force(TypedQuantity):
1683
+ class Force(FieldQnty):
1581
1684
  """
1582
1685
  Type-safe force quantity with expression capabilities.
1583
1686
 
@@ -1593,10 +1696,11 @@ class Force(TypedQuantity):
1593
1696
 
1594
1697
  Available units: "crinal", "dyne", "funal"
1595
1698
  """
1699
+
1596
1700
  __slots__ = ()
1597
1701
  _setter_class = ts.ForceSetter
1598
- _expected_dimension = dim.FORCE
1599
-
1702
+ _dimension = dim.FORCE
1703
+
1600
1704
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
1601
1705
  """
1602
1706
  Initialize force quantity.
@@ -1615,13 +1719,15 @@ class Force(TypedQuantity):
1615
1719
  super().__init__(name_or_value, unit, name, is_known=is_known)
1616
1720
  else:
1617
1721
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
1722
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
1618
1723
 
1619
- def set(self, value: int | float) -> ts.ForceSetter:
1724
+ def set(self, value: float, unit: str | None = None) -> ts.ForceSetter:
1620
1725
  """
1621
1726
  Create a setter for this force quantity.
1622
1727
 
1623
1728
  Args:
1624
1729
  value: The numeric value to set
1730
+ unit: Optional unit string (for compatibility with base class)
1625
1731
 
1626
1732
  Returns:
1627
1733
  ForceSetter: A setter with unit properties like .meters, .inches, etc.
@@ -1633,7 +1739,7 @@ class Force(TypedQuantity):
1633
1739
  return ts.ForceSetter(self, value)
1634
1740
 
1635
1741
 
1636
- class ForceBody(TypedQuantity):
1742
+ class ForceBody(FieldQnty):
1637
1743
  """
1638
1744
  Type-safe force (body) quantity with expression capabilities.
1639
1745
 
@@ -1649,10 +1755,11 @@ class ForceBody(TypedQuantity):
1649
1755
 
1650
1756
  Available units: "dyne_per_cubic_centimeter", "kilogram_force_per_cubic_centimeter", "kilogram_force_per_cubic_meter"
1651
1757
  """
1758
+
1652
1759
  __slots__ = ()
1653
1760
  _setter_class = ts.ForceBodySetter
1654
- _expected_dimension = dim.FORCE_BODY
1655
-
1761
+ _dimension = dim.FORCE_BODY
1762
+
1656
1763
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
1657
1764
  """
1658
1765
  Initialize force (body) quantity.
@@ -1671,13 +1778,15 @@ class ForceBody(TypedQuantity):
1671
1778
  super().__init__(name_or_value, unit, name, is_known=is_known)
1672
1779
  else:
1673
1780
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
1781
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
1674
1782
 
1675
- def set(self, value: int | float) -> ts.ForceBodySetter:
1783
+ def set(self, value: float, unit: str | None = None) -> ts.ForceBodySetter:
1676
1784
  """
1677
1785
  Create a setter for this force (body) quantity.
1678
1786
 
1679
1787
  Args:
1680
1788
  value: The numeric value to set
1789
+ unit: Optional unit string (for compatibility with base class)
1681
1790
 
1682
1791
  Returns:
1683
1792
  ForceBodySetter: A setter with unit properties like .meters, .inches, etc.
@@ -1689,7 +1798,7 @@ class ForceBody(TypedQuantity):
1689
1798
  return ts.ForceBodySetter(self, value)
1690
1799
 
1691
1800
 
1692
- class ForcePerUnitMass(TypedQuantity):
1801
+ class ForcePerUnitMass(FieldQnty):
1693
1802
  """
1694
1803
  Type-safe force per unit mass quantity with expression capabilities.
1695
1804
 
@@ -1705,10 +1814,11 @@ class ForcePerUnitMass(TypedQuantity):
1705
1814
 
1706
1815
  Available units: "dyne_per_gram", "kilogram_force_per_kilogram", "newton_per_kilogram"
1707
1816
  """
1817
+
1708
1818
  __slots__ = ()
1709
1819
  _setter_class = ts.ForcePerUnitMassSetter
1710
- _expected_dimension = dim.FORCE_PER_UNIT_MASS
1711
-
1820
+ _dimension = dim.FORCE_PER_UNIT_MASS
1821
+
1712
1822
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
1713
1823
  """
1714
1824
  Initialize force per unit mass quantity.
@@ -1727,13 +1837,15 @@ class ForcePerUnitMass(TypedQuantity):
1727
1837
  super().__init__(name_or_value, unit, name, is_known=is_known)
1728
1838
  else:
1729
1839
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
1840
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
1730
1841
 
1731
- def set(self, value: int | float) -> ts.ForcePerUnitMassSetter:
1842
+ def set(self, value: float, unit: str | None = None) -> ts.ForcePerUnitMassSetter:
1732
1843
  """
1733
1844
  Create a setter for this force per unit mass quantity.
1734
1845
 
1735
1846
  Args:
1736
1847
  value: The numeric value to set
1848
+ unit: Optional unit string (for compatibility with base class)
1737
1849
 
1738
1850
  Returns:
1739
1851
  ForcePerUnitMassSetter: A setter with unit properties like .meters, .inches, etc.
@@ -1745,7 +1857,7 @@ class ForcePerUnitMass(TypedQuantity):
1745
1857
  return ts.ForcePerUnitMassSetter(self, value)
1746
1858
 
1747
1859
 
1748
- class FrequencyVoltageRatio(TypedQuantity):
1860
+ class FrequencyVoltageRatio(FieldQnty):
1749
1861
  """
1750
1862
  Type-safe frequency voltage ratio quantity with expression capabilities.
1751
1863
 
@@ -1761,10 +1873,11 @@ class FrequencyVoltageRatio(TypedQuantity):
1761
1873
 
1762
1874
  Available units: "cycles_per_second_per_volt", "hertz_per_volt", "terahertz_per_volt"
1763
1875
  """
1876
+
1764
1877
  __slots__ = ()
1765
1878
  _setter_class = ts.FrequencyVoltageRatioSetter
1766
- _expected_dimension = dim.FREQUENCY_VOLTAGE_RATIO
1767
-
1879
+ _dimension = dim.FREQUENCY_VOLTAGE_RATIO
1880
+
1768
1881
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
1769
1882
  """
1770
1883
  Initialize frequency voltage ratio quantity.
@@ -1783,13 +1896,15 @@ class FrequencyVoltageRatio(TypedQuantity):
1783
1896
  super().__init__(name_or_value, unit, name, is_known=is_known)
1784
1897
  else:
1785
1898
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
1899
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
1786
1900
 
1787
- def set(self, value: int | float) -> ts.FrequencyVoltageRatioSetter:
1901
+ def set(self, value: float, unit: str | None = None) -> ts.FrequencyVoltageRatioSetter:
1788
1902
  """
1789
1903
  Create a setter for this frequency voltage ratio quantity.
1790
1904
 
1791
1905
  Args:
1792
1906
  value: The numeric value to set
1907
+ unit: Optional unit string (for compatibility with base class)
1793
1908
 
1794
1909
  Returns:
1795
1910
  FrequencyVoltageRatioSetter: A setter with unit properties like .meters, .inches, etc.
@@ -1801,7 +1916,7 @@ class FrequencyVoltageRatio(TypedQuantity):
1801
1916
  return ts.FrequencyVoltageRatioSetter(self, value)
1802
1917
 
1803
1918
 
1804
- class FuelConsumption(TypedQuantity):
1919
+ class FuelConsumption(FieldQnty):
1805
1920
  """
1806
1921
  Type-safe fuel consumption quantity with expression capabilities.
1807
1922
 
@@ -1817,10 +1932,11 @@ class FuelConsumption(TypedQuantity):
1817
1932
 
1818
1933
  Available units: "unit_100_km_per_liter", "gallons_uk", "gallons_us"
1819
1934
  """
1935
+
1820
1936
  __slots__ = ()
1821
1937
  _setter_class = ts.FuelConsumptionSetter
1822
- _expected_dimension = dim.FUEL_CONSUMPTION
1823
-
1938
+ _dimension = dim.FUEL_CONSUMPTION
1939
+
1824
1940
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
1825
1941
  """
1826
1942
  Initialize fuel consumption quantity.
@@ -1839,13 +1955,15 @@ class FuelConsumption(TypedQuantity):
1839
1955
  super().__init__(name_or_value, unit, name, is_known=is_known)
1840
1956
  else:
1841
1957
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
1958
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
1842
1959
 
1843
- def set(self, value: int | float) -> ts.FuelConsumptionSetter:
1960
+ def set(self, value: float, unit: str | None = None) -> ts.FuelConsumptionSetter:
1844
1961
  """
1845
1962
  Create a setter for this fuel consumption quantity.
1846
1963
 
1847
1964
  Args:
1848
1965
  value: The numeric value to set
1966
+ unit: Optional unit string (for compatibility with base class)
1849
1967
 
1850
1968
  Returns:
1851
1969
  FuelConsumptionSetter: A setter with unit properties like .meters, .inches, etc.
@@ -1857,7 +1975,7 @@ class FuelConsumption(TypedQuantity):
1857
1975
  return ts.FuelConsumptionSetter(self, value)
1858
1976
 
1859
1977
 
1860
- class HeatOfCombustion(TypedQuantity):
1978
+ class HeatOfCombustion(FieldQnty):
1861
1979
  """
1862
1980
  Type-safe heat of combustion quantity with expression capabilities.
1863
1981
 
@@ -1873,10 +1991,11 @@ class HeatOfCombustion(TypedQuantity):
1873
1991
 
1874
1992
  Available units: "british_thermal_unit_per_pound", "calorie_per_gram", "chu_per_pound"
1875
1993
  """
1994
+
1876
1995
  __slots__ = ()
1877
1996
  _setter_class = ts.HeatOfCombustionSetter
1878
- _expected_dimension = dim.HEAT_OF_COMBUSTION
1879
-
1997
+ _dimension = dim.HEAT_OF_COMBUSTION
1998
+
1880
1999
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
1881
2000
  """
1882
2001
  Initialize heat of combustion quantity.
@@ -1895,13 +2014,15 @@ class HeatOfCombustion(TypedQuantity):
1895
2014
  super().__init__(name_or_value, unit, name, is_known=is_known)
1896
2015
  else:
1897
2016
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
2017
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
1898
2018
 
1899
- def set(self, value: int | float) -> ts.HeatOfCombustionSetter:
2019
+ def set(self, value: float, unit: str | None = None) -> ts.HeatOfCombustionSetter:
1900
2020
  """
1901
2021
  Create a setter for this heat of combustion quantity.
1902
2022
 
1903
2023
  Args:
1904
2024
  value: The numeric value to set
2025
+ unit: Optional unit string (for compatibility with base class)
1905
2026
 
1906
2027
  Returns:
1907
2028
  HeatOfCombustionSetter: A setter with unit properties like .meters, .inches, etc.
@@ -1913,7 +2034,7 @@ class HeatOfCombustion(TypedQuantity):
1913
2034
  return ts.HeatOfCombustionSetter(self, value)
1914
2035
 
1915
2036
 
1916
- class HeatOfFusion(TypedQuantity):
2037
+ class HeatOfFusion(FieldQnty):
1917
2038
  """
1918
2039
  Type-safe heat of fusion quantity with expression capabilities.
1919
2040
 
@@ -1929,10 +2050,11 @@ class HeatOfFusion(TypedQuantity):
1929
2050
 
1930
2051
  Available units: "british_thermal_unit_mean", "british_thermal_unit_per_pound", "calorie_per_gram"
1931
2052
  """
2053
+
1932
2054
  __slots__ = ()
1933
2055
  _setter_class = ts.HeatOfFusionSetter
1934
- _expected_dimension = dim.HEAT_OF_FUSION
1935
-
2056
+ _dimension = dim.HEAT_OF_FUSION
2057
+
1936
2058
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
1937
2059
  """
1938
2060
  Initialize heat of fusion quantity.
@@ -1951,13 +2073,15 @@ class HeatOfFusion(TypedQuantity):
1951
2073
  super().__init__(name_or_value, unit, name, is_known=is_known)
1952
2074
  else:
1953
2075
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
2076
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
1954
2077
 
1955
- def set(self, value: int | float) -> ts.HeatOfFusionSetter:
2078
+ def set(self, value: float, unit: str | None = None) -> ts.HeatOfFusionSetter:
1956
2079
  """
1957
2080
  Create a setter for this heat of fusion quantity.
1958
2081
 
1959
2082
  Args:
1960
2083
  value: The numeric value to set
2084
+ unit: Optional unit string (for compatibility with base class)
1961
2085
 
1962
2086
  Returns:
1963
2087
  HeatOfFusionSetter: A setter with unit properties like .meters, .inches, etc.
@@ -1969,7 +2093,7 @@ class HeatOfFusion(TypedQuantity):
1969
2093
  return ts.HeatOfFusionSetter(self, value)
1970
2094
 
1971
2095
 
1972
- class HeatOfVaporization(TypedQuantity):
2096
+ class HeatOfVaporization(FieldQnty):
1973
2097
  """
1974
2098
  Type-safe heat of vaporization quantity with expression capabilities.
1975
2099
 
@@ -1985,10 +2109,11 @@ class HeatOfVaporization(TypedQuantity):
1985
2109
 
1986
2110
  Available units: "british_thermal_unit_per_pound", "calorie_per_gram", "chu_per_pound"
1987
2111
  """
2112
+
1988
2113
  __slots__ = ()
1989
2114
  _setter_class = ts.HeatOfVaporizationSetter
1990
- _expected_dimension = dim.HEAT_OF_VAPORIZATION
1991
-
2115
+ _dimension = dim.HEAT_OF_VAPORIZATION
2116
+
1992
2117
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
1993
2118
  """
1994
2119
  Initialize heat of vaporization quantity.
@@ -2007,13 +2132,15 @@ class HeatOfVaporization(TypedQuantity):
2007
2132
  super().__init__(name_or_value, unit, name, is_known=is_known)
2008
2133
  else:
2009
2134
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
2135
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
2010
2136
 
2011
- def set(self, value: int | float) -> ts.HeatOfVaporizationSetter:
2137
+ def set(self, value: float, unit: str | None = None) -> ts.HeatOfVaporizationSetter:
2012
2138
  """
2013
2139
  Create a setter for this heat of vaporization quantity.
2014
2140
 
2015
2141
  Args:
2016
2142
  value: The numeric value to set
2143
+ unit: Optional unit string (for compatibility with base class)
2017
2144
 
2018
2145
  Returns:
2019
2146
  HeatOfVaporizationSetter: A setter with unit properties like .meters, .inches, etc.
@@ -2025,7 +2152,7 @@ class HeatOfVaporization(TypedQuantity):
2025
2152
  return ts.HeatOfVaporizationSetter(self, value)
2026
2153
 
2027
2154
 
2028
- class HeatTransferCoefficient(TypedQuantity):
2155
+ class HeatTransferCoefficient(FieldQnty):
2029
2156
  """
2030
2157
  Type-safe heat transfer coefficient quantity with expression capabilities.
2031
2158
 
@@ -2041,10 +2168,11 @@ class HeatTransferCoefficient(TypedQuantity):
2041
2168
 
2042
2169
  Available units: "btu_per_square_foot_per_hour_per_degree_fahrenheit_or_rankine", "watt_per_square_meter_per_degree_celsius_or_kelvin"
2043
2170
  """
2171
+
2044
2172
  __slots__ = ()
2045
2173
  _setter_class = ts.HeatTransferCoefficientSetter
2046
- _expected_dimension = dim.HEAT_TRANSFER_COEFFICIENT
2047
-
2174
+ _dimension = dim.HEAT_TRANSFER_COEFFICIENT
2175
+
2048
2176
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
2049
2177
  """
2050
2178
  Initialize heat transfer coefficient quantity.
@@ -2063,13 +2191,15 @@ class HeatTransferCoefficient(TypedQuantity):
2063
2191
  super().__init__(name_or_value, unit, name, is_known=is_known)
2064
2192
  else:
2065
2193
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
2194
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
2066
2195
 
2067
- def set(self, value: int | float) -> ts.HeatTransferCoefficientSetter:
2196
+ def set(self, value: float, unit: str | None = None) -> ts.HeatTransferCoefficientSetter:
2068
2197
  """
2069
2198
  Create a setter for this heat transfer coefficient quantity.
2070
2199
 
2071
2200
  Args:
2072
2201
  value: The numeric value to set
2202
+ unit: Optional unit string (for compatibility with base class)
2073
2203
 
2074
2204
  Returns:
2075
2205
  HeatTransferCoefficientSetter: A setter with unit properties like .meters, .inches, etc.
@@ -2081,7 +2211,7 @@ class HeatTransferCoefficient(TypedQuantity):
2081
2211
  return ts.HeatTransferCoefficientSetter(self, value)
2082
2212
 
2083
2213
 
2084
- class Illuminance(TypedQuantity):
2214
+ class Illuminance(FieldQnty):
2085
2215
  """
2086
2216
  Type-safe illuminance quantity with expression capabilities.
2087
2217
 
@@ -2097,10 +2227,11 @@ class Illuminance(TypedQuantity):
2097
2227
 
2098
2228
  Available units: "foot_candle", "lux", "nox"
2099
2229
  """
2230
+
2100
2231
  __slots__ = ()
2101
2232
  _setter_class = ts.IlluminanceSetter
2102
- _expected_dimension = dim.ILLUMINANCE
2103
-
2233
+ _dimension = dim.ILLUMINANCE
2234
+
2104
2235
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
2105
2236
  """
2106
2237
  Initialize illuminance quantity.
@@ -2119,13 +2250,15 @@ class Illuminance(TypedQuantity):
2119
2250
  super().__init__(name_or_value, unit, name, is_known=is_known)
2120
2251
  else:
2121
2252
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
2253
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
2122
2254
 
2123
- def set(self, value: int | float) -> ts.IlluminanceSetter:
2255
+ def set(self, value: float, unit: str | None = None) -> ts.IlluminanceSetter:
2124
2256
  """
2125
2257
  Create a setter for this illuminance quantity.
2126
2258
 
2127
2259
  Args:
2128
2260
  value: The numeric value to set
2261
+ unit: Optional unit string (for compatibility with base class)
2129
2262
 
2130
2263
  Returns:
2131
2264
  IlluminanceSetter: A setter with unit properties like .meters, .inches, etc.
@@ -2137,7 +2270,7 @@ class Illuminance(TypedQuantity):
2137
2270
  return ts.IlluminanceSetter(self, value)
2138
2271
 
2139
2272
 
2140
- class KineticEnergyOfTurbulence(TypedQuantity):
2273
+ class KineticEnergyOfTurbulence(FieldQnty):
2141
2274
  """
2142
2275
  Type-safe kinetic energy of turbulence quantity with expression capabilities.
2143
2276
 
@@ -2153,10 +2286,11 @@ class KineticEnergyOfTurbulence(TypedQuantity):
2153
2286
 
2154
2287
  Available units: "square_foot_per_second_squared", "square_meters_per_second_squared"
2155
2288
  """
2289
+
2156
2290
  __slots__ = ()
2157
2291
  _setter_class = ts.KineticEnergyOfTurbulenceSetter
2158
- _expected_dimension = dim.KINETIC_ENERGY_OF_TURBULENCE
2159
-
2292
+ _dimension = dim.KINETIC_ENERGY_OF_TURBULENCE
2293
+
2160
2294
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
2161
2295
  """
2162
2296
  Initialize kinetic energy of turbulence quantity.
@@ -2175,13 +2309,15 @@ class KineticEnergyOfTurbulence(TypedQuantity):
2175
2309
  super().__init__(name_or_value, unit, name, is_known=is_known)
2176
2310
  else:
2177
2311
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
2312
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
2178
2313
 
2179
- def set(self, value: int | float) -> ts.KineticEnergyOfTurbulenceSetter:
2314
+ def set(self, value: float, unit: str | None = None) -> ts.KineticEnergyOfTurbulenceSetter:
2180
2315
  """
2181
2316
  Create a setter for this kinetic energy of turbulence quantity.
2182
2317
 
2183
2318
  Args:
2184
2319
  value: The numeric value to set
2320
+ unit: Optional unit string (for compatibility with base class)
2185
2321
 
2186
2322
  Returns:
2187
2323
  KineticEnergyOfTurbulenceSetter: A setter with unit properties like .meters, .inches, etc.
@@ -2193,7 +2329,7 @@ class KineticEnergyOfTurbulence(TypedQuantity):
2193
2329
  return ts.KineticEnergyOfTurbulenceSetter(self, value)
2194
2330
 
2195
2331
 
2196
- class Length(TypedQuantity):
2332
+ class Length(FieldQnty):
2197
2333
  """
2198
2334
  Type-safe length quantity with expression capabilities.
2199
2335
 
@@ -2209,10 +2345,11 @@ class Length(TypedQuantity):
2209
2345
 
2210
2346
  Available units: "ngstr_m", "arpent_quebec", "astronomic_unit"
2211
2347
  """
2348
+
2212
2349
  __slots__ = ()
2213
2350
  _setter_class = ts.LengthSetter
2214
- _expected_dimension = dim.LENGTH
2215
-
2351
+ _dimension = dim.LENGTH
2352
+
2216
2353
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
2217
2354
  """
2218
2355
  Initialize length quantity.
@@ -2231,13 +2368,15 @@ class Length(TypedQuantity):
2231
2368
  super().__init__(name_or_value, unit, name, is_known=is_known)
2232
2369
  else:
2233
2370
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
2371
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
2234
2372
 
2235
- def set(self, value: int | float) -> ts.LengthSetter:
2373
+ def set(self, value: float, unit: str | None = None) -> ts.LengthSetter:
2236
2374
  """
2237
2375
  Create a setter for this length quantity.
2238
2376
 
2239
2377
  Args:
2240
2378
  value: The numeric value to set
2379
+ unit: Optional unit string (for direct setting)
2241
2380
 
2242
2381
  Returns:
2243
2382
  LengthSetter: A setter with unit properties like .meters, .inches, etc.
@@ -2245,11 +2384,33 @@ class Length(TypedQuantity):
2245
2384
  Example:
2246
2385
  >>> length = Length("beam_length")
2247
2386
  >>> length.set(100).millimeters # Sets to 100 mm
2248
- """
2249
- return ts.LengthSetter(self, value)
2387
+ >>> length.set(100, "inch") # Direct setting
2388
+ """
2389
+ if unit is not None:
2390
+ # Direct setting with unit
2391
+ setter = ts.LengthSetter(self, value)
2392
+ # Get the unit property and call it to set the value
2393
+ if hasattr(setter, unit):
2394
+ getattr(setter, unit)
2395
+ else:
2396
+ # Try common aliases
2397
+ unit_aliases = {
2398
+ "inch": "inch", "inches": "inch", "in": "inch",
2399
+ "foot": "foot", "feet": "foot", "ft": "foot",
2400
+ "meter": "meter", "meters": "meter", "m": "meter",
2401
+ "millimeter": "millimeter", "millimeters": "millimeter", "mm": "millimeter",
2402
+ "centimeter": "centimeter", "centimeters": "centimeter", "cm": "centimeter"
2403
+ }
2404
+ if unit in unit_aliases and hasattr(setter, unit_aliases[unit]):
2405
+ getattr(setter, unit_aliases[unit])
2406
+ else:
2407
+ raise ValueError(f"Unknown unit: {unit}")
2408
+ return self # Return the variable itself for consistency
2409
+ else:
2410
+ return ts.LengthSetter(self, value)
2250
2411
 
2251
2412
 
2252
- class LinearMassDensity(TypedQuantity):
2413
+ class LinearMassDensity(FieldQnty):
2253
2414
  """
2254
2415
  Type-safe linear mass density quantity with expression capabilities.
2255
2416
 
@@ -2265,10 +2426,11 @@ class LinearMassDensity(TypedQuantity):
2265
2426
 
2266
2427
  Available units: "denier", "kilogram_per_centimeter", "kilogram_per_meter"
2267
2428
  """
2429
+
2268
2430
  __slots__ = ()
2269
2431
  _setter_class = ts.LinearMassDensitySetter
2270
- _expected_dimension = dim.LINEAR_MASS_DENSITY
2271
-
2432
+ _dimension = dim.LINEAR_MASS_DENSITY
2433
+
2272
2434
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
2273
2435
  """
2274
2436
  Initialize linear mass density quantity.
@@ -2287,13 +2449,15 @@ class LinearMassDensity(TypedQuantity):
2287
2449
  super().__init__(name_or_value, unit, name, is_known=is_known)
2288
2450
  else:
2289
2451
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
2452
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
2290
2453
 
2291
- def set(self, value: int | float) -> ts.LinearMassDensitySetter:
2454
+ def set(self, value: float, unit: str | None = None) -> ts.LinearMassDensitySetter:
2292
2455
  """
2293
2456
  Create a setter for this linear mass density quantity.
2294
2457
 
2295
2458
  Args:
2296
2459
  value: The numeric value to set
2460
+ unit: Optional unit string (for compatibility with base class)
2297
2461
 
2298
2462
  Returns:
2299
2463
  LinearMassDensitySetter: A setter with unit properties like .meters, .inches, etc.
@@ -2305,7 +2469,7 @@ class LinearMassDensity(TypedQuantity):
2305
2469
  return ts.LinearMassDensitySetter(self, value)
2306
2470
 
2307
2471
 
2308
- class LinearMomentum(TypedQuantity):
2472
+ class LinearMomentum(FieldQnty):
2309
2473
  """
2310
2474
  Type-safe linear momentum quantity with expression capabilities.
2311
2475
 
@@ -2321,10 +2485,11 @@ class LinearMomentum(TypedQuantity):
2321
2485
 
2322
2486
  Available units: "foot_pounds_force_per_hour", "foot_pounds_force_per_minute", "foot_pounds_force_per_second"
2323
2487
  """
2488
+
2324
2489
  __slots__ = ()
2325
2490
  _setter_class = ts.LinearMomentumSetter
2326
- _expected_dimension = dim.LINEAR_MOMENTUM
2327
-
2491
+ _dimension = dim.LINEAR_MOMENTUM
2492
+
2328
2493
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
2329
2494
  """
2330
2495
  Initialize linear momentum quantity.
@@ -2343,13 +2508,15 @@ class LinearMomentum(TypedQuantity):
2343
2508
  super().__init__(name_or_value, unit, name, is_known=is_known)
2344
2509
  else:
2345
2510
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
2511
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
2346
2512
 
2347
- def set(self, value: int | float) -> ts.LinearMomentumSetter:
2513
+ def set(self, value: float, unit: str | None = None) -> ts.LinearMomentumSetter:
2348
2514
  """
2349
2515
  Create a setter for this linear momentum quantity.
2350
2516
 
2351
2517
  Args:
2352
2518
  value: The numeric value to set
2519
+ unit: Optional unit string (for compatibility with base class)
2353
2520
 
2354
2521
  Returns:
2355
2522
  LinearMomentumSetter: A setter with unit properties like .meters, .inches, etc.
@@ -2361,7 +2528,7 @@ class LinearMomentum(TypedQuantity):
2361
2528
  return ts.LinearMomentumSetter(self, value)
2362
2529
 
2363
2530
 
2364
- class LuminanceSelf(TypedQuantity):
2531
+ class LuminanceSelf(FieldQnty):
2365
2532
  """
2366
2533
  Type-safe luminance (self) quantity with expression capabilities.
2367
2534
 
@@ -2377,10 +2544,11 @@ class LuminanceSelf(TypedQuantity):
2377
2544
 
2378
2545
  Available units: "apostilb", "blondel", "candela_per_square_meter"
2379
2546
  """
2547
+
2380
2548
  __slots__ = ()
2381
2549
  _setter_class = ts.LuminanceSelfSetter
2382
- _expected_dimension = dim.LUMINANCE_SELF
2383
-
2550
+ _dimension = dim.LUMINANCE_SELF
2551
+
2384
2552
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
2385
2553
  """
2386
2554
  Initialize luminance (self) quantity.
@@ -2399,13 +2567,15 @@ class LuminanceSelf(TypedQuantity):
2399
2567
  super().__init__(name_or_value, unit, name, is_known=is_known)
2400
2568
  else:
2401
2569
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
2570
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
2402
2571
 
2403
- def set(self, value: int | float) -> ts.LuminanceSelfSetter:
2572
+ def set(self, value: float, unit: str | None = None) -> ts.LuminanceSelfSetter:
2404
2573
  """
2405
2574
  Create a setter for this luminance (self) quantity.
2406
2575
 
2407
2576
  Args:
2408
2577
  value: The numeric value to set
2578
+ unit: Optional unit string (for compatibility with base class)
2409
2579
 
2410
2580
  Returns:
2411
2581
  LuminanceSelfSetter: A setter with unit properties like .meters, .inches, etc.
@@ -2417,7 +2587,7 @@ class LuminanceSelf(TypedQuantity):
2417
2587
  return ts.LuminanceSelfSetter(self, value)
2418
2588
 
2419
2589
 
2420
- class LuminousFlux(TypedQuantity):
2590
+ class LuminousFlux(FieldQnty):
2421
2591
  """
2422
2592
  Type-safe luminous flux quantity with expression capabilities.
2423
2593
 
@@ -2433,10 +2603,11 @@ class LuminousFlux(TypedQuantity):
2433
2603
 
2434
2604
  Available units: "candela_steradian", "lumen"
2435
2605
  """
2606
+
2436
2607
  __slots__ = ()
2437
2608
  _setter_class = ts.LuminousFluxSetter
2438
- _expected_dimension = dim.LUMINOUS_FLUX
2439
-
2609
+ _dimension = dim.LUMINOUS_FLUX
2610
+
2440
2611
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
2441
2612
  """
2442
2613
  Initialize luminous flux quantity.
@@ -2455,13 +2626,15 @@ class LuminousFlux(TypedQuantity):
2455
2626
  super().__init__(name_or_value, unit, name, is_known=is_known)
2456
2627
  else:
2457
2628
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
2629
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
2458
2630
 
2459
- def set(self, value: int | float) -> ts.LuminousFluxSetter:
2631
+ def set(self, value: float, unit: str | None = None) -> ts.LuminousFluxSetter:
2460
2632
  """
2461
2633
  Create a setter for this luminous flux quantity.
2462
2634
 
2463
2635
  Args:
2464
2636
  value: The numeric value to set
2637
+ unit: Optional unit string (for compatibility with base class)
2465
2638
 
2466
2639
  Returns:
2467
2640
  LuminousFluxSetter: A setter with unit properties like .meters, .inches, etc.
@@ -2473,7 +2646,7 @@ class LuminousFlux(TypedQuantity):
2473
2646
  return ts.LuminousFluxSetter(self, value)
2474
2647
 
2475
2648
 
2476
- class LuminousIntensity(TypedQuantity):
2649
+ class LuminousIntensity(FieldQnty):
2477
2650
  """
2478
2651
  Type-safe luminous intensity quantity with expression capabilities.
2479
2652
 
@@ -2489,10 +2662,11 @@ class LuminousIntensity(TypedQuantity):
2489
2662
 
2490
2663
  Available units: "candela", "candle_international", "carcel"
2491
2664
  """
2665
+
2492
2666
  __slots__ = ()
2493
2667
  _setter_class = ts.LuminousIntensitySetter
2494
- _expected_dimension = dim.LUMINOUS_INTENSITY
2495
-
2668
+ _dimension = dim.LUMINOUS_INTENSITY
2669
+
2496
2670
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
2497
2671
  """
2498
2672
  Initialize luminous intensity quantity.
@@ -2511,13 +2685,15 @@ class LuminousIntensity(TypedQuantity):
2511
2685
  super().__init__(name_or_value, unit, name, is_known=is_known)
2512
2686
  else:
2513
2687
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
2688
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
2514
2689
 
2515
- def set(self, value: int | float) -> ts.LuminousIntensitySetter:
2690
+ def set(self, value: float, unit: str | None = None) -> ts.LuminousIntensitySetter:
2516
2691
  """
2517
2692
  Create a setter for this luminous intensity quantity.
2518
2693
 
2519
2694
  Args:
2520
2695
  value: The numeric value to set
2696
+ unit: Optional unit string (for compatibility with base class)
2521
2697
 
2522
2698
  Returns:
2523
2699
  LuminousIntensitySetter: A setter with unit properties like .meters, .inches, etc.
@@ -2529,7 +2705,7 @@ class LuminousIntensity(TypedQuantity):
2529
2705
  return ts.LuminousIntensitySetter(self, value)
2530
2706
 
2531
2707
 
2532
- class MagneticField(TypedQuantity):
2708
+ class MagneticField(FieldQnty):
2533
2709
  """
2534
2710
  Type-safe magnetic field quantity with expression capabilities.
2535
2711
 
@@ -2545,10 +2721,11 @@ class MagneticField(TypedQuantity):
2545
2721
 
2546
2722
  Available units: "ampere_per_meter", "lenz", "oersted"
2547
2723
  """
2724
+
2548
2725
  __slots__ = ()
2549
2726
  _setter_class = ts.MagneticFieldSetter
2550
- _expected_dimension = dim.MAGNETIC_FIELD
2551
-
2727
+ _dimension = dim.MAGNETIC_FIELD
2728
+
2552
2729
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
2553
2730
  """
2554
2731
  Initialize magnetic field quantity.
@@ -2567,13 +2744,15 @@ class MagneticField(TypedQuantity):
2567
2744
  super().__init__(name_or_value, unit, name, is_known=is_known)
2568
2745
  else:
2569
2746
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
2747
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
2570
2748
 
2571
- def set(self, value: int | float) -> ts.MagneticFieldSetter:
2749
+ def set(self, value: float, unit: str | None = None) -> ts.MagneticFieldSetter:
2572
2750
  """
2573
2751
  Create a setter for this magnetic field quantity.
2574
2752
 
2575
2753
  Args:
2576
2754
  value: The numeric value to set
2755
+ unit: Optional unit string (for compatibility with base class)
2577
2756
 
2578
2757
  Returns:
2579
2758
  MagneticFieldSetter: A setter with unit properties like .meters, .inches, etc.
@@ -2585,7 +2764,7 @@ class MagneticField(TypedQuantity):
2585
2764
  return ts.MagneticFieldSetter(self, value)
2586
2765
 
2587
2766
 
2588
- class MagneticFlux(TypedQuantity):
2767
+ class MagneticFlux(FieldQnty):
2589
2768
  """
2590
2769
  Type-safe magnetic flux quantity with expression capabilities.
2591
2770
 
@@ -2601,10 +2780,11 @@ class MagneticFlux(TypedQuantity):
2601
2780
 
2602
2781
  Available units: "kapp_line", "line", "maxwell"
2603
2782
  """
2783
+
2604
2784
  __slots__ = ()
2605
2785
  _setter_class = ts.MagneticFluxSetter
2606
- _expected_dimension = dim.MAGNETIC_FLUX
2607
-
2786
+ _dimension = dim.MAGNETIC_FLUX
2787
+
2608
2788
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
2609
2789
  """
2610
2790
  Initialize magnetic flux quantity.
@@ -2623,13 +2803,15 @@ class MagneticFlux(TypedQuantity):
2623
2803
  super().__init__(name_or_value, unit, name, is_known=is_known)
2624
2804
  else:
2625
2805
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
2806
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
2626
2807
 
2627
- def set(self, value: int | float) -> ts.MagneticFluxSetter:
2808
+ def set(self, value: float, unit: str | None = None) -> ts.MagneticFluxSetter:
2628
2809
  """
2629
2810
  Create a setter for this magnetic flux quantity.
2630
2811
 
2631
2812
  Args:
2632
2813
  value: The numeric value to set
2814
+ unit: Optional unit string (for compatibility with base class)
2633
2815
 
2634
2816
  Returns:
2635
2817
  MagneticFluxSetter: A setter with unit properties like .meters, .inches, etc.
@@ -2641,7 +2823,7 @@ class MagneticFlux(TypedQuantity):
2641
2823
  return ts.MagneticFluxSetter(self, value)
2642
2824
 
2643
2825
 
2644
- class MagneticInductionFieldStrength(TypedQuantity):
2826
+ class MagneticInductionFieldStrength(FieldQnty):
2645
2827
  """
2646
2828
  Type-safe magnetic induction field strength quantity with expression capabilities.
2647
2829
 
@@ -2657,10 +2839,11 @@ class MagneticInductionFieldStrength(TypedQuantity):
2657
2839
 
2658
2840
  Available units: "gamma", "gauss", "line_per_square_centimeter"
2659
2841
  """
2842
+
2660
2843
  __slots__ = ()
2661
2844
  _setter_class = ts.MagneticInductionFieldStrengthSetter
2662
- _expected_dimension = dim.MAGNETIC_INDUCTION_FIELD_STRENGTH
2663
-
2845
+ _dimension = dim.MAGNETIC_INDUCTION_FIELD_STRENGTH
2846
+
2664
2847
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
2665
2848
  """
2666
2849
  Initialize magnetic induction field strength quantity.
@@ -2679,13 +2862,15 @@ class MagneticInductionFieldStrength(TypedQuantity):
2679
2862
  super().__init__(name_or_value, unit, name, is_known=is_known)
2680
2863
  else:
2681
2864
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
2865
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
2682
2866
 
2683
- def set(self, value: int | float) -> ts.MagneticInductionFieldStrengthSetter:
2867
+ def set(self, value: float, unit: str | None = None) -> ts.MagneticInductionFieldStrengthSetter:
2684
2868
  """
2685
2869
  Create a setter for this magnetic induction field strength quantity.
2686
2870
 
2687
2871
  Args:
2688
2872
  value: The numeric value to set
2873
+ unit: Optional unit string (for compatibility with base class)
2689
2874
 
2690
2875
  Returns:
2691
2876
  MagneticInductionFieldStrengthSetter: A setter with unit properties like .meters, .inches, etc.
@@ -2697,7 +2882,7 @@ class MagneticInductionFieldStrength(TypedQuantity):
2697
2882
  return ts.MagneticInductionFieldStrengthSetter(self, value)
2698
2883
 
2699
2884
 
2700
- class MagneticMoment(TypedQuantity):
2885
+ class MagneticMoment(FieldQnty):
2701
2886
  """
2702
2887
  Type-safe magnetic moment quantity with expression capabilities.
2703
2888
 
@@ -2713,10 +2898,11 @@ class MagneticMoment(TypedQuantity):
2713
2898
 
2714
2899
  Available units: "bohr_magneton", "joule_per_tesla", "nuclear_magneton"
2715
2900
  """
2901
+
2716
2902
  __slots__ = ()
2717
2903
  _setter_class = ts.MagneticMomentSetter
2718
- _expected_dimension = dim.MAGNETIC_MOMENT
2719
-
2904
+ _dimension = dim.MAGNETIC_MOMENT
2905
+
2720
2906
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
2721
2907
  """
2722
2908
  Initialize magnetic moment quantity.
@@ -2735,13 +2921,15 @@ class MagneticMoment(TypedQuantity):
2735
2921
  super().__init__(name_or_value, unit, name, is_known=is_known)
2736
2922
  else:
2737
2923
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
2924
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
2738
2925
 
2739
- def set(self, value: int | float) -> ts.MagneticMomentSetter:
2926
+ def set(self, value: float, unit: str | None = None) -> ts.MagneticMomentSetter:
2740
2927
  """
2741
2928
  Create a setter for this magnetic moment quantity.
2742
2929
 
2743
2930
  Args:
2744
2931
  value: The numeric value to set
2932
+ unit: Optional unit string (for compatibility with base class)
2745
2933
 
2746
2934
  Returns:
2747
2935
  MagneticMomentSetter: A setter with unit properties like .meters, .inches, etc.
@@ -2753,7 +2941,7 @@ class MagneticMoment(TypedQuantity):
2753
2941
  return ts.MagneticMomentSetter(self, value)
2754
2942
 
2755
2943
 
2756
- class MagneticPermeability(TypedQuantity):
2944
+ class MagneticPermeability(FieldQnty):
2757
2945
  """
2758
2946
  Type-safe magnetic permeability quantity with expression capabilities.
2759
2947
 
@@ -2769,10 +2957,11 @@ class MagneticPermeability(TypedQuantity):
2769
2957
 
2770
2958
  Available units: "henrys_per_meter", "newton_per_square_ampere"
2771
2959
  """
2960
+
2772
2961
  __slots__ = ()
2773
2962
  _setter_class = ts.MagneticPermeabilitySetter
2774
- _expected_dimension = dim.MAGNETIC_PERMEABILITY
2775
-
2963
+ _dimension = dim.MAGNETIC_PERMEABILITY
2964
+
2776
2965
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
2777
2966
  """
2778
2967
  Initialize magnetic permeability quantity.
@@ -2791,13 +2980,15 @@ class MagneticPermeability(TypedQuantity):
2791
2980
  super().__init__(name_or_value, unit, name, is_known=is_known)
2792
2981
  else:
2793
2982
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
2983
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
2794
2984
 
2795
- def set(self, value: int | float) -> ts.MagneticPermeabilitySetter:
2985
+ def set(self, value: float, unit: str | None = None) -> ts.MagneticPermeabilitySetter:
2796
2986
  """
2797
2987
  Create a setter for this magnetic permeability quantity.
2798
2988
 
2799
2989
  Args:
2800
2990
  value: The numeric value to set
2991
+ unit: Optional unit string (for compatibility with base class)
2801
2992
 
2802
2993
  Returns:
2803
2994
  MagneticPermeabilitySetter: A setter with unit properties like .meters, .inches, etc.
@@ -2809,7 +3000,7 @@ class MagneticPermeability(TypedQuantity):
2809
3000
  return ts.MagneticPermeabilitySetter(self, value)
2810
3001
 
2811
3002
 
2812
- class MagnetomotiveForce(TypedQuantity):
3003
+ class MagnetomotiveForce(FieldQnty):
2813
3004
  """
2814
3005
  Type-safe magnetomotive force quantity with expression capabilities.
2815
3006
 
@@ -2825,10 +3016,11 @@ class MagnetomotiveForce(TypedQuantity):
2825
3016
 
2826
3017
  Available units: "abampere_turn", "ampere", "ampere_turn"
2827
3018
  """
3019
+
2828
3020
  __slots__ = ()
2829
3021
  _setter_class = ts.MagnetomotiveForceSetter
2830
- _expected_dimension = dim.MAGNETOMOTIVE_FORCE
2831
-
3022
+ _dimension = dim.MAGNETOMOTIVE_FORCE
3023
+
2832
3024
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
2833
3025
  """
2834
3026
  Initialize magnetomotive force quantity.
@@ -2847,13 +3039,15 @@ class MagnetomotiveForce(TypedQuantity):
2847
3039
  super().__init__(name_or_value, unit, name, is_known=is_known)
2848
3040
  else:
2849
3041
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
3042
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
2850
3043
 
2851
- def set(self, value: int | float) -> ts.MagnetomotiveForceSetter:
3044
+ def set(self, value: float, unit: str | None = None) -> ts.MagnetomotiveForceSetter:
2852
3045
  """
2853
3046
  Create a setter for this magnetomotive force quantity.
2854
3047
 
2855
3048
  Args:
2856
3049
  value: The numeric value to set
3050
+ unit: Optional unit string (for compatibility with base class)
2857
3051
 
2858
3052
  Returns:
2859
3053
  MagnetomotiveForceSetter: A setter with unit properties like .meters, .inches, etc.
@@ -2865,7 +3059,7 @@ class MagnetomotiveForce(TypedQuantity):
2865
3059
  return ts.MagnetomotiveForceSetter(self, value)
2866
3060
 
2867
3061
 
2868
- class Mass(TypedQuantity):
3062
+ class Mass(FieldQnty):
2869
3063
  """
2870
3064
  Type-safe mass quantity with expression capabilities.
2871
3065
 
@@ -2881,10 +3075,11 @@ class Mass(TypedQuantity):
2881
3075
 
2882
3076
  Available units: "slug", "atomic_mass_unit_12_mathrmc", "carat_metric"
2883
3077
  """
3078
+
2884
3079
  __slots__ = ()
2885
3080
  _setter_class = ts.MassSetter
2886
- _expected_dimension = dim.MASS
2887
-
3081
+ _dimension = dim.MASS
3082
+
2888
3083
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
2889
3084
  """
2890
3085
  Initialize mass quantity.
@@ -2903,13 +3098,15 @@ class Mass(TypedQuantity):
2903
3098
  super().__init__(name_or_value, unit, name, is_known=is_known)
2904
3099
  else:
2905
3100
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
3101
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
2906
3102
 
2907
- def set(self, value: int | float) -> ts.MassSetter:
3103
+ def set(self, value: float, unit: str | None = None) -> ts.MassSetter:
2908
3104
  """
2909
3105
  Create a setter for this mass quantity.
2910
3106
 
2911
3107
  Args:
2912
3108
  value: The numeric value to set
3109
+ unit: Optional unit string (for compatibility with base class)
2913
3110
 
2914
3111
  Returns:
2915
3112
  MassSetter: A setter with unit properties like .meters, .inches, etc.
@@ -2921,7 +3118,7 @@ class Mass(TypedQuantity):
2921
3118
  return ts.MassSetter(self, value)
2922
3119
 
2923
3120
 
2924
- class MassDensity(TypedQuantity):
3121
+ class MassDensity(FieldQnty):
2925
3122
  """
2926
3123
  Type-safe mass density quantity with expression capabilities.
2927
3124
 
@@ -2937,10 +3134,11 @@ class MassDensity(TypedQuantity):
2937
3134
 
2938
3135
  Available units: "gram_per_cubic_centimeter", "gram_per_cubic_decimeter", "gram_per_cubic_meter"
2939
3136
  """
3137
+
2940
3138
  __slots__ = ()
2941
3139
  _setter_class = ts.MassDensitySetter
2942
- _expected_dimension = dim.MASS_DENSITY
2943
-
3140
+ _dimension = dim.MASS_DENSITY
3141
+
2944
3142
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
2945
3143
  """
2946
3144
  Initialize mass density quantity.
@@ -2959,13 +3157,15 @@ class MassDensity(TypedQuantity):
2959
3157
  super().__init__(name_or_value, unit, name, is_known=is_known)
2960
3158
  else:
2961
3159
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
3160
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
2962
3161
 
2963
- def set(self, value: int | float) -> ts.MassDensitySetter:
3162
+ def set(self, value: float, unit: str | None = None) -> ts.MassDensitySetter:
2964
3163
  """
2965
3164
  Create a setter for this mass density quantity.
2966
3165
 
2967
3166
  Args:
2968
3167
  value: The numeric value to set
3168
+ unit: Optional unit string (for compatibility with base class)
2969
3169
 
2970
3170
  Returns:
2971
3171
  MassDensitySetter: A setter with unit properties like .meters, .inches, etc.
@@ -2977,7 +3177,7 @@ class MassDensity(TypedQuantity):
2977
3177
  return ts.MassDensitySetter(self, value)
2978
3178
 
2979
3179
 
2980
- class MassFlowRate(TypedQuantity):
3180
+ class MassFlowRate(FieldQnty):
2981
3181
  """
2982
3182
  Type-safe mass flow rate quantity with expression capabilities.
2983
3183
 
@@ -2993,10 +3193,11 @@ class MassFlowRate(TypedQuantity):
2993
3193
 
2994
3194
  Available units: "kilograms_per_day", "kilograms_per_hour", "kilograms_per_minute"
2995
3195
  """
3196
+
2996
3197
  __slots__ = ()
2997
3198
  _setter_class = ts.MassFlowRateSetter
2998
- _expected_dimension = dim.MASS_FLOW_RATE
2999
-
3199
+ _dimension = dim.MASS_FLOW_RATE
3200
+
3000
3201
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
3001
3202
  """
3002
3203
  Initialize mass flow rate quantity.
@@ -3015,13 +3216,15 @@ class MassFlowRate(TypedQuantity):
3015
3216
  super().__init__(name_or_value, unit, name, is_known=is_known)
3016
3217
  else:
3017
3218
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
3219
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
3018
3220
 
3019
- def set(self, value: int | float) -> ts.MassFlowRateSetter:
3221
+ def set(self, value: float, unit: str | None = None) -> ts.MassFlowRateSetter:
3020
3222
  """
3021
3223
  Create a setter for this mass flow rate quantity.
3022
3224
 
3023
3225
  Args:
3024
3226
  value: The numeric value to set
3227
+ unit: Optional unit string (for compatibility with base class)
3025
3228
 
3026
3229
  Returns:
3027
3230
  MassFlowRateSetter: A setter with unit properties like .meters, .inches, etc.
@@ -3033,7 +3236,7 @@ class MassFlowRate(TypedQuantity):
3033
3236
  return ts.MassFlowRateSetter(self, value)
3034
3237
 
3035
3238
 
3036
- class MassFlux(TypedQuantity):
3239
+ class MassFlux(FieldQnty):
3037
3240
  """
3038
3241
  Type-safe mass flux quantity with expression capabilities.
3039
3242
 
@@ -3049,10 +3252,11 @@ class MassFlux(TypedQuantity):
3049
3252
 
3050
3253
  Available units: "kilogram_per_square_meter_per_day", "kilogram_per_square_meter_per_hour", "kilogram_per_square_meter_per_minute"
3051
3254
  """
3255
+
3052
3256
  __slots__ = ()
3053
3257
  _setter_class = ts.MassFluxSetter
3054
- _expected_dimension = dim.MASS_FLUX
3055
-
3258
+ _dimension = dim.MASS_FLUX
3259
+
3056
3260
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
3057
3261
  """
3058
3262
  Initialize mass flux quantity.
@@ -3071,13 +3275,15 @@ class MassFlux(TypedQuantity):
3071
3275
  super().__init__(name_or_value, unit, name, is_known=is_known)
3072
3276
  else:
3073
3277
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
3278
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
3074
3279
 
3075
- def set(self, value: int | float) -> ts.MassFluxSetter:
3280
+ def set(self, value: float, unit: str | None = None) -> ts.MassFluxSetter:
3076
3281
  """
3077
3282
  Create a setter for this mass flux quantity.
3078
3283
 
3079
3284
  Args:
3080
3285
  value: The numeric value to set
3286
+ unit: Optional unit string (for compatibility with base class)
3081
3287
 
3082
3288
  Returns:
3083
3289
  MassFluxSetter: A setter with unit properties like .meters, .inches, etc.
@@ -3089,7 +3295,7 @@ class MassFlux(TypedQuantity):
3089
3295
  return ts.MassFluxSetter(self, value)
3090
3296
 
3091
3297
 
3092
- class MassFractionOfI(TypedQuantity):
3298
+ class MassFractionOfI(FieldQnty):
3093
3299
  """
3094
3300
  Type-safe mass fraction of "i" quantity with expression capabilities.
3095
3301
 
@@ -3105,10 +3311,11 @@ class MassFractionOfI(TypedQuantity):
3105
3311
 
3106
3312
  Available units: "grains_of_i_per_pound_total", "gram_of_i_per_kilogram_total", "kilogram_of_i_per_kilogram_total"
3107
3313
  """
3314
+
3108
3315
  __slots__ = ()
3109
3316
  _setter_class = ts.MassFractionOfISetter
3110
- _expected_dimension = dim.MASS_FRACTION_OF_I
3111
-
3317
+ _dimension = dim.MASS_FRACTION_OF_I
3318
+
3112
3319
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
3113
3320
  """
3114
3321
  Initialize mass fraction of "i" quantity.
@@ -3127,13 +3334,15 @@ class MassFractionOfI(TypedQuantity):
3127
3334
  super().__init__(name_or_value, unit, name, is_known=is_known)
3128
3335
  else:
3129
3336
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
3337
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
3130
3338
 
3131
- def set(self, value: int | float) -> ts.MassFractionOfISetter:
3339
+ def set(self, value: float, unit: str | None = None) -> ts.MassFractionOfISetter:
3132
3340
  """
3133
3341
  Create a setter for this mass fraction of "i" quantity.
3134
3342
 
3135
3343
  Args:
3136
3344
  value: The numeric value to set
3345
+ unit: Optional unit string (for compatibility with base class)
3137
3346
 
3138
3347
  Returns:
3139
3348
  MassFractionOfISetter: A setter with unit properties like .meters, .inches, etc.
@@ -3145,7 +3354,7 @@ class MassFractionOfI(TypedQuantity):
3145
3354
  return ts.MassFractionOfISetter(self, value)
3146
3355
 
3147
3356
 
3148
- class MassTransferCoefficient(TypedQuantity):
3357
+ class MassTransferCoefficient(FieldQnty):
3149
3358
  """
3150
3359
  Type-safe mass transfer coefficient quantity with expression capabilities.
3151
3360
 
@@ -3161,10 +3370,11 @@ class MassTransferCoefficient(TypedQuantity):
3161
3370
 
3162
3371
  Available units: "gram_per_square_centimeter_per_second", "kilogram_per_square_meter_per_second", "pounds_force_per_cubic_foot_per_hour"
3163
3372
  """
3373
+
3164
3374
  __slots__ = ()
3165
3375
  _setter_class = ts.MassTransferCoefficientSetter
3166
- _expected_dimension = dim.MASS_TRANSFER_COEFFICIENT
3167
-
3376
+ _dimension = dim.MASS_TRANSFER_COEFFICIENT
3377
+
3168
3378
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
3169
3379
  """
3170
3380
  Initialize mass transfer coefficient quantity.
@@ -3183,13 +3393,15 @@ class MassTransferCoefficient(TypedQuantity):
3183
3393
  super().__init__(name_or_value, unit, name, is_known=is_known)
3184
3394
  else:
3185
3395
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
3396
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
3186
3397
 
3187
- def set(self, value: int | float) -> ts.MassTransferCoefficientSetter:
3398
+ def set(self, value: float, unit: str | None = None) -> ts.MassTransferCoefficientSetter:
3188
3399
  """
3189
3400
  Create a setter for this mass transfer coefficient quantity.
3190
3401
 
3191
3402
  Args:
3192
3403
  value: The numeric value to set
3404
+ unit: Optional unit string (for compatibility with base class)
3193
3405
 
3194
3406
  Returns:
3195
3407
  MassTransferCoefficientSetter: A setter with unit properties like .meters, .inches, etc.
@@ -3201,7 +3413,7 @@ class MassTransferCoefficient(TypedQuantity):
3201
3413
  return ts.MassTransferCoefficientSetter(self, value)
3202
3414
 
3203
3415
 
3204
- class MolalityOfSoluteI(TypedQuantity):
3416
+ class MolalityOfSoluteI(FieldQnty):
3205
3417
  """
3206
3418
  Type-safe molality of solute "i" quantity with expression capabilities.
3207
3419
 
@@ -3217,10 +3429,11 @@ class MolalityOfSoluteI(TypedQuantity):
3217
3429
 
3218
3430
  Available units: "gram_moles_of_i_per_kilogram", "kilogram_mols_of_i_per_kilogram", "kmols_of_i_per_kilogram"
3219
3431
  """
3432
+
3220
3433
  __slots__ = ()
3221
3434
  _setter_class = ts.MolalityOfSoluteISetter
3222
- _expected_dimension = dim.MOLALITY_OF_SOLUTE_I
3223
-
3435
+ _dimension = dim.MOLALITY_OF_SOLUTE_I
3436
+
3224
3437
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
3225
3438
  """
3226
3439
  Initialize molality of solute "i" quantity.
@@ -3239,13 +3452,15 @@ class MolalityOfSoluteI(TypedQuantity):
3239
3452
  super().__init__(name_or_value, unit, name, is_known=is_known)
3240
3453
  else:
3241
3454
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
3455
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
3242
3456
 
3243
- def set(self, value: int | float) -> ts.MolalityOfSoluteISetter:
3457
+ def set(self, value: float, unit: str | None = None) -> ts.MolalityOfSoluteISetter:
3244
3458
  """
3245
3459
  Create a setter for this molality of solute "i" quantity.
3246
3460
 
3247
3461
  Args:
3248
3462
  value: The numeric value to set
3463
+ unit: Optional unit string (for compatibility with base class)
3249
3464
 
3250
3465
  Returns:
3251
3466
  MolalityOfSoluteISetter: A setter with unit properties like .meters, .inches, etc.
@@ -3257,7 +3472,7 @@ class MolalityOfSoluteI(TypedQuantity):
3257
3472
  return ts.MolalityOfSoluteISetter(self, value)
3258
3473
 
3259
3474
 
3260
- class MolarConcentrationByMass(TypedQuantity):
3475
+ class MolarConcentrationByMass(FieldQnty):
3261
3476
  """
3262
3477
  Type-safe molar concentration by mass quantity with expression capabilities.
3263
3478
 
@@ -3273,10 +3488,11 @@ class MolarConcentrationByMass(TypedQuantity):
3273
3488
 
3274
3489
  Available units: "gram_mole_or_mole_per_gram", "gram_mole_or_mole_per_kilogram", "kilogram_mole_or_kmol_per_kilogram"
3275
3490
  """
3491
+
3276
3492
  __slots__ = ()
3277
3493
  _setter_class = ts.MolarConcentrationByMassSetter
3278
- _expected_dimension = dim.MOLAR_CONCENTRATION_BY_MASS
3279
-
3494
+ _dimension = dim.MOLAR_CONCENTRATION_BY_MASS
3495
+
3280
3496
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
3281
3497
  """
3282
3498
  Initialize molar concentration by mass quantity.
@@ -3295,13 +3511,15 @@ class MolarConcentrationByMass(TypedQuantity):
3295
3511
  super().__init__(name_or_value, unit, name, is_known=is_known)
3296
3512
  else:
3297
3513
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
3514
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
3298
3515
 
3299
- def set(self, value: int | float) -> ts.MolarConcentrationByMassSetter:
3516
+ def set(self, value: float, unit: str | None = None) -> ts.MolarConcentrationByMassSetter:
3300
3517
  """
3301
3518
  Create a setter for this molar concentration by mass quantity.
3302
3519
 
3303
3520
  Args:
3304
3521
  value: The numeric value to set
3522
+ unit: Optional unit string (for compatibility with base class)
3305
3523
 
3306
3524
  Returns:
3307
3525
  MolarConcentrationByMassSetter: A setter with unit properties like .meters, .inches, etc.
@@ -3313,7 +3531,7 @@ class MolarConcentrationByMass(TypedQuantity):
3313
3531
  return ts.MolarConcentrationByMassSetter(self, value)
3314
3532
 
3315
3533
 
3316
- class MolarFlowRate(TypedQuantity):
3534
+ class MolarFlowRate(FieldQnty):
3317
3535
  """
3318
3536
  Type-safe molar flow rate quantity with expression capabilities.
3319
3537
 
@@ -3329,10 +3547,11 @@ class MolarFlowRate(TypedQuantity):
3329
3547
 
3330
3548
  Available units: "gram_mole_per_day", "gram_mole_per_hour", "gram_mole_per_minute"
3331
3549
  """
3550
+
3332
3551
  __slots__ = ()
3333
3552
  _setter_class = ts.MolarFlowRateSetter
3334
- _expected_dimension = dim.MOLAR_FLOW_RATE
3335
-
3553
+ _dimension = dim.MOLAR_FLOW_RATE
3554
+
3336
3555
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
3337
3556
  """
3338
3557
  Initialize molar flow rate quantity.
@@ -3351,13 +3570,15 @@ class MolarFlowRate(TypedQuantity):
3351
3570
  super().__init__(name_or_value, unit, name, is_known=is_known)
3352
3571
  else:
3353
3572
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
3573
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
3354
3574
 
3355
- def set(self, value: int | float) -> ts.MolarFlowRateSetter:
3575
+ def set(self, value: float, unit: str | None = None) -> ts.MolarFlowRateSetter:
3356
3576
  """
3357
3577
  Create a setter for this molar flow rate quantity.
3358
3578
 
3359
3579
  Args:
3360
3580
  value: The numeric value to set
3581
+ unit: Optional unit string (for compatibility with base class)
3361
3582
 
3362
3583
  Returns:
3363
3584
  MolarFlowRateSetter: A setter with unit properties like .meters, .inches, etc.
@@ -3369,7 +3590,7 @@ class MolarFlowRate(TypedQuantity):
3369
3590
  return ts.MolarFlowRateSetter(self, value)
3370
3591
 
3371
3592
 
3372
- class MolarFlux(TypedQuantity):
3593
+ class MolarFlux(FieldQnty):
3373
3594
  """
3374
3595
  Type-safe molar flux quantity with expression capabilities.
3375
3596
 
@@ -3385,10 +3606,11 @@ class MolarFlux(TypedQuantity):
3385
3606
 
3386
3607
  Available units: "kmol_per_square_meter_per_day", "kmol_per_square_meter_per_hour", "kmol_per_square_meter_per_minute"
3387
3608
  """
3609
+
3388
3610
  __slots__ = ()
3389
3611
  _setter_class = ts.MolarFluxSetter
3390
- _expected_dimension = dim.MOLAR_FLUX
3391
-
3612
+ _dimension = dim.MOLAR_FLUX
3613
+
3392
3614
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
3393
3615
  """
3394
3616
  Initialize molar flux quantity.
@@ -3407,13 +3629,15 @@ class MolarFlux(TypedQuantity):
3407
3629
  super().__init__(name_or_value, unit, name, is_known=is_known)
3408
3630
  else:
3409
3631
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
3632
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
3410
3633
 
3411
- def set(self, value: int | float) -> ts.MolarFluxSetter:
3634
+ def set(self, value: float, unit: str | None = None) -> ts.MolarFluxSetter:
3412
3635
  """
3413
3636
  Create a setter for this molar flux quantity.
3414
3637
 
3415
3638
  Args:
3416
3639
  value: The numeric value to set
3640
+ unit: Optional unit string (for compatibility with base class)
3417
3641
 
3418
3642
  Returns:
3419
3643
  MolarFluxSetter: A setter with unit properties like .meters, .inches, etc.
@@ -3425,7 +3649,7 @@ class MolarFlux(TypedQuantity):
3425
3649
  return ts.MolarFluxSetter(self, value)
3426
3650
 
3427
3651
 
3428
- class MolarHeatCapacity(TypedQuantity):
3652
+ class MolarHeatCapacity(FieldQnty):
3429
3653
  """
3430
3654
  Type-safe molar heat capacity quantity with expression capabilities.
3431
3655
 
@@ -3441,10 +3665,11 @@ class MolarHeatCapacity(TypedQuantity):
3441
3665
 
3442
3666
  Available units: "btu_per_pound_mole_per_degree_fahrenheit_or_degree_rankine", "calories_per_gram_mole_per_kelvin_or_degree_celsius", "joule_per_gram_mole_per_kelvin_or_degree_celsius"
3443
3667
  """
3668
+
3444
3669
  __slots__ = ()
3445
3670
  _setter_class = ts.MolarHeatCapacitySetter
3446
- _expected_dimension = dim.MOLAR_HEAT_CAPACITY
3447
-
3671
+ _dimension = dim.MOLAR_HEAT_CAPACITY
3672
+
3448
3673
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
3449
3674
  """
3450
3675
  Initialize molar heat capacity quantity.
@@ -3463,13 +3688,15 @@ class MolarHeatCapacity(TypedQuantity):
3463
3688
  super().__init__(name_or_value, unit, name, is_known=is_known)
3464
3689
  else:
3465
3690
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
3691
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
3466
3692
 
3467
- def set(self, value: int | float) -> ts.MolarHeatCapacitySetter:
3693
+ def set(self, value: float, unit: str | None = None) -> ts.MolarHeatCapacitySetter:
3468
3694
  """
3469
3695
  Create a setter for this molar heat capacity quantity.
3470
3696
 
3471
3697
  Args:
3472
3698
  value: The numeric value to set
3699
+ unit: Optional unit string (for compatibility with base class)
3473
3700
 
3474
3701
  Returns:
3475
3702
  MolarHeatCapacitySetter: A setter with unit properties like .meters, .inches, etc.
@@ -3481,7 +3708,7 @@ class MolarHeatCapacity(TypedQuantity):
3481
3708
  return ts.MolarHeatCapacitySetter(self, value)
3482
3709
 
3483
3710
 
3484
- class MolarityOfI(TypedQuantity):
3711
+ class MolarityOfI(FieldQnty):
3485
3712
  """
3486
3713
  Type-safe molarity of "i" quantity with expression capabilities.
3487
3714
 
@@ -3497,10 +3724,11 @@ class MolarityOfI(TypedQuantity):
3497
3724
 
3498
3725
  Available units: "gram_moles_of_i_per_cubic_meter", "gram_moles_of_i_per_liter", "kilogram_moles_of_i_per_cubic_meter"
3499
3726
  """
3727
+
3500
3728
  __slots__ = ()
3501
3729
  _setter_class = ts.MolarityOfISetter
3502
- _expected_dimension = dim.MOLARITY_OF_I
3503
-
3730
+ _dimension = dim.MOLARITY_OF_I
3731
+
3504
3732
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
3505
3733
  """
3506
3734
  Initialize molarity of "i" quantity.
@@ -3519,13 +3747,15 @@ class MolarityOfI(TypedQuantity):
3519
3747
  super().__init__(name_or_value, unit, name, is_known=is_known)
3520
3748
  else:
3521
3749
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
3750
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
3522
3751
 
3523
- def set(self, value: int | float) -> ts.MolarityOfISetter:
3752
+ def set(self, value: float, unit: str | None = None) -> ts.MolarityOfISetter:
3524
3753
  """
3525
3754
  Create a setter for this molarity of "i" quantity.
3526
3755
 
3527
3756
  Args:
3528
3757
  value: The numeric value to set
3758
+ unit: Optional unit string (for compatibility with base class)
3529
3759
 
3530
3760
  Returns:
3531
3761
  MolarityOfISetter: A setter with unit properties like .meters, .inches, etc.
@@ -3537,7 +3767,7 @@ class MolarityOfI(TypedQuantity):
3537
3767
  return ts.MolarityOfISetter(self, value)
3538
3768
 
3539
3769
 
3540
- class MoleFractionOfI(TypedQuantity):
3770
+ class MoleFractionOfI(FieldQnty):
3541
3771
  """
3542
3772
  Type-safe mole fraction of "i" quantity with expression capabilities.
3543
3773
 
@@ -3553,10 +3783,11 @@ class MoleFractionOfI(TypedQuantity):
3553
3783
 
3554
3784
  Available units: "gram_mole_of_i_per_gram_mole_total", "kilogram_mole_of_i_per_kilogram_mole_total", "kilomole_of_i_per_kilomole_total"
3555
3785
  """
3786
+
3556
3787
  __slots__ = ()
3557
3788
  _setter_class = ts.MoleFractionOfISetter
3558
- _expected_dimension = dim.MOLE_FRACTION_OF_I
3559
-
3789
+ _dimension = dim.MOLE_FRACTION_OF_I
3790
+
3560
3791
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
3561
3792
  """
3562
3793
  Initialize mole fraction of "i" quantity.
@@ -3575,13 +3806,15 @@ class MoleFractionOfI(TypedQuantity):
3575
3806
  super().__init__(name_or_value, unit, name, is_known=is_known)
3576
3807
  else:
3577
3808
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
3809
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
3578
3810
 
3579
- def set(self, value: int | float) -> ts.MoleFractionOfISetter:
3811
+ def set(self, value: float, unit: str | None = None) -> ts.MoleFractionOfISetter:
3580
3812
  """
3581
3813
  Create a setter for this mole fraction of "i" quantity.
3582
3814
 
3583
3815
  Args:
3584
3816
  value: The numeric value to set
3817
+ unit: Optional unit string (for compatibility with base class)
3585
3818
 
3586
3819
  Returns:
3587
3820
  MoleFractionOfISetter: A setter with unit properties like .meters, .inches, etc.
@@ -3593,7 +3826,7 @@ class MoleFractionOfI(TypedQuantity):
3593
3826
  return ts.MoleFractionOfISetter(self, value)
3594
3827
 
3595
3828
 
3596
- class MomentOfInertia(TypedQuantity):
3829
+ class MomentOfInertia(FieldQnty):
3597
3830
  """
3598
3831
  Type-safe moment of inertia quantity with expression capabilities.
3599
3832
 
@@ -3609,10 +3842,11 @@ class MomentOfInertia(TypedQuantity):
3609
3842
 
3610
3843
  Available units: "gram_force_centimeter_square_second", "gram_square_centimeter", "kilogram_force_centimeter_square_second"
3611
3844
  """
3845
+
3612
3846
  __slots__ = ()
3613
3847
  _setter_class = ts.MomentOfInertiaSetter
3614
- _expected_dimension = dim.MOMENT_OF_INERTIA
3615
-
3848
+ _dimension = dim.MOMENT_OF_INERTIA
3849
+
3616
3850
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
3617
3851
  """
3618
3852
  Initialize moment of inertia quantity.
@@ -3631,13 +3865,15 @@ class MomentOfInertia(TypedQuantity):
3631
3865
  super().__init__(name_or_value, unit, name, is_known=is_known)
3632
3866
  else:
3633
3867
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
3868
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
3634
3869
 
3635
- def set(self, value: int | float) -> ts.MomentOfInertiaSetter:
3870
+ def set(self, value: float, unit: str | None = None) -> ts.MomentOfInertiaSetter:
3636
3871
  """
3637
3872
  Create a setter for this moment of inertia quantity.
3638
3873
 
3639
3874
  Args:
3640
3875
  value: The numeric value to set
3876
+ unit: Optional unit string (for compatibility with base class)
3641
3877
 
3642
3878
  Returns:
3643
3879
  MomentOfInertiaSetter: A setter with unit properties like .meters, .inches, etc.
@@ -3649,7 +3885,7 @@ class MomentOfInertia(TypedQuantity):
3649
3885
  return ts.MomentOfInertiaSetter(self, value)
3650
3886
 
3651
3887
 
3652
- class MomentumFlowRate(TypedQuantity):
3888
+ class MomentumFlowRate(FieldQnty):
3653
3889
  """
3654
3890
  Type-safe momentum flow rate quantity with expression capabilities.
3655
3891
 
@@ -3665,10 +3901,11 @@ class MomentumFlowRate(TypedQuantity):
3665
3901
 
3666
3902
  Available units: "foot_pounds_per_square_hour", "foot_pounds_per_square_minute", "foot_pounds_per_square_second"
3667
3903
  """
3904
+
3668
3905
  __slots__ = ()
3669
3906
  _setter_class = ts.MomentumFlowRateSetter
3670
- _expected_dimension = dim.MOMENTUM_FLOW_RATE
3671
-
3907
+ _dimension = dim.MOMENTUM_FLOW_RATE
3908
+
3672
3909
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
3673
3910
  """
3674
3911
  Initialize momentum flow rate quantity.
@@ -3687,13 +3924,15 @@ class MomentumFlowRate(TypedQuantity):
3687
3924
  super().__init__(name_or_value, unit, name, is_known=is_known)
3688
3925
  else:
3689
3926
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
3927
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
3690
3928
 
3691
- def set(self, value: int | float) -> ts.MomentumFlowRateSetter:
3929
+ def set(self, value: float, unit: str | None = None) -> ts.MomentumFlowRateSetter:
3692
3930
  """
3693
3931
  Create a setter for this momentum flow rate quantity.
3694
3932
 
3695
3933
  Args:
3696
3934
  value: The numeric value to set
3935
+ unit: Optional unit string (for compatibility with base class)
3697
3936
 
3698
3937
  Returns:
3699
3938
  MomentumFlowRateSetter: A setter with unit properties like .meters, .inches, etc.
@@ -3705,7 +3944,7 @@ class MomentumFlowRate(TypedQuantity):
3705
3944
  return ts.MomentumFlowRateSetter(self, value)
3706
3945
 
3707
3946
 
3708
- class MomentumFlux(TypedQuantity):
3947
+ class MomentumFlux(FieldQnty):
3709
3948
  """
3710
3949
  Type-safe momentum flux quantity with expression capabilities.
3711
3950
 
@@ -3721,10 +3960,11 @@ class MomentumFlux(TypedQuantity):
3721
3960
 
3722
3961
  Available units: "dyne_per_square_centimeter", "gram_per_centimeter_per_square_second", "newton_per_square_meter"
3723
3962
  """
3963
+
3724
3964
  __slots__ = ()
3725
3965
  _setter_class = ts.MomentumFluxSetter
3726
- _expected_dimension = dim.MOMENTUM_FLUX
3727
-
3966
+ _dimension = dim.MOMENTUM_FLUX
3967
+
3728
3968
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
3729
3969
  """
3730
3970
  Initialize momentum flux quantity.
@@ -3743,13 +3983,15 @@ class MomentumFlux(TypedQuantity):
3743
3983
  super().__init__(name_or_value, unit, name, is_known=is_known)
3744
3984
  else:
3745
3985
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
3986
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
3746
3987
 
3747
- def set(self, value: int | float) -> ts.MomentumFluxSetter:
3988
+ def set(self, value: float, unit: str | None = None) -> ts.MomentumFluxSetter:
3748
3989
  """
3749
3990
  Create a setter for this momentum flux quantity.
3750
3991
 
3751
3992
  Args:
3752
3993
  value: The numeric value to set
3994
+ unit: Optional unit string (for compatibility with base class)
3753
3995
 
3754
3996
  Returns:
3755
3997
  MomentumFluxSetter: A setter with unit properties like .meters, .inches, etc.
@@ -3761,7 +4003,7 @@ class MomentumFlux(TypedQuantity):
3761
4003
  return ts.MomentumFluxSetter(self, value)
3762
4004
 
3763
4005
 
3764
- class NormalityOfSolution(TypedQuantity):
4006
+ class NormalityOfSolution(FieldQnty):
3765
4007
  """
3766
4008
  Type-safe normality of solution quantity with expression capabilities.
3767
4009
 
@@ -3777,10 +4019,11 @@ class NormalityOfSolution(TypedQuantity):
3777
4019
 
3778
4020
  Available units: "gram_equivalents_per_cubic_meter", "gram_equivalents_per_liter", "pound_equivalents_per_cubic_foot"
3779
4021
  """
4022
+
3780
4023
  __slots__ = ()
3781
4024
  _setter_class = ts.NormalityOfSolutionSetter
3782
- _expected_dimension = dim.NORMALITY_OF_SOLUTION
3783
-
4025
+ _dimension = dim.NORMALITY_OF_SOLUTION
4026
+
3784
4027
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
3785
4028
  """
3786
4029
  Initialize normality of solution quantity.
@@ -3799,13 +4042,15 @@ class NormalityOfSolution(TypedQuantity):
3799
4042
  super().__init__(name_or_value, unit, name, is_known=is_known)
3800
4043
  else:
3801
4044
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
4045
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
3802
4046
 
3803
- def set(self, value: int | float) -> ts.NormalityOfSolutionSetter:
4047
+ def set(self, value: float, unit: str | None = None) -> ts.NormalityOfSolutionSetter:
3804
4048
  """
3805
4049
  Create a setter for this normality of solution quantity.
3806
4050
 
3807
4051
  Args:
3808
4052
  value: The numeric value to set
4053
+ unit: Optional unit string (for compatibility with base class)
3809
4054
 
3810
4055
  Returns:
3811
4056
  NormalityOfSolutionSetter: A setter with unit properties like .meters, .inches, etc.
@@ -3817,7 +4062,7 @@ class NormalityOfSolution(TypedQuantity):
3817
4062
  return ts.NormalityOfSolutionSetter(self, value)
3818
4063
 
3819
4064
 
3820
- class ParticleDensity(TypedQuantity):
4065
+ class ParticleDensity(FieldQnty):
3821
4066
  """
3822
4067
  Type-safe particle density quantity with expression capabilities.
3823
4068
 
@@ -3833,10 +4078,11 @@ class ParticleDensity(TypedQuantity):
3833
4078
 
3834
4079
  Available units: "particles_per_cubic_centimeter", "particles_per_cubic_foot", "particles_per_cubic_meter"
3835
4080
  """
4081
+
3836
4082
  __slots__ = ()
3837
4083
  _setter_class = ts.ParticleDensitySetter
3838
- _expected_dimension = dim.PARTICLE_DENSITY
3839
-
4084
+ _dimension = dim.PARTICLE_DENSITY
4085
+
3840
4086
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
3841
4087
  """
3842
4088
  Initialize particle density quantity.
@@ -3855,13 +4101,15 @@ class ParticleDensity(TypedQuantity):
3855
4101
  super().__init__(name_or_value, unit, name, is_known=is_known)
3856
4102
  else:
3857
4103
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
4104
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
3858
4105
 
3859
- def set(self, value: int | float) -> ts.ParticleDensitySetter:
4106
+ def set(self, value: float, unit: str | None = None) -> ts.ParticleDensitySetter:
3860
4107
  """
3861
4108
  Create a setter for this particle density quantity.
3862
4109
 
3863
4110
  Args:
3864
4111
  value: The numeric value to set
4112
+ unit: Optional unit string (for compatibility with base class)
3865
4113
 
3866
4114
  Returns:
3867
4115
  ParticleDensitySetter: A setter with unit properties like .meters, .inches, etc.
@@ -3873,7 +4121,7 @@ class ParticleDensity(TypedQuantity):
3873
4121
  return ts.ParticleDensitySetter(self, value)
3874
4122
 
3875
4123
 
3876
- class Percent(TypedQuantity):
4124
+ class Percent(FieldQnty):
3877
4125
  """
3878
4126
  Type-safe percent quantity with expression capabilities.
3879
4127
 
@@ -3889,10 +4137,11 @@ class Percent(TypedQuantity):
3889
4137
 
3890
4138
  Available units: "percent", "per_mille", "basis_point"
3891
4139
  """
4140
+
3892
4141
  __slots__ = ()
3893
4142
  _setter_class = ts.PercentSetter
3894
- _expected_dimension = dim.PERCENT
3895
-
4143
+ _dimension = dim.PERCENT
4144
+
3896
4145
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
3897
4146
  """
3898
4147
  Initialize percent quantity.
@@ -3911,13 +4160,15 @@ class Percent(TypedQuantity):
3911
4160
  super().__init__(name_or_value, unit, name, is_known=is_known)
3912
4161
  else:
3913
4162
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
4163
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
3914
4164
 
3915
- def set(self, value: int | float) -> ts.PercentSetter:
4165
+ def set(self, value: float, unit: str | None = None) -> ts.PercentSetter:
3916
4166
  """
3917
4167
  Create a setter for this percent quantity.
3918
4168
 
3919
4169
  Args:
3920
4170
  value: The numeric value to set
4171
+ unit: Optional unit string (for compatibility with base class)
3921
4172
 
3922
4173
  Returns:
3923
4174
  PercentSetter: A setter with unit properties like .meters, .inches, etc.
@@ -3929,7 +4180,7 @@ class Percent(TypedQuantity):
3929
4180
  return ts.PercentSetter(self, value)
3930
4181
 
3931
4182
 
3932
- class Permeability(TypedQuantity):
4183
+ class Permeability(FieldQnty):
3933
4184
  """
3934
4185
  Type-safe permeability quantity with expression capabilities.
3935
4186
 
@@ -3945,10 +4196,11 @@ class Permeability(TypedQuantity):
3945
4196
 
3946
4197
  Available units: "darcy", "square_feet", "square_meters"
3947
4198
  """
4199
+
3948
4200
  __slots__ = ()
3949
4201
  _setter_class = ts.PermeabilitySetter
3950
- _expected_dimension = dim.PERMEABILITY
3951
-
4202
+ _dimension = dim.PERMEABILITY
4203
+
3952
4204
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
3953
4205
  """
3954
4206
  Initialize permeability quantity.
@@ -3967,13 +4219,15 @@ class Permeability(TypedQuantity):
3967
4219
  super().__init__(name_or_value, unit, name, is_known=is_known)
3968
4220
  else:
3969
4221
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
4222
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
3970
4223
 
3971
- def set(self, value: int | float) -> ts.PermeabilitySetter:
4224
+ def set(self, value: float, unit: str | None = None) -> ts.PermeabilitySetter:
3972
4225
  """
3973
4226
  Create a setter for this permeability quantity.
3974
4227
 
3975
4228
  Args:
3976
4229
  value: The numeric value to set
4230
+ unit: Optional unit string (for compatibility with base class)
3977
4231
 
3978
4232
  Returns:
3979
4233
  PermeabilitySetter: A setter with unit properties like .meters, .inches, etc.
@@ -3985,7 +4239,7 @@ class Permeability(TypedQuantity):
3985
4239
  return ts.PermeabilitySetter(self, value)
3986
4240
 
3987
4241
 
3988
- class PhotonEmissionRate(TypedQuantity):
4242
+ class PhotonEmissionRate(FieldQnty):
3989
4243
  """
3990
4244
  Type-safe photon emission rate quantity with expression capabilities.
3991
4245
 
@@ -4001,10 +4255,11 @@ class PhotonEmissionRate(TypedQuantity):
4001
4255
 
4002
4256
  Available units: "rayleigh", "reciprocal_square_meter_second"
4003
4257
  """
4258
+
4004
4259
  __slots__ = ()
4005
4260
  _setter_class = ts.PhotonEmissionRateSetter
4006
- _expected_dimension = dim.PHOTON_EMISSION_RATE
4007
-
4261
+ _dimension = dim.PHOTON_EMISSION_RATE
4262
+
4008
4263
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
4009
4264
  """
4010
4265
  Initialize photon emission rate quantity.
@@ -4023,13 +4278,15 @@ class PhotonEmissionRate(TypedQuantity):
4023
4278
  super().__init__(name_or_value, unit, name, is_known=is_known)
4024
4279
  else:
4025
4280
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
4281
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
4026
4282
 
4027
- def set(self, value: int | float) -> ts.PhotonEmissionRateSetter:
4283
+ def set(self, value: float, unit: str | None = None) -> ts.PhotonEmissionRateSetter:
4028
4284
  """
4029
4285
  Create a setter for this photon emission rate quantity.
4030
4286
 
4031
4287
  Args:
4032
4288
  value: The numeric value to set
4289
+ unit: Optional unit string (for compatibility with base class)
4033
4290
 
4034
4291
  Returns:
4035
4292
  PhotonEmissionRateSetter: A setter with unit properties like .meters, .inches, etc.
@@ -4041,7 +4298,7 @@ class PhotonEmissionRate(TypedQuantity):
4041
4298
  return ts.PhotonEmissionRateSetter(self, value)
4042
4299
 
4043
4300
 
4044
- class PowerPerUnitMass(TypedQuantity):
4301
+ class PowerPerUnitMass(FieldQnty):
4045
4302
  """
4046
4303
  Type-safe power per unit mass or specific power quantity with expression capabilities.
4047
4304
 
@@ -4057,10 +4314,11 @@ class PowerPerUnitMass(TypedQuantity):
4057
4314
 
4058
4315
  Available units: "british_thermal_unit_per_hour_per_pound_mass", "calorie_per_second_per_gram", "kilocalorie_per_hour_per_kilogram"
4059
4316
  """
4317
+
4060
4318
  __slots__ = ()
4061
4319
  _setter_class = ts.PowerPerUnitMassSetter
4062
- _expected_dimension = dim.POWER_PER_UNIT_MASS
4063
-
4320
+ _dimension = dim.POWER_PER_UNIT_MASS
4321
+
4064
4322
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
4065
4323
  """
4066
4324
  Initialize power per unit mass or specific power quantity.
@@ -4079,13 +4337,15 @@ class PowerPerUnitMass(TypedQuantity):
4079
4337
  super().__init__(name_or_value, unit, name, is_known=is_known)
4080
4338
  else:
4081
4339
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
4340
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
4082
4341
 
4083
- def set(self, value: int | float) -> ts.PowerPerUnitMassSetter:
4342
+ def set(self, value: float, unit: str | None = None) -> ts.PowerPerUnitMassSetter:
4084
4343
  """
4085
4344
  Create a setter for this power per unit mass or specific power quantity.
4086
4345
 
4087
4346
  Args:
4088
4347
  value: The numeric value to set
4348
+ unit: Optional unit string (for compatibility with base class)
4089
4349
 
4090
4350
  Returns:
4091
4351
  PowerPerUnitMassSetter: A setter with unit properties like .meters, .inches, etc.
@@ -4097,7 +4357,7 @@ class PowerPerUnitMass(TypedQuantity):
4097
4357
  return ts.PowerPerUnitMassSetter(self, value)
4098
4358
 
4099
4359
 
4100
- class PowerPerUnitVolume(TypedQuantity):
4360
+ class PowerPerUnitVolume(FieldQnty):
4101
4361
  """
4102
4362
  Type-safe power per unit volume or power density quantity with expression capabilities.
4103
4363
 
@@ -4113,10 +4373,11 @@ class PowerPerUnitVolume(TypedQuantity):
4113
4373
 
4114
4374
  Available units: "british_thermal_unit_per_hour_per_cubic_foot", "calorie_per_second_per_cubic_centimeter", "chu_per_hour_per_cubic_foot"
4115
4375
  """
4376
+
4116
4377
  __slots__ = ()
4117
4378
  _setter_class = ts.PowerPerUnitVolumeSetter
4118
- _expected_dimension = dim.POWER_PER_UNIT_VOLUME
4119
-
4379
+ _dimension = dim.POWER_PER_UNIT_VOLUME
4380
+
4120
4381
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
4121
4382
  """
4122
4383
  Initialize power per unit volume or power density quantity.
@@ -4135,13 +4396,15 @@ class PowerPerUnitVolume(TypedQuantity):
4135
4396
  super().__init__(name_or_value, unit, name, is_known=is_known)
4136
4397
  else:
4137
4398
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
4399
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
4138
4400
 
4139
- def set(self, value: int | float) -> ts.PowerPerUnitVolumeSetter:
4401
+ def set(self, value: float, unit: str | None = None) -> ts.PowerPerUnitVolumeSetter:
4140
4402
  """
4141
4403
  Create a setter for this power per unit volume or power density quantity.
4142
4404
 
4143
4405
  Args:
4144
4406
  value: The numeric value to set
4407
+ unit: Optional unit string (for compatibility with base class)
4145
4408
 
4146
4409
  Returns:
4147
4410
  PowerPerUnitVolumeSetter: A setter with unit properties like .meters, .inches, etc.
@@ -4153,7 +4416,7 @@ class PowerPerUnitVolume(TypedQuantity):
4153
4416
  return ts.PowerPerUnitVolumeSetter(self, value)
4154
4417
 
4155
4418
 
4156
- class PowerThermalDuty(TypedQuantity):
4419
+ class PowerThermalDuty(FieldQnty):
4157
4420
  """
4158
4421
  Type-safe power, thermal duty quantity with expression capabilities.
4159
4422
 
@@ -4169,10 +4432,11 @@ class PowerThermalDuty(TypedQuantity):
4169
4432
 
4170
4433
  Available units: "abwatt_emu_of_power", "boiler_horsepower", "british_thermal_unit_mean"
4171
4434
  """
4435
+
4172
4436
  __slots__ = ()
4173
4437
  _setter_class = ts.PowerThermalDutySetter
4174
- _expected_dimension = dim.POWER_THERMAL_DUTY
4175
-
4438
+ _dimension = dim.POWER_THERMAL_DUTY
4439
+
4176
4440
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
4177
4441
  """
4178
4442
  Initialize power, thermal duty quantity.
@@ -4191,13 +4455,15 @@ class PowerThermalDuty(TypedQuantity):
4191
4455
  super().__init__(name_or_value, unit, name, is_known=is_known)
4192
4456
  else:
4193
4457
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
4458
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
4194
4459
 
4195
- def set(self, value: int | float) -> ts.PowerThermalDutySetter:
4460
+ def set(self, value: float, unit: str | None = None) -> ts.PowerThermalDutySetter:
4196
4461
  """
4197
4462
  Create a setter for this power, thermal duty quantity.
4198
4463
 
4199
4464
  Args:
4200
4465
  value: The numeric value to set
4466
+ unit: Optional unit string (for compatibility with base class)
4201
4467
 
4202
4468
  Returns:
4203
4469
  PowerThermalDutySetter: A setter with unit properties like .meters, .inches, etc.
@@ -4209,7 +4475,7 @@ class PowerThermalDuty(TypedQuantity):
4209
4475
  return ts.PowerThermalDutySetter(self, value)
4210
4476
 
4211
4477
 
4212
- class Pressure(TypedQuantity):
4478
+ class Pressure(FieldQnty):
4213
4479
  """
4214
4480
  Type-safe pressure quantity with expression capabilities.
4215
4481
 
@@ -4225,10 +4491,11 @@ class Pressure(TypedQuantity):
4225
4491
 
4226
4492
  Available units: "atmosphere_standard", "bar", "barye"
4227
4493
  """
4494
+
4228
4495
  __slots__ = ()
4229
4496
  _setter_class = ts.PressureSetter
4230
- _expected_dimension = dim.PRESSURE
4231
-
4497
+ _dimension = dim.PRESSURE
4498
+
4232
4499
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
4233
4500
  """
4234
4501
  Initialize pressure quantity.
@@ -4247,25 +4514,50 @@ class Pressure(TypedQuantity):
4247
4514
  super().__init__(name_or_value, unit, name, is_known=is_known)
4248
4515
  else:
4249
4516
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
4517
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
4250
4518
 
4251
- def set(self, value: int | float) -> ts.PressureSetter:
4519
+ def set(self, value: float, unit: str | None = None) -> ts.PressureSetter:
4252
4520
  """
4253
4521
  Create a setter for this pressure quantity.
4254
4522
 
4255
4523
  Args:
4256
4524
  value: The numeric value to set
4525
+ unit: Optional unit string (for direct setting)
4257
4526
 
4258
4527
  Returns:
4259
- PressureSetter: A setter with unit properties like .meters, .inches, etc.
4528
+ PressureSetter: A setter with unit properties like .psi, .bar, etc.
4260
4529
 
4261
4530
  Example:
4262
- >>> length = Length("beam_length")
4263
- >>> length.set(100).millimeters # Sets to 100 mm
4264
- """
4265
- return ts.PressureSetter(self, value)
4531
+ >>> pressure = Pressure("system_pressure")
4532
+ >>> pressure.set(100).psi # Sets to 100 psi
4533
+ >>> pressure.set(100, "psi") # Direct setting
4534
+ """
4535
+ if unit is not None:
4536
+ # Direct setting with unit
4537
+ setter = ts.PressureSetter(self, value)
4538
+ # Get the unit property and call it to set the value
4539
+ if hasattr(setter, unit):
4540
+ getattr(setter, unit)
4541
+ else:
4542
+ # Try common aliases
4543
+ unit_aliases = {
4544
+ "psi": "psi", "pound_per_square_inch": "psi",
4545
+ "bar": "bar", "bars": "bar",
4546
+ "pascal": "pascal", "pascals": "pascal", "pa": "pascal",
4547
+ "kpa": "kilopascal", "kilopascal": "kilopascal",
4548
+ "mpa": "megapascal", "megapascal": "megapascal",
4549
+ "atm": "atmosphere", "atmosphere": "atmosphere"
4550
+ }
4551
+ if unit in unit_aliases and hasattr(setter, unit_aliases[unit]):
4552
+ getattr(setter, unit_aliases[unit])
4553
+ else:
4554
+ raise ValueError(f"Unknown unit: {unit}")
4555
+ return self # Return the variable itself for consistency
4556
+ else:
4557
+ return ts.PressureSetter(self, value)
4266
4558
 
4267
4559
 
4268
- class RadiationDoseEquivalent(TypedQuantity):
4560
+ class RadiationDoseEquivalent(FieldQnty):
4269
4561
  """
4270
4562
  Type-safe radiation dose equivalent quantity with expression capabilities.
4271
4563
 
@@ -4281,10 +4573,11 @@ class RadiationDoseEquivalent(TypedQuantity):
4281
4573
 
4282
4574
  Available units: "rem", "sievert", "millisievert"
4283
4575
  """
4576
+
4284
4577
  __slots__ = ()
4285
4578
  _setter_class = ts.RadiationDoseEquivalentSetter
4286
- _expected_dimension = dim.RADIATION_DOSE_EQUIVALENT
4287
-
4579
+ _dimension = dim.RADIATION_DOSE_EQUIVALENT
4580
+
4288
4581
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
4289
4582
  """
4290
4583
  Initialize radiation dose equivalent quantity.
@@ -4303,13 +4596,15 @@ class RadiationDoseEquivalent(TypedQuantity):
4303
4596
  super().__init__(name_or_value, unit, name, is_known=is_known)
4304
4597
  else:
4305
4598
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
4599
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
4306
4600
 
4307
- def set(self, value: int | float) -> ts.RadiationDoseEquivalentSetter:
4601
+ def set(self, value: float, unit: str | None = None) -> ts.RadiationDoseEquivalentSetter:
4308
4602
  """
4309
4603
  Create a setter for this radiation dose equivalent quantity.
4310
4604
 
4311
4605
  Args:
4312
4606
  value: The numeric value to set
4607
+ unit: Optional unit string (for compatibility with base class)
4313
4608
 
4314
4609
  Returns:
4315
4610
  RadiationDoseEquivalentSetter: A setter with unit properties like .meters, .inches, etc.
@@ -4321,7 +4616,7 @@ class RadiationDoseEquivalent(TypedQuantity):
4321
4616
  return ts.RadiationDoseEquivalentSetter(self, value)
4322
4617
 
4323
4618
 
4324
- class RadiationExposure(TypedQuantity):
4619
+ class RadiationExposure(FieldQnty):
4325
4620
  """
4326
4621
  Type-safe radiation exposure quantity with expression capabilities.
4327
4622
 
@@ -4337,10 +4632,11 @@ class RadiationExposure(TypedQuantity):
4337
4632
 
4338
4633
  Available units: "coulomb_per_kilogram", "d_unit", "pastille_dose_b_unit"
4339
4634
  """
4635
+
4340
4636
  __slots__ = ()
4341
4637
  _setter_class = ts.RadiationExposureSetter
4342
- _expected_dimension = dim.RADIATION_EXPOSURE
4343
-
4638
+ _dimension = dim.RADIATION_EXPOSURE
4639
+
4344
4640
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
4345
4641
  """
4346
4642
  Initialize radiation exposure quantity.
@@ -4359,13 +4655,15 @@ class RadiationExposure(TypedQuantity):
4359
4655
  super().__init__(name_or_value, unit, name, is_known=is_known)
4360
4656
  else:
4361
4657
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
4658
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
4362
4659
 
4363
- def set(self, value: int | float) -> ts.RadiationExposureSetter:
4660
+ def set(self, value: float, unit: str | None = None) -> ts.RadiationExposureSetter:
4364
4661
  """
4365
4662
  Create a setter for this radiation exposure quantity.
4366
4663
 
4367
4664
  Args:
4368
4665
  value: The numeric value to set
4666
+ unit: Optional unit string (for compatibility with base class)
4369
4667
 
4370
4668
  Returns:
4371
4669
  RadiationExposureSetter: A setter with unit properties like .meters, .inches, etc.
@@ -4377,7 +4675,7 @@ class RadiationExposure(TypedQuantity):
4377
4675
  return ts.RadiationExposureSetter(self, value)
4378
4676
 
4379
4677
 
4380
- class Radioactivity(TypedQuantity):
4678
+ class Radioactivity(FieldQnty):
4381
4679
  """
4382
4680
  Type-safe radioactivity quantity with expression capabilities.
4383
4681
 
@@ -4393,10 +4691,11 @@ class Radioactivity(TypedQuantity):
4393
4691
 
4394
4692
  Available units: "becquerel", "curie", "mache_unit"
4395
4693
  """
4694
+
4396
4695
  __slots__ = ()
4397
4696
  _setter_class = ts.RadioactivitySetter
4398
- _expected_dimension = dim.RADIOACTIVITY
4399
-
4697
+ _dimension = dim.RADIOACTIVITY
4698
+
4400
4699
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
4401
4700
  """
4402
4701
  Initialize radioactivity quantity.
@@ -4415,13 +4714,15 @@ class Radioactivity(TypedQuantity):
4415
4714
  super().__init__(name_or_value, unit, name, is_known=is_known)
4416
4715
  else:
4417
4716
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
4717
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
4418
4718
 
4419
- def set(self, value: int | float) -> ts.RadioactivitySetter:
4719
+ def set(self, value: float, unit: str | None = None) -> ts.RadioactivitySetter:
4420
4720
  """
4421
4721
  Create a setter for this radioactivity quantity.
4422
4722
 
4423
4723
  Args:
4424
4724
  value: The numeric value to set
4725
+ unit: Optional unit string (for compatibility with base class)
4425
4726
 
4426
4727
  Returns:
4427
4728
  RadioactivitySetter: A setter with unit properties like .meters, .inches, etc.
@@ -4433,7 +4734,7 @@ class Radioactivity(TypedQuantity):
4433
4734
  return ts.RadioactivitySetter(self, value)
4434
4735
 
4435
4736
 
4436
- class SecondMomentOfArea(TypedQuantity):
4737
+ class SecondMomentOfArea(FieldQnty):
4437
4738
  """
4438
4739
  Type-safe second moment of area quantity with expression capabilities.
4439
4740
 
@@ -4449,10 +4750,11 @@ class SecondMomentOfArea(TypedQuantity):
4449
4750
 
4450
4751
  Available units: "inch_quadrupled", "centimeter_quadrupled", "foot_quadrupled"
4451
4752
  """
4753
+
4452
4754
  __slots__ = ()
4453
4755
  _setter_class = ts.SecondMomentOfAreaSetter
4454
- _expected_dimension = dim.SECOND_MOMENT_OF_AREA
4455
-
4756
+ _dimension = dim.SECOND_MOMENT_OF_AREA
4757
+
4456
4758
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
4457
4759
  """
4458
4760
  Initialize second moment of area quantity.
@@ -4471,13 +4773,15 @@ class SecondMomentOfArea(TypedQuantity):
4471
4773
  super().__init__(name_or_value, unit, name, is_known=is_known)
4472
4774
  else:
4473
4775
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
4776
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
4474
4777
 
4475
- def set(self, value: int | float) -> ts.SecondMomentOfAreaSetter:
4778
+ def set(self, value: float, unit: str | None = None) -> ts.SecondMomentOfAreaSetter:
4476
4779
  """
4477
4780
  Create a setter for this second moment of area quantity.
4478
4781
 
4479
4782
  Args:
4480
4783
  value: The numeric value to set
4784
+ unit: Optional unit string (for compatibility with base class)
4481
4785
 
4482
4786
  Returns:
4483
4787
  SecondMomentOfAreaSetter: A setter with unit properties like .meters, .inches, etc.
@@ -4489,7 +4793,7 @@ class SecondMomentOfArea(TypedQuantity):
4489
4793
  return ts.SecondMomentOfAreaSetter(self, value)
4490
4794
 
4491
4795
 
4492
- class SecondRadiationConstantPlanck(TypedQuantity):
4796
+ class SecondRadiationConstantPlanck(FieldQnty):
4493
4797
  """
4494
4798
  Type-safe second radiation constant (planck) quantity with expression capabilities.
4495
4799
 
@@ -4505,10 +4809,11 @@ class SecondRadiationConstantPlanck(TypedQuantity):
4505
4809
 
4506
4810
  Available units: "meter_kelvin"
4507
4811
  """
4812
+
4508
4813
  __slots__ = ()
4509
4814
  _setter_class = ts.SecondRadiationConstantPlanckSetter
4510
- _expected_dimension = dim.SECOND_RADIATION_CONSTANT_PLANCK
4511
-
4815
+ _dimension = dim.SECOND_RADIATION_CONSTANT_PLANCK
4816
+
4512
4817
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
4513
4818
  """
4514
4819
  Initialize second radiation constant (planck) quantity.
@@ -4527,13 +4832,15 @@ class SecondRadiationConstantPlanck(TypedQuantity):
4527
4832
  super().__init__(name_or_value, unit, name, is_known=is_known)
4528
4833
  else:
4529
4834
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
4835
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
4530
4836
 
4531
- def set(self, value: int | float) -> ts.SecondRadiationConstantPlanckSetter:
4837
+ def set(self, value: float, unit: str | None = None) -> ts.SecondRadiationConstantPlanckSetter:
4532
4838
  """
4533
4839
  Create a setter for this second radiation constant (planck) quantity.
4534
4840
 
4535
4841
  Args:
4536
4842
  value: The numeric value to set
4843
+ unit: Optional unit string (for compatibility with base class)
4537
4844
 
4538
4845
  Returns:
4539
4846
  SecondRadiationConstantPlanckSetter: A setter with unit properties like .meters, .inches, etc.
@@ -4545,7 +4852,7 @@ class SecondRadiationConstantPlanck(TypedQuantity):
4545
4852
  return ts.SecondRadiationConstantPlanckSetter(self, value)
4546
4853
 
4547
4854
 
4548
- class SpecificEnthalpy(TypedQuantity):
4855
+ class SpecificEnthalpy(FieldQnty):
4549
4856
  """
4550
4857
  Type-safe specific enthalpy quantity with expression capabilities.
4551
4858
 
@@ -4561,10 +4868,11 @@ class SpecificEnthalpy(TypedQuantity):
4561
4868
 
4562
4869
  Available units: "british_thermal_unit_mean", "british_thermal_unit_per_pound", "calorie_per_gram"
4563
4870
  """
4871
+
4564
4872
  __slots__ = ()
4565
4873
  _setter_class = ts.SpecificEnthalpySetter
4566
- _expected_dimension = dim.SPECIFIC_ENTHALPY
4567
-
4874
+ _dimension = dim.SPECIFIC_ENTHALPY
4875
+
4568
4876
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
4569
4877
  """
4570
4878
  Initialize specific enthalpy quantity.
@@ -4583,13 +4891,15 @@ class SpecificEnthalpy(TypedQuantity):
4583
4891
  super().__init__(name_or_value, unit, name, is_known=is_known)
4584
4892
  else:
4585
4893
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
4894
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
4586
4895
 
4587
- def set(self, value: int | float) -> ts.SpecificEnthalpySetter:
4896
+ def set(self, value: float, unit: str | None = None) -> ts.SpecificEnthalpySetter:
4588
4897
  """
4589
4898
  Create a setter for this specific enthalpy quantity.
4590
4899
 
4591
4900
  Args:
4592
4901
  value: The numeric value to set
4902
+ unit: Optional unit string (for compatibility with base class)
4593
4903
 
4594
4904
  Returns:
4595
4905
  SpecificEnthalpySetter: A setter with unit properties like .meters, .inches, etc.
@@ -4601,7 +4911,7 @@ class SpecificEnthalpy(TypedQuantity):
4601
4911
  return ts.SpecificEnthalpySetter(self, value)
4602
4912
 
4603
4913
 
4604
- class SpecificGravity(TypedQuantity):
4914
+ class SpecificGravity(FieldQnty):
4605
4915
  """
4606
4916
  Type-safe specific gravity quantity with expression capabilities.
4607
4917
 
@@ -4617,10 +4927,11 @@ class SpecificGravity(TypedQuantity):
4617
4927
 
4618
4928
  Available units: "dimensionless"
4619
4929
  """
4930
+
4620
4931
  __slots__ = ()
4621
4932
  _setter_class = ts.SpecificGravitySetter
4622
- _expected_dimension = dim.SPECIFIC_GRAVITY
4623
-
4933
+ _dimension = dim.SPECIFIC_GRAVITY
4934
+
4624
4935
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
4625
4936
  """
4626
4937
  Initialize specific gravity quantity.
@@ -4639,13 +4950,15 @@ class SpecificGravity(TypedQuantity):
4639
4950
  super().__init__(name_or_value, unit, name, is_known=is_known)
4640
4951
  else:
4641
4952
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
4953
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
4642
4954
 
4643
- def set(self, value: int | float) -> ts.SpecificGravitySetter:
4955
+ def set(self, value: float, unit: str | None = None) -> ts.SpecificGravitySetter:
4644
4956
  """
4645
4957
  Create a setter for this specific gravity quantity.
4646
4958
 
4647
4959
  Args:
4648
4960
  value: The numeric value to set
4961
+ unit: Optional unit string (for compatibility with base class)
4649
4962
 
4650
4963
  Returns:
4651
4964
  SpecificGravitySetter: A setter with unit properties like .meters, .inches, etc.
@@ -4657,7 +4970,7 @@ class SpecificGravity(TypedQuantity):
4657
4970
  return ts.SpecificGravitySetter(self, value)
4658
4971
 
4659
4972
 
4660
- class SpecificHeatCapacityConstantPressure(TypedQuantity):
4973
+ class SpecificHeatCapacityConstantPressure(FieldQnty):
4661
4974
  """
4662
4975
  Type-safe specific heat capacity (constant pressure) quantity with expression capabilities.
4663
4976
 
@@ -4673,10 +4986,11 @@ class SpecificHeatCapacityConstantPressure(TypedQuantity):
4673
4986
 
4674
4987
  Available units: "btu_per_pound_per_degree_fahrenheit_or_degree_rankine", "calories_per_gram_per_kelvin_or_degree_celsius", "joules_per_kilogram_per_kelvin_or_degree_celsius"
4675
4988
  """
4989
+
4676
4990
  __slots__ = ()
4677
4991
  _setter_class = ts.SpecificHeatCapacityConstantPressureSetter
4678
- _expected_dimension = dim.SPECIFIC_HEAT_CAPACITY_CONSTANT_PRESSURE
4679
-
4992
+ _dimension = dim.SPECIFIC_HEAT_CAPACITY_CONSTANT_PRESSURE
4993
+
4680
4994
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
4681
4995
  """
4682
4996
  Initialize specific heat capacity (constant pressure) quantity.
@@ -4695,13 +5009,15 @@ class SpecificHeatCapacityConstantPressure(TypedQuantity):
4695
5009
  super().__init__(name_or_value, unit, name, is_known=is_known)
4696
5010
  else:
4697
5011
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
5012
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
4698
5013
 
4699
- def set(self, value: int | float) -> ts.SpecificHeatCapacityConstantPressureSetter:
5014
+ def set(self, value: float, unit: str | None = None) -> ts.SpecificHeatCapacityConstantPressureSetter:
4700
5015
  """
4701
5016
  Create a setter for this specific heat capacity (constant pressure) quantity.
4702
5017
 
4703
5018
  Args:
4704
5019
  value: The numeric value to set
5020
+ unit: Optional unit string (for compatibility with base class)
4705
5021
 
4706
5022
  Returns:
4707
5023
  SpecificHeatCapacityConstantPressureSetter: A setter with unit properties like .meters, .inches, etc.
@@ -4713,7 +5029,7 @@ class SpecificHeatCapacityConstantPressure(TypedQuantity):
4713
5029
  return ts.SpecificHeatCapacityConstantPressureSetter(self, value)
4714
5030
 
4715
5031
 
4716
- class SpecificLength(TypedQuantity):
5032
+ class SpecificLength(FieldQnty):
4717
5033
  """
4718
5034
  Type-safe specific length quantity with expression capabilities.
4719
5035
 
@@ -4729,10 +5045,11 @@ class SpecificLength(TypedQuantity):
4729
5045
 
4730
5046
  Available units: "centimeter_per_gram", "cotton_count", "ft_per_pound"
4731
5047
  """
5048
+
4732
5049
  __slots__ = ()
4733
5050
  _setter_class = ts.SpecificLengthSetter
4734
- _expected_dimension = dim.SPECIFIC_LENGTH
4735
-
5051
+ _dimension = dim.SPECIFIC_LENGTH
5052
+
4736
5053
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
4737
5054
  """
4738
5055
  Initialize specific length quantity.
@@ -4751,13 +5068,15 @@ class SpecificLength(TypedQuantity):
4751
5068
  super().__init__(name_or_value, unit, name, is_known=is_known)
4752
5069
  else:
4753
5070
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
5071
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
4754
5072
 
4755
- def set(self, value: int | float) -> ts.SpecificLengthSetter:
5073
+ def set(self, value: float, unit: str | None = None) -> ts.SpecificLengthSetter:
4756
5074
  """
4757
5075
  Create a setter for this specific length quantity.
4758
5076
 
4759
5077
  Args:
4760
5078
  value: The numeric value to set
5079
+ unit: Optional unit string (for compatibility with base class)
4761
5080
 
4762
5081
  Returns:
4763
5082
  SpecificLengthSetter: A setter with unit properties like .meters, .inches, etc.
@@ -4769,7 +5088,7 @@ class SpecificLength(TypedQuantity):
4769
5088
  return ts.SpecificLengthSetter(self, value)
4770
5089
 
4771
5090
 
4772
- class SpecificSurface(TypedQuantity):
5091
+ class SpecificSurface(FieldQnty):
4773
5092
  """
4774
5093
  Type-safe specific surface quantity with expression capabilities.
4775
5094
 
@@ -4785,10 +5104,11 @@ class SpecificSurface(TypedQuantity):
4785
5104
 
4786
5105
  Available units: "square_centimeter_per_gram", "square_foot_per_kilogram", "square_foot_per_pound"
4787
5106
  """
5107
+
4788
5108
  __slots__ = ()
4789
5109
  _setter_class = ts.SpecificSurfaceSetter
4790
- _expected_dimension = dim.SPECIFIC_SURFACE
4791
-
5110
+ _dimension = dim.SPECIFIC_SURFACE
5111
+
4792
5112
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
4793
5113
  """
4794
5114
  Initialize specific surface quantity.
@@ -4807,13 +5127,15 @@ class SpecificSurface(TypedQuantity):
4807
5127
  super().__init__(name_or_value, unit, name, is_known=is_known)
4808
5128
  else:
4809
5129
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
5130
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
4810
5131
 
4811
- def set(self, value: int | float) -> ts.SpecificSurfaceSetter:
5132
+ def set(self, value: float, unit: str | None = None) -> ts.SpecificSurfaceSetter:
4812
5133
  """
4813
5134
  Create a setter for this specific surface quantity.
4814
5135
 
4815
5136
  Args:
4816
5137
  value: The numeric value to set
5138
+ unit: Optional unit string (for compatibility with base class)
4817
5139
 
4818
5140
  Returns:
4819
5141
  SpecificSurfaceSetter: A setter with unit properties like .meters, .inches, etc.
@@ -4825,7 +5147,7 @@ class SpecificSurface(TypedQuantity):
4825
5147
  return ts.SpecificSurfaceSetter(self, value)
4826
5148
 
4827
5149
 
4828
- class SpecificVolume(TypedQuantity):
5150
+ class SpecificVolume(FieldQnty):
4829
5151
  """
4830
5152
  Type-safe specific volume quantity with expression capabilities.
4831
5153
 
@@ -4841,10 +5163,11 @@ class SpecificVolume(TypedQuantity):
4841
5163
 
4842
5164
  Available units: "cubic_centimeter_per_gram", "cubic_foot_per_kilogram", "cubic_foot_per_pound"
4843
5165
  """
5166
+
4844
5167
  __slots__ = ()
4845
5168
  _setter_class = ts.SpecificVolumeSetter
4846
- _expected_dimension = dim.SPECIFIC_VOLUME
4847
-
5169
+ _dimension = dim.SPECIFIC_VOLUME
5170
+
4848
5171
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
4849
5172
  """
4850
5173
  Initialize specific volume quantity.
@@ -4863,13 +5186,15 @@ class SpecificVolume(TypedQuantity):
4863
5186
  super().__init__(name_or_value, unit, name, is_known=is_known)
4864
5187
  else:
4865
5188
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
5189
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
4866
5190
 
4867
- def set(self, value: int | float) -> ts.SpecificVolumeSetter:
5191
+ def set(self, value: float, unit: str | None = None) -> ts.SpecificVolumeSetter:
4868
5192
  """
4869
5193
  Create a setter for this specific volume quantity.
4870
5194
 
4871
5195
  Args:
4872
5196
  value: The numeric value to set
5197
+ unit: Optional unit string (for compatibility with base class)
4873
5198
 
4874
5199
  Returns:
4875
5200
  SpecificVolumeSetter: A setter with unit properties like .meters, .inches, etc.
@@ -4881,7 +5206,7 @@ class SpecificVolume(TypedQuantity):
4881
5206
  return ts.SpecificVolumeSetter(self, value)
4882
5207
 
4883
5208
 
4884
- class Stress(TypedQuantity):
5209
+ class Stress(FieldQnty):
4885
5210
  """
4886
5211
  Type-safe stress quantity with expression capabilities.
4887
5212
 
@@ -4897,10 +5222,11 @@ class Stress(TypedQuantity):
4897
5222
 
4898
5223
  Available units: "dyne_per_square_centimeter", "gigapascal", "hectopascal"
4899
5224
  """
5225
+
4900
5226
  __slots__ = ()
4901
5227
  _setter_class = ts.StressSetter
4902
- _expected_dimension = dim.STRESS
4903
-
5228
+ _dimension = dim.STRESS
5229
+
4904
5230
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
4905
5231
  """
4906
5232
  Initialize stress quantity.
@@ -4919,13 +5245,15 @@ class Stress(TypedQuantity):
4919
5245
  super().__init__(name_or_value, unit, name, is_known=is_known)
4920
5246
  else:
4921
5247
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
5248
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
4922
5249
 
4923
- def set(self, value: int | float) -> ts.StressSetter:
5250
+ def set(self, value: float, unit: str | None = None) -> ts.StressSetter:
4924
5251
  """
4925
5252
  Create a setter for this stress quantity.
4926
5253
 
4927
5254
  Args:
4928
5255
  value: The numeric value to set
5256
+ unit: Optional unit string (for compatibility with base class)
4929
5257
 
4930
5258
  Returns:
4931
5259
  StressSetter: A setter with unit properties like .meters, .inches, etc.
@@ -4937,7 +5265,7 @@ class Stress(TypedQuantity):
4937
5265
  return ts.StressSetter(self, value)
4938
5266
 
4939
5267
 
4940
- class SurfaceMassDensity(TypedQuantity):
5268
+ class SurfaceMassDensity(FieldQnty):
4941
5269
  """
4942
5270
  Type-safe surface mass density quantity with expression capabilities.
4943
5271
 
@@ -4953,10 +5281,11 @@ class SurfaceMassDensity(TypedQuantity):
4953
5281
 
4954
5282
  Available units: "gram_per_square_centimeter", "gram_per_square_meter", "kilogram_per_square_meter"
4955
5283
  """
5284
+
4956
5285
  __slots__ = ()
4957
5286
  _setter_class = ts.SurfaceMassDensitySetter
4958
- _expected_dimension = dim.SURFACE_MASS_DENSITY
4959
-
5287
+ _dimension = dim.SURFACE_MASS_DENSITY
5288
+
4960
5289
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
4961
5290
  """
4962
5291
  Initialize surface mass density quantity.
@@ -4975,13 +5304,15 @@ class SurfaceMassDensity(TypedQuantity):
4975
5304
  super().__init__(name_or_value, unit, name, is_known=is_known)
4976
5305
  else:
4977
5306
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
5307
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
4978
5308
 
4979
- def set(self, value: int | float) -> ts.SurfaceMassDensitySetter:
5309
+ def set(self, value: float, unit: str | None = None) -> ts.SurfaceMassDensitySetter:
4980
5310
  """
4981
5311
  Create a setter for this surface mass density quantity.
4982
5312
 
4983
5313
  Args:
4984
5314
  value: The numeric value to set
5315
+ unit: Optional unit string (for compatibility with base class)
4985
5316
 
4986
5317
  Returns:
4987
5318
  SurfaceMassDensitySetter: A setter with unit properties like .meters, .inches, etc.
@@ -4993,7 +5324,7 @@ class SurfaceMassDensity(TypedQuantity):
4993
5324
  return ts.SurfaceMassDensitySetter(self, value)
4994
5325
 
4995
5326
 
4996
- class SurfaceTension(TypedQuantity):
5327
+ class SurfaceTension(FieldQnty):
4997
5328
  """
4998
5329
  Type-safe surface tension quantity with expression capabilities.
4999
5330
 
@@ -5009,10 +5340,11 @@ class SurfaceTension(TypedQuantity):
5009
5340
 
5010
5341
  Available units: "dyne_per_centimeter", "gram_force_per_centimeter", "newton_per_meter"
5011
5342
  """
5343
+
5012
5344
  __slots__ = ()
5013
5345
  _setter_class = ts.SurfaceTensionSetter
5014
- _expected_dimension = dim.SURFACE_TENSION
5015
-
5346
+ _dimension = dim.SURFACE_TENSION
5347
+
5016
5348
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
5017
5349
  """
5018
5350
  Initialize surface tension quantity.
@@ -5031,13 +5363,15 @@ class SurfaceTension(TypedQuantity):
5031
5363
  super().__init__(name_or_value, unit, name, is_known=is_known)
5032
5364
  else:
5033
5365
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
5366
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
5034
5367
 
5035
- def set(self, value: int | float) -> ts.SurfaceTensionSetter:
5368
+ def set(self, value: float, unit: str | None = None) -> ts.SurfaceTensionSetter:
5036
5369
  """
5037
5370
  Create a setter for this surface tension quantity.
5038
5371
 
5039
5372
  Args:
5040
5373
  value: The numeric value to set
5374
+ unit: Optional unit string (for compatibility with base class)
5041
5375
 
5042
5376
  Returns:
5043
5377
  SurfaceTensionSetter: A setter with unit properties like .meters, .inches, etc.
@@ -5049,7 +5383,7 @@ class SurfaceTension(TypedQuantity):
5049
5383
  return ts.SurfaceTensionSetter(self, value)
5050
5384
 
5051
5385
 
5052
- class Temperature(TypedQuantity):
5386
+ class Temperature(FieldQnty):
5053
5387
  """
5054
5388
  Type-safe temperature quantity with expression capabilities.
5055
5389
 
@@ -5065,10 +5399,11 @@ class Temperature(TypedQuantity):
5065
5399
 
5066
5400
  Available units: "degree_celsius_unit_size", "degree_fahrenheit_unit_size", "degree_r_aumur_unit_size"
5067
5401
  """
5402
+
5068
5403
  __slots__ = ()
5069
5404
  _setter_class = ts.TemperatureSetter
5070
- _expected_dimension = dim.TEMPERATURE
5071
-
5405
+ _dimension = dim.TEMPERATURE
5406
+
5072
5407
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
5073
5408
  """
5074
5409
  Initialize temperature quantity.
@@ -5087,13 +5422,15 @@ class Temperature(TypedQuantity):
5087
5422
  super().__init__(name_or_value, unit, name, is_known=is_known)
5088
5423
  else:
5089
5424
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
5425
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
5090
5426
 
5091
- def set(self, value: int | float) -> ts.TemperatureSetter:
5427
+ def set(self, value: float, unit: str | None = None) -> ts.TemperatureSetter:
5092
5428
  """
5093
5429
  Create a setter for this temperature quantity.
5094
5430
 
5095
5431
  Args:
5096
5432
  value: The numeric value to set
5433
+ unit: Optional unit string (for compatibility with base class)
5097
5434
 
5098
5435
  Returns:
5099
5436
  TemperatureSetter: A setter with unit properties like .meters, .inches, etc.
@@ -5105,7 +5442,7 @@ class Temperature(TypedQuantity):
5105
5442
  return ts.TemperatureSetter(self, value)
5106
5443
 
5107
5444
 
5108
- class ThermalConductivity(TypedQuantity):
5445
+ class ThermalConductivity(FieldQnty):
5109
5446
  """
5110
5447
  Type-safe thermal conductivity quantity with expression capabilities.
5111
5448
 
@@ -5121,10 +5458,11 @@ class ThermalConductivity(TypedQuantity):
5121
5458
 
5122
5459
  Available units: "btu_it", "btu_therm", "btu_therm"
5123
5460
  """
5461
+
5124
5462
  __slots__ = ()
5125
5463
  _setter_class = ts.ThermalConductivitySetter
5126
- _expected_dimension = dim.THERMAL_CONDUCTIVITY
5127
-
5464
+ _dimension = dim.THERMAL_CONDUCTIVITY
5465
+
5128
5466
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
5129
5467
  """
5130
5468
  Initialize thermal conductivity quantity.
@@ -5143,13 +5481,15 @@ class ThermalConductivity(TypedQuantity):
5143
5481
  super().__init__(name_or_value, unit, name, is_known=is_known)
5144
5482
  else:
5145
5483
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
5484
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
5146
5485
 
5147
- def set(self, value: int | float) -> ts.ThermalConductivitySetter:
5486
+ def set(self, value: float, unit: str | None = None) -> ts.ThermalConductivitySetter:
5148
5487
  """
5149
5488
  Create a setter for this thermal conductivity quantity.
5150
5489
 
5151
5490
  Args:
5152
5491
  value: The numeric value to set
5492
+ unit: Optional unit string (for compatibility with base class)
5153
5493
 
5154
5494
  Returns:
5155
5495
  ThermalConductivitySetter: A setter with unit properties like .meters, .inches, etc.
@@ -5161,7 +5501,7 @@ class ThermalConductivity(TypedQuantity):
5161
5501
  return ts.ThermalConductivitySetter(self, value)
5162
5502
 
5163
5503
 
5164
- class Time(TypedQuantity):
5504
+ class Time(FieldQnty):
5165
5505
  """
5166
5506
  Type-safe time quantity with expression capabilities.
5167
5507
 
@@ -5177,10 +5517,11 @@ class Time(TypedQuantity):
5177
5517
 
5178
5518
  Available units: "blink", "century", "chronon_or_tempon"
5179
5519
  """
5520
+
5180
5521
  __slots__ = ()
5181
5522
  _setter_class = ts.TimeSetter
5182
- _expected_dimension = dim.TIME
5183
-
5523
+ _dimension = dim.TIME
5524
+
5184
5525
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
5185
5526
  """
5186
5527
  Initialize time quantity.
@@ -5199,13 +5540,15 @@ class Time(TypedQuantity):
5199
5540
  super().__init__(name_or_value, unit, name, is_known=is_known)
5200
5541
  else:
5201
5542
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
5543
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
5202
5544
 
5203
- def set(self, value: int | float) -> ts.TimeSetter:
5545
+ def set(self, value: float, unit: str | None = None) -> ts.TimeSetter:
5204
5546
  """
5205
5547
  Create a setter for this time quantity.
5206
5548
 
5207
5549
  Args:
5208
5550
  value: The numeric value to set
5551
+ unit: Optional unit string (for compatibility with base class)
5209
5552
 
5210
5553
  Returns:
5211
5554
  TimeSetter: A setter with unit properties like .meters, .inches, etc.
@@ -5217,7 +5560,7 @@ class Time(TypedQuantity):
5217
5560
  return ts.TimeSetter(self, value)
5218
5561
 
5219
5562
 
5220
- class Torque(TypedQuantity):
5563
+ class Torque(FieldQnty):
5221
5564
  """
5222
5565
  Type-safe torque quantity with expression capabilities.
5223
5566
 
@@ -5233,10 +5576,11 @@ class Torque(TypedQuantity):
5233
5576
 
5234
5577
  Available units: "centimeter_kilogram_force", "dyne_centimeter", "foot_kilogram_force"
5235
5578
  """
5579
+
5236
5580
  __slots__ = ()
5237
5581
  _setter_class = ts.TorqueSetter
5238
- _expected_dimension = dim.TORQUE
5239
-
5582
+ _dimension = dim.TORQUE
5583
+
5240
5584
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
5241
5585
  """
5242
5586
  Initialize torque quantity.
@@ -5255,13 +5599,15 @@ class Torque(TypedQuantity):
5255
5599
  super().__init__(name_or_value, unit, name, is_known=is_known)
5256
5600
  else:
5257
5601
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
5602
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
5258
5603
 
5259
- def set(self, value: int | float) -> ts.TorqueSetter:
5604
+ def set(self, value: float, unit: str | None = None) -> ts.TorqueSetter:
5260
5605
  """
5261
5606
  Create a setter for this torque quantity.
5262
5607
 
5263
5608
  Args:
5264
5609
  value: The numeric value to set
5610
+ unit: Optional unit string (for compatibility with base class)
5265
5611
 
5266
5612
  Returns:
5267
5613
  TorqueSetter: A setter with unit properties like .meters, .inches, etc.
@@ -5273,7 +5619,7 @@ class Torque(TypedQuantity):
5273
5619
  return ts.TorqueSetter(self, value)
5274
5620
 
5275
5621
 
5276
- class TurbulenceEnergyDissipationRate(TypedQuantity):
5622
+ class TurbulenceEnergyDissipationRate(FieldQnty):
5277
5623
  """
5278
5624
  Type-safe turbulence energy dissipation rate quantity with expression capabilities.
5279
5625
 
@@ -5289,10 +5635,11 @@ class TurbulenceEnergyDissipationRate(TypedQuantity):
5289
5635
 
5290
5636
  Available units: "square_foot_per_cubic_second", "square_meter_per_cubic_second"
5291
5637
  """
5638
+
5292
5639
  __slots__ = ()
5293
5640
  _setter_class = ts.TurbulenceEnergyDissipationRateSetter
5294
- _expected_dimension = dim.TURBULENCE_ENERGY_DISSIPATION_RATE
5295
-
5641
+ _dimension = dim.TURBULENCE_ENERGY_DISSIPATION_RATE
5642
+
5296
5643
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
5297
5644
  """
5298
5645
  Initialize turbulence energy dissipation rate quantity.
@@ -5311,13 +5658,15 @@ class TurbulenceEnergyDissipationRate(TypedQuantity):
5311
5658
  super().__init__(name_or_value, unit, name, is_known=is_known)
5312
5659
  else:
5313
5660
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
5661
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
5314
5662
 
5315
- def set(self, value: int | float) -> ts.TurbulenceEnergyDissipationRateSetter:
5663
+ def set(self, value: float, unit: str | None = None) -> ts.TurbulenceEnergyDissipationRateSetter:
5316
5664
  """
5317
5665
  Create a setter for this turbulence energy dissipation rate quantity.
5318
5666
 
5319
5667
  Args:
5320
5668
  value: The numeric value to set
5669
+ unit: Optional unit string (for compatibility with base class)
5321
5670
 
5322
5671
  Returns:
5323
5672
  TurbulenceEnergyDissipationRateSetter: A setter with unit properties like .meters, .inches, etc.
@@ -5329,7 +5678,7 @@ class TurbulenceEnergyDissipationRate(TypedQuantity):
5329
5678
  return ts.TurbulenceEnergyDissipationRateSetter(self, value)
5330
5679
 
5331
5680
 
5332
- class VelocityAngular(TypedQuantity):
5681
+ class VelocityAngular(FieldQnty):
5333
5682
  """
5334
5683
  Type-safe velocity, angular quantity with expression capabilities.
5335
5684
 
@@ -5345,10 +5694,11 @@ class VelocityAngular(TypedQuantity):
5345
5694
 
5346
5695
  Available units: "degree_per_minute", "degree_per_second", "grade_per_minute"
5347
5696
  """
5697
+
5348
5698
  __slots__ = ()
5349
5699
  _setter_class = ts.VelocityAngularSetter
5350
- _expected_dimension = dim.VELOCITY_ANGULAR
5351
-
5700
+ _dimension = dim.VELOCITY_ANGULAR
5701
+
5352
5702
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
5353
5703
  """
5354
5704
  Initialize velocity, angular quantity.
@@ -5367,13 +5717,15 @@ class VelocityAngular(TypedQuantity):
5367
5717
  super().__init__(name_or_value, unit, name, is_known=is_known)
5368
5718
  else:
5369
5719
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
5720
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
5370
5721
 
5371
- def set(self, value: int | float) -> ts.VelocityAngularSetter:
5722
+ def set(self, value: float, unit: str | None = None) -> ts.VelocityAngularSetter:
5372
5723
  """
5373
5724
  Create a setter for this velocity, angular quantity.
5374
5725
 
5375
5726
  Args:
5376
5727
  value: The numeric value to set
5728
+ unit: Optional unit string (for compatibility with base class)
5377
5729
 
5378
5730
  Returns:
5379
5731
  VelocityAngularSetter: A setter with unit properties like .meters, .inches, etc.
@@ -5385,7 +5737,7 @@ class VelocityAngular(TypedQuantity):
5385
5737
  return ts.VelocityAngularSetter(self, value)
5386
5738
 
5387
5739
 
5388
- class VelocityLinear(TypedQuantity):
5740
+ class VelocityLinear(FieldQnty):
5389
5741
  """
5390
5742
  Type-safe velocity, linear quantity with expression capabilities.
5391
5743
 
@@ -5401,10 +5753,11 @@ class VelocityLinear(TypedQuantity):
5401
5753
 
5402
5754
  Available units: "foot_per_hour", "foot_per_minute", "foot_per_second"
5403
5755
  """
5756
+
5404
5757
  __slots__ = ()
5405
5758
  _setter_class = ts.VelocityLinearSetter
5406
- _expected_dimension = dim.VELOCITY_LINEAR
5407
-
5759
+ _dimension = dim.VELOCITY_LINEAR
5760
+
5408
5761
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
5409
5762
  """
5410
5763
  Initialize velocity, linear quantity.
@@ -5423,13 +5776,15 @@ class VelocityLinear(TypedQuantity):
5423
5776
  super().__init__(name_or_value, unit, name, is_known=is_known)
5424
5777
  else:
5425
5778
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
5779
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
5426
5780
 
5427
- def set(self, value: int | float) -> ts.VelocityLinearSetter:
5781
+ def set(self, value: float, unit: str | None = None) -> ts.VelocityLinearSetter:
5428
5782
  """
5429
5783
  Create a setter for this velocity, linear quantity.
5430
5784
 
5431
5785
  Args:
5432
5786
  value: The numeric value to set
5787
+ unit: Optional unit string (for compatibility with base class)
5433
5788
 
5434
5789
  Returns:
5435
5790
  VelocityLinearSetter: A setter with unit properties like .meters, .inches, etc.
@@ -5441,7 +5796,7 @@ class VelocityLinear(TypedQuantity):
5441
5796
  return ts.VelocityLinearSetter(self, value)
5442
5797
 
5443
5798
 
5444
- class ViscosityDynamic(TypedQuantity):
5799
+ class ViscosityDynamic(FieldQnty):
5445
5800
  """
5446
5801
  Type-safe viscosity, dynamic quantity with expression capabilities.
5447
5802
 
@@ -5457,10 +5812,11 @@ class ViscosityDynamic(TypedQuantity):
5457
5812
 
5458
5813
  Available units: "centipoise", "dyne_second_per_square_centimeter", "kilopound_second_per_square_meter"
5459
5814
  """
5815
+
5460
5816
  __slots__ = ()
5461
5817
  _setter_class = ts.ViscosityDynamicSetter
5462
- _expected_dimension = dim.VISCOSITY_DYNAMIC
5463
-
5818
+ _dimension = dim.VISCOSITY_DYNAMIC
5819
+
5464
5820
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
5465
5821
  """
5466
5822
  Initialize viscosity, dynamic quantity.
@@ -5479,13 +5835,15 @@ class ViscosityDynamic(TypedQuantity):
5479
5835
  super().__init__(name_or_value, unit, name, is_known=is_known)
5480
5836
  else:
5481
5837
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
5838
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
5482
5839
 
5483
- def set(self, value: int | float) -> ts.ViscosityDynamicSetter:
5840
+ def set(self, value: float, unit: str | None = None) -> ts.ViscosityDynamicSetter:
5484
5841
  """
5485
5842
  Create a setter for this viscosity, dynamic quantity.
5486
5843
 
5487
5844
  Args:
5488
5845
  value: The numeric value to set
5846
+ unit: Optional unit string (for compatibility with base class)
5489
5847
 
5490
5848
  Returns:
5491
5849
  ViscosityDynamicSetter: A setter with unit properties like .meters, .inches, etc.
@@ -5497,7 +5855,7 @@ class ViscosityDynamic(TypedQuantity):
5497
5855
  return ts.ViscosityDynamicSetter(self, value)
5498
5856
 
5499
5857
 
5500
- class ViscosityKinematic(TypedQuantity):
5858
+ class ViscosityKinematic(FieldQnty):
5501
5859
  """
5502
5860
  Type-safe viscosity, kinematic quantity with expression capabilities.
5503
5861
 
@@ -5513,10 +5871,11 @@ class ViscosityKinematic(TypedQuantity):
5513
5871
 
5514
5872
  Available units: "centistokes", "millistokes", "square_centimeter_per_second"
5515
5873
  """
5874
+
5516
5875
  __slots__ = ()
5517
5876
  _setter_class = ts.ViscosityKinematicSetter
5518
- _expected_dimension = dim.VISCOSITY_KINEMATIC
5519
-
5877
+ _dimension = dim.VISCOSITY_KINEMATIC
5878
+
5520
5879
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
5521
5880
  """
5522
5881
  Initialize viscosity, kinematic quantity.
@@ -5535,13 +5894,15 @@ class ViscosityKinematic(TypedQuantity):
5535
5894
  super().__init__(name_or_value, unit, name, is_known=is_known)
5536
5895
  else:
5537
5896
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
5897
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
5538
5898
 
5539
- def set(self, value: int | float) -> ts.ViscosityKinematicSetter:
5899
+ def set(self, value: float, unit: str | None = None) -> ts.ViscosityKinematicSetter:
5540
5900
  """
5541
5901
  Create a setter for this viscosity, kinematic quantity.
5542
5902
 
5543
5903
  Args:
5544
5904
  value: The numeric value to set
5905
+ unit: Optional unit string (for compatibility with base class)
5545
5906
 
5546
5907
  Returns:
5547
5908
  ViscosityKinematicSetter: A setter with unit properties like .meters, .inches, etc.
@@ -5553,7 +5914,7 @@ class ViscosityKinematic(TypedQuantity):
5553
5914
  return ts.ViscosityKinematicSetter(self, value)
5554
5915
 
5555
5916
 
5556
- class Volume(TypedQuantity):
5917
+ class Volume(FieldQnty):
5557
5918
  """
5558
5919
  Type-safe volume quantity with expression capabilities.
5559
5920
 
@@ -5569,10 +5930,11 @@ class Volume(TypedQuantity):
5569
5930
 
5570
5931
  Available units: "acre_foot", "acre_inch", "barrel_us_liquid"
5571
5932
  """
5933
+
5572
5934
  __slots__ = ()
5573
5935
  _setter_class = ts.VolumeSetter
5574
- _expected_dimension = dim.VOLUME
5575
-
5936
+ _dimension = dim.VOLUME
5937
+
5576
5938
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
5577
5939
  """
5578
5940
  Initialize volume quantity.
@@ -5591,13 +5953,15 @@ class Volume(TypedQuantity):
5591
5953
  super().__init__(name_or_value, unit, name, is_known=is_known)
5592
5954
  else:
5593
5955
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
5956
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
5594
5957
 
5595
- def set(self, value: int | float) -> ts.VolumeSetter:
5958
+ def set(self, value: float, unit: str | None = None) -> ts.VolumeSetter:
5596
5959
  """
5597
5960
  Create a setter for this volume quantity.
5598
5961
 
5599
5962
  Args:
5600
5963
  value: The numeric value to set
5964
+ unit: Optional unit string (for compatibility with base class)
5601
5965
 
5602
5966
  Returns:
5603
5967
  VolumeSetter: A setter with unit properties like .meters, .inches, etc.
@@ -5609,7 +5973,7 @@ class Volume(TypedQuantity):
5609
5973
  return ts.VolumeSetter(self, value)
5610
5974
 
5611
5975
 
5612
- class VolumeFractionOfI(TypedQuantity):
5976
+ class VolumeFractionOfI(FieldQnty):
5613
5977
  """
5614
5978
  Type-safe volume fraction of "i" quantity with expression capabilities.
5615
5979
 
@@ -5625,10 +5989,11 @@ class VolumeFractionOfI(TypedQuantity):
5625
5989
 
5626
5990
  Available units: "cubic_centimeters_of_i_per_cubic_meter_total", "cubic_foot_of_i_per_cubic_foot_total", "cubic_meters_of_i_per_cubic_meter_total"
5627
5991
  """
5992
+
5628
5993
  __slots__ = ()
5629
5994
  _setter_class = ts.VolumeFractionOfISetter
5630
- _expected_dimension = dim.VOLUME_FRACTION_OF_I
5631
-
5995
+ _dimension = dim.VOLUME_FRACTION_OF_I
5996
+
5632
5997
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
5633
5998
  """
5634
5999
  Initialize volume fraction of "i" quantity.
@@ -5647,13 +6012,15 @@ class VolumeFractionOfI(TypedQuantity):
5647
6012
  super().__init__(name_or_value, unit, name, is_known=is_known)
5648
6013
  else:
5649
6014
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
6015
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
5650
6016
 
5651
- def set(self, value: int | float) -> ts.VolumeFractionOfISetter:
6017
+ def set(self, value: float, unit: str | None = None) -> ts.VolumeFractionOfISetter:
5652
6018
  """
5653
6019
  Create a setter for this volume fraction of "i" quantity.
5654
6020
 
5655
6021
  Args:
5656
6022
  value: The numeric value to set
6023
+ unit: Optional unit string (for compatibility with base class)
5657
6024
 
5658
6025
  Returns:
5659
6026
  VolumeFractionOfISetter: A setter with unit properties like .meters, .inches, etc.
@@ -5665,7 +6032,7 @@ class VolumeFractionOfI(TypedQuantity):
5665
6032
  return ts.VolumeFractionOfISetter(self, value)
5666
6033
 
5667
6034
 
5668
- class VolumetricCalorificHeatingValue(TypedQuantity):
6035
+ class VolumetricCalorificHeatingValue(FieldQnty):
5669
6036
  """
5670
6037
  Type-safe volumetric calorific (heating) value quantity with expression capabilities.
5671
6038
 
@@ -5681,10 +6048,11 @@ class VolumetricCalorificHeatingValue(TypedQuantity):
5681
6048
 
5682
6049
  Available units: "british_thermal_unit_per_cubic_foot", "british_thermal_unit_per_gallon_uk", "british_thermal_unit_per_gallon_us"
5683
6050
  """
6051
+
5684
6052
  __slots__ = ()
5685
6053
  _setter_class = ts.VolumetricCalorificHeatingValueSetter
5686
- _expected_dimension = dim.VOLUMETRIC_CALORIFIC_HEATING_VALUE
5687
-
6054
+ _dimension = dim.VOLUMETRIC_CALORIFIC_HEATING_VALUE
6055
+
5688
6056
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
5689
6057
  """
5690
6058
  Initialize volumetric calorific (heating) value quantity.
@@ -5703,13 +6071,15 @@ class VolumetricCalorificHeatingValue(TypedQuantity):
5703
6071
  super().__init__(name_or_value, unit, name, is_known=is_known)
5704
6072
  else:
5705
6073
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
6074
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
5706
6075
 
5707
- def set(self, value: int | float) -> ts.VolumetricCalorificHeatingValueSetter:
6076
+ def set(self, value: float, unit: str | None = None) -> ts.VolumetricCalorificHeatingValueSetter:
5708
6077
  """
5709
6078
  Create a setter for this volumetric calorific (heating) value quantity.
5710
6079
 
5711
6080
  Args:
5712
6081
  value: The numeric value to set
6082
+ unit: Optional unit string (for compatibility with base class)
5713
6083
 
5714
6084
  Returns:
5715
6085
  VolumetricCalorificHeatingValueSetter: A setter with unit properties like .meters, .inches, etc.
@@ -5721,7 +6091,7 @@ class VolumetricCalorificHeatingValue(TypedQuantity):
5721
6091
  return ts.VolumetricCalorificHeatingValueSetter(self, value)
5722
6092
 
5723
6093
 
5724
- class VolumetricCoefficientOfExpansion(TypedQuantity):
6094
+ class VolumetricCoefficientOfExpansion(FieldQnty):
5725
6095
  """
5726
6096
  Type-safe volumetric coefficient of expansion quantity with expression capabilities.
5727
6097
 
@@ -5737,10 +6107,11 @@ class VolumetricCoefficientOfExpansion(TypedQuantity):
5737
6107
 
5738
6108
  Available units: "gram_per_cubic_centimeter_per_kelvin_or_degree_celsius", "kilogram_per_cubic_meter_per_kelvin_or_degree_celsius", "pound_per_cubic_foot_per_degree_fahrenheit_or_degree_rankine"
5739
6109
  """
6110
+
5740
6111
  __slots__ = ()
5741
6112
  _setter_class = ts.VolumetricCoefficientOfExpansionSetter
5742
- _expected_dimension = dim.VOLUMETRIC_COEFFICIENT_OF_EXPANSION
5743
-
6113
+ _dimension = dim.VOLUMETRIC_COEFFICIENT_OF_EXPANSION
6114
+
5744
6115
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
5745
6116
  """
5746
6117
  Initialize volumetric coefficient of expansion quantity.
@@ -5759,13 +6130,15 @@ class VolumetricCoefficientOfExpansion(TypedQuantity):
5759
6130
  super().__init__(name_or_value, unit, name, is_known=is_known)
5760
6131
  else:
5761
6132
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
6133
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
5762
6134
 
5763
- def set(self, value: int | float) -> ts.VolumetricCoefficientOfExpansionSetter:
6135
+ def set(self, value: float, unit: str | None = None) -> ts.VolumetricCoefficientOfExpansionSetter:
5764
6136
  """
5765
6137
  Create a setter for this volumetric coefficient of expansion quantity.
5766
6138
 
5767
6139
  Args:
5768
6140
  value: The numeric value to set
6141
+ unit: Optional unit string (for compatibility with base class)
5769
6142
 
5770
6143
  Returns:
5771
6144
  VolumetricCoefficientOfExpansionSetter: A setter with unit properties like .meters, .inches, etc.
@@ -5777,7 +6150,7 @@ class VolumetricCoefficientOfExpansion(TypedQuantity):
5777
6150
  return ts.VolumetricCoefficientOfExpansionSetter(self, value)
5778
6151
 
5779
6152
 
5780
- class VolumetricFlowRate(TypedQuantity):
6153
+ class VolumetricFlowRate(FieldQnty):
5781
6154
  """
5782
6155
  Type-safe volumetric flow rate quantity with expression capabilities.
5783
6156
 
@@ -5793,10 +6166,11 @@ class VolumetricFlowRate(TypedQuantity):
5793
6166
 
5794
6167
  Available units: "cubic_feet_per_day", "cubic_feet_per_hour", "cubic_feet_per_minute"
5795
6168
  """
6169
+
5796
6170
  __slots__ = ()
5797
6171
  _setter_class = ts.VolumetricFlowRateSetter
5798
- _expected_dimension = dim.VOLUMETRIC_FLOW_RATE
5799
-
6172
+ _dimension = dim.VOLUMETRIC_FLOW_RATE
6173
+
5800
6174
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
5801
6175
  """
5802
6176
  Initialize volumetric flow rate quantity.
@@ -5815,13 +6189,15 @@ class VolumetricFlowRate(TypedQuantity):
5815
6189
  super().__init__(name_or_value, unit, name, is_known=is_known)
5816
6190
  else:
5817
6191
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
6192
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
5818
6193
 
5819
- def set(self, value: int | float) -> ts.VolumetricFlowRateSetter:
6194
+ def set(self, value: float, unit: str | None = None) -> ts.VolumetricFlowRateSetter:
5820
6195
  """
5821
6196
  Create a setter for this volumetric flow rate quantity.
5822
6197
 
5823
6198
  Args:
5824
6199
  value: The numeric value to set
6200
+ unit: Optional unit string (for compatibility with base class)
5825
6201
 
5826
6202
  Returns:
5827
6203
  VolumetricFlowRateSetter: A setter with unit properties like .meters, .inches, etc.
@@ -5833,7 +6209,7 @@ class VolumetricFlowRate(TypedQuantity):
5833
6209
  return ts.VolumetricFlowRateSetter(self, value)
5834
6210
 
5835
6211
 
5836
- class VolumetricFlux(TypedQuantity):
6212
+ class VolumetricFlux(FieldQnty):
5837
6213
  """
5838
6214
  Type-safe volumetric flux quantity with expression capabilities.
5839
6215
 
@@ -5849,10 +6225,11 @@ class VolumetricFlux(TypedQuantity):
5849
6225
 
5850
6226
  Available units: "cubic_feet_per_square_foot_per_day", "cubic_feet_per_square_foot_per_hour", "cubic_feet_per_square_foot_per_minute"
5851
6227
  """
6228
+
5852
6229
  __slots__ = ()
5853
6230
  _setter_class = ts.VolumetricFluxSetter
5854
- _expected_dimension = dim.VOLUMETRIC_FLUX
5855
-
6231
+ _dimension = dim.VOLUMETRIC_FLUX
6232
+
5856
6233
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
5857
6234
  """
5858
6235
  Initialize volumetric flux quantity.
@@ -5871,13 +6248,15 @@ class VolumetricFlux(TypedQuantity):
5871
6248
  super().__init__(name_or_value, unit, name, is_known=is_known)
5872
6249
  else:
5873
6250
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
6251
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
5874
6252
 
5875
- def set(self, value: int | float) -> ts.VolumetricFluxSetter:
6253
+ def set(self, value: float, unit: str | None = None) -> ts.VolumetricFluxSetter:
5876
6254
  """
5877
6255
  Create a setter for this volumetric flux quantity.
5878
6256
 
5879
6257
  Args:
5880
6258
  value: The numeric value to set
6259
+ unit: Optional unit string (for compatibility with base class)
5881
6260
 
5882
6261
  Returns:
5883
6262
  VolumetricFluxSetter: A setter with unit properties like .meters, .inches, etc.
@@ -5889,7 +6268,7 @@ class VolumetricFlux(TypedQuantity):
5889
6268
  return ts.VolumetricFluxSetter(self, value)
5890
6269
 
5891
6270
 
5892
- class VolumetricMassFlowRate(TypedQuantity):
6271
+ class VolumetricMassFlowRate(FieldQnty):
5893
6272
  """
5894
6273
  Type-safe volumetric mass flow rate quantity with expression capabilities.
5895
6274
 
@@ -5905,10 +6284,11 @@ class VolumetricMassFlowRate(TypedQuantity):
5905
6284
 
5906
6285
  Available units: "gram_per_second_per_cubic_centimeter", "kilogram_per_hour_per_cubic_foot", "kilogram_per_hour_per_cubic_meter"
5907
6286
  """
6287
+
5908
6288
  __slots__ = ()
5909
6289
  _setter_class = ts.VolumetricMassFlowRateSetter
5910
- _expected_dimension = dim.VOLUMETRIC_MASS_FLOW_RATE
5911
-
6290
+ _dimension = dim.VOLUMETRIC_MASS_FLOW_RATE
6291
+
5912
6292
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
5913
6293
  """
5914
6294
  Initialize volumetric mass flow rate quantity.
@@ -5927,13 +6307,15 @@ class VolumetricMassFlowRate(TypedQuantity):
5927
6307
  super().__init__(name_or_value, unit, name, is_known=is_known)
5928
6308
  else:
5929
6309
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
6310
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
5930
6311
 
5931
- def set(self, value: int | float) -> ts.VolumetricMassFlowRateSetter:
6312
+ def set(self, value: float, unit: str | None = None) -> ts.VolumetricMassFlowRateSetter:
5932
6313
  """
5933
6314
  Create a setter for this volumetric mass flow rate quantity.
5934
6315
 
5935
6316
  Args:
5936
6317
  value: The numeric value to set
6318
+ unit: Optional unit string (for compatibility with base class)
5937
6319
 
5938
6320
  Returns:
5939
6321
  VolumetricMassFlowRateSetter: A setter with unit properties like .meters, .inches, etc.
@@ -5945,7 +6327,7 @@ class VolumetricMassFlowRate(TypedQuantity):
5945
6327
  return ts.VolumetricMassFlowRateSetter(self, value)
5946
6328
 
5947
6329
 
5948
- class Wavenumber(TypedQuantity):
6330
+ class Wavenumber(FieldQnty):
5949
6331
  """
5950
6332
  Type-safe wavenumber quantity with expression capabilities.
5951
6333
 
@@ -5961,10 +6343,11 @@ class Wavenumber(TypedQuantity):
5961
6343
 
5962
6344
  Available units: "diopter", "kayser", "reciprocal_meter"
5963
6345
  """
6346
+
5964
6347
  __slots__ = ()
5965
6348
  _setter_class = ts.WavenumberSetter
5966
- _expected_dimension = dim.WAVENUMBER
5967
-
6349
+ _dimension = dim.WAVENUMBER
6350
+
5968
6351
  def __init__(self, name_or_value: str | int | float, unit: str | None = None, name: str | None = None, is_known: bool = True):
5969
6352
  """
5970
6353
  Initialize wavenumber quantity.
@@ -5983,13 +6366,15 @@ class Wavenumber(TypedQuantity):
5983
6366
  super().__init__(name_or_value, unit, name, is_known=is_known)
5984
6367
  else:
5985
6368
  raise ValueError("Must provide either just name (unknown) or value, unit, and name (known)")
6369
+ self.set_arithmetic_mode('expression') # Default expression mode for backward compatibility
5986
6370
 
5987
- def set(self, value: int | float) -> ts.WavenumberSetter:
6371
+ def set(self, value: float, unit: str | None = None) -> ts.WavenumberSetter:
5988
6372
  """
5989
6373
  Create a setter for this wavenumber quantity.
5990
6374
 
5991
6375
  Args:
5992
6376
  value: The numeric value to set
6377
+ unit: Optional unit string (for compatibility with base class)
5993
6378
 
5994
6379
  Returns:
5995
6380
  WavenumberSetter: A setter with unit properties like .meters, .inches, etc.