ReferenceAxis
- class ReferenceAxis
Bases:
CommonBaseModel
Represents the reference axis of a body component, such as an aircraft fuselage or wing.
- name
The name of the reference axis.
- Type:
str
- description
A brief description of the reference axis.
- Type:
Optional[str]
- relative_to
The name of another reference axis to which this axis is relative.
- Type:
Optional[str]
Attributes Summary
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Methods Summary
model_post_init
(context, /)This function is meant to behave like a BaseModel method to initialise private attributes.
resolve_relative_to
(values)Resolve the 'relative_to' name to a ReferenceAxis instance.
validate_and_register
(values)Ensure that the name is unique and register the instance.
validate_points
(value)Validate the 'points' list to ensure it contains at least two points.
Attributes Documentation
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'allow', 'protected_namespaces': (), 'validate_assignment': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Methods Documentation
- model_post_init(context, /)
This function is meant to behave like a BaseModel method to initialise private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self (BaseModel) – The BaseModel instance.
context (Any) – The context.
- Return type:
None
- classmethod resolve_relative_to(values)
Resolve the ‘relative_to’ name to a ReferenceAxis instance.
- Parameters:
values (dict) – The dictionary of field values.
- Returns:
The validated dictionary of field values.
- Raises:
ValueError – If the ‘relative_to’ name does not exist.
- Return type:
dict
- classmethod validate_and_register(values)
Ensure that the name is unique and register the instance.
- Parameters:
values (dict) – The dictionary of field values.
- Returns:
The validated dictionary of field values.
- Raises:
ValueError – If the name is not unique.
- Return type:
dict
- classmethod validate_points(value)
Validate the ‘points’ list to ensure it contains at least two points.
Methods:
validate_points
(value)Validate the 'points' list to ensure it contains at least two points.
validate_and_register
(values)Ensure that the name is unique and register the instance.
resolve_relative_to
(values)Resolve the 'relative_to' name to a ReferenceAxis instance.
__init__
(**data)Create a new model by parsing and validating input data from keyword arguments.
model_post_init
(context, /)This function is meant to behave like a BaseModel method to initialise private attributes.
Attributes:
__setattr__ handlers.
- classmethod validate_points(value)
Validate the ‘points’ list to ensure it contains at least two points.
- classmethod validate_and_register(values)
Ensure that the name is unique and register the instance.
- Parameters:
values (dict) – The dictionary of field values.
- Returns:
The validated dictionary of field values.
- Raises:
ValueError – If the name is not unique.
- Return type:
dict
- classmethod resolve_relative_to(values)
Resolve the ‘relative_to’ name to a ReferenceAxis instance.
- Parameters:
values (dict) – The dictionary of field values.
- Returns:
The validated dictionary of field values.
- Raises:
ValueError – If the ‘relative_to’ name does not exist.
- Return type:
dict
- __init__(**data)
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- __pydantic_setattr_handlers__: ClassVar[Dict[str, Callable[[BaseModel, str, Any], None]]] = {}
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__
- model_post_init(context, /)
This function is meant to behave like a BaseModel method to initialise private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self (BaseModel) – The BaseModel instance.
context (Any) – The context.
- Return type:
None