Var
Kind: Class
Domain: Expressions, units, and tolerances
Canonical import: from cadflow import Var
Signature
class Var(name: 'str', default: 'float', comment: 'str | None' = None, expr_id: 'str' = <factory>, tolerance: 'DimensionTolerance | None' = None, unit: 'Unit | None' = None, tolerance_unit: 'Unit | None' = None) -> None
Description
Named scalar parameter with optional physical-unit and tolerance intent.
Named scalar parameter with optional physical-unit and tolerance intent.
default and tolerance remain in their declared units. Evaluation, geometry parameters, and tolerance propagation convert them to CadFlow's canonical CAD units: millimeters for length and degrees for angle.
Parameters
| Name | Type | Required | Default | Source description |
|---|---|---|---|---|
name | 'str' | yes | - | Not explicitly described in the source docstring. |
default | 'float' | yes | - | Not explicitly described in the source docstring. |
comment | 'str | None' | no | None | Not explicitly described in the source docstring. |
expr_id | 'str' | no | <factory> | Not explicitly described in the source docstring. |
tolerance | 'DimensionTolerance | None' | no | None | Not explicitly described in the source docstring. |
unit | 'Unit | None' | no | None | Not explicitly described in the source docstring. |
tolerance_unit | 'Unit | None' | no | None | Not explicitly described in the source docstring. |
Returns
Type: None
The source docstring does not declare additional return semantics.
Errors
The source docstring does not declare a narrower exception contract. Invalid types, values, ownership, paths, or backend state may still raise the corresponding public error.
Data fields
| Name | Type | Default |
|---|---|---|
name | 'str' | required |
default | 'float' | required |
comment | 'str | None' | None |
expr_id | 'str' | factory |
tolerance | 'DimensionTolerance | None' | None |
unit | 'Unit | None' | None |
tolerance_unit | 'Unit | None' | None |
Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
canonical_default | property | - | See the member signature. |
canonical_tolerance | property | - | See the member signature. |
dimension | property | - | See the member signature. |
evaluate | method | (self, bindings: 'Mapping[str, float] | None' = None) -> 'float' | See the member signature. |
Behavior and constraints
- Instances are immutable dataclass values; update workflows return a replacement value.
Import check
from cadflow import Var