visualdynamics.compatibility¶
compatibility
¶
Do the objects in a test belong together?
Everything carrying DOFs — mode shapes, data records, channel table rows — names nodes. Those nodes have to exist in the geometry the test is being interpreted against, or the object describes a different structure: airplane mode shapes beside a plate geometry are not a test, they are a mistake.
Compatibility is judged against the geometry each object answers to: its link group's geometry when it has one — a FEM shape set beside its own FEM mesh is consistent, whichever geometry is active — and the one active geometry otherwise, so a test holding two models gives a definite answer instead of "compatible with something". Objects with no DOFs (a geometry itself) are never flagged, and with no active geometry nothing is checked — importing data before its geometry must not paint everything red.
A data object whose DOFs are modal coordinates (M1 … Mn,
validate.modal_coordinate) names no node at all: it answers to a
shape set, the one it was transformed through, and fits wherever a
set with at least that many modes is — its link group's set when it
has one, any set in the project otherwise (Brandon, 2026-09-04: the
modal responses belong in the group with the shapes and the record
they came from).
Deliberately not part of this:
- units, which have their own indicator
- direction validity: a geometry does not restrict directions, so 101RX+ is fine wherever node 101 exists
- whether two data objects can be compared with each other
Classes:
| Name | Description |
|---|---|
Issue |
Why one object does not fit the active geometry. |
Report |
Compatibility of every object in a test. |
Functions:
| Name | Description |
|---|---|
modal_object |
The highest mode a data object's coordinates name, when every |
check_modal |
The Issue for a modal object against the shape sets among its |
blocks_a_link |
Whether an issue is reason to refuse a link outright. |
check_object |
The Issue for one object against a geometry, or None if it fits. |
check_compatibility |
Check every object in a test against the geometry it answers to. |
Classes¶
Issue
dataclass
¶
Why one object does not fit the active geometry.
Report
dataclass
¶
Compatibility of every object in a test.
Methods:
| Name | Description |
|---|---|
is_compatible |
Whether one object fits the geometry it is linked to. |
issue_for |
What is wrong with one object, or None if nothing is. |
sub_item_flagged |
Whether one record within an object is incompatible. |
Attributes:
| Name | Type | Description |
|---|---|---|
incompatible_names |
list[str]
|
The objects that do not fit the geometry, by name — what |
Attributes¶
incompatible_names
property
¶
The objects that do not fit the geometry, by name — what the tree marks in red and a link refuses over.
Methods:¶
is_compatible
¶
Whether one object fits the geometry it is linked to.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The object to ask about. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
Whether it fits the geometry it is linked to. |
Source code in src/visualdynamics/compatibility.py
issue_for
¶
issue_for(name: str) -> Issue | None
What is wrong with one object, or None if nothing is.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The object to ask about. |
required |
Returns:
| Type | Description |
|---|---|
Issue or None
|
What is wrong with it, or None if nothing is. |
Source code in src/visualdynamics/compatibility.py
sub_item_flagged
¶
Whether one record within an object is incompatible.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The object to ask about. |
required |
index
|
int
|
Which record within it. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
Whether that record is one of the incompatible ones. |
Source code in src/visualdynamics/compatibility.py
Functions:¶
modal_object
¶
The highest mode a data object's coordinates name, when every one of its DOFs is a modal coordinate — else None.
Source code in src/visualdynamics/compatibility.py
check_modal
¶
check_modal(name: str, obj: Any, companions: Mapping[str, Any]) -> Issue | None
The Issue for a modal object against the shape sets among its companions, or None when one of them has every mode it names.
Source code in src/visualdynamics/compatibility.py
blocks_a_link
¶
blocks_a_link(issue: Issue | None) -> bool
Whether an issue is reason to refuse a link outright.
Naming nodes the geometry lacks is not. It is reported, in red, by the indicator this module exists to feed — and that is the whole of the answer it gets. A link is a statement about which objects belong together, and a test names places the model does not draw as a matter of course: drive points, control coordinates, computed locations, virtual channels. Twice in two days a real report died on them (Brandon, 2026-09-20 and 2026-09-21), the second time on an object whose channels were all virtual — which is why the first attempt at this, refusing only when nothing overlapped, was not a line that could be drawn. A controller's control object and a foreign mode shape look the same from here; the person reading the red indicator can tell them apart, and this function cannot.
What still blocks is what is not about nodes at all: a modal record with no shape set to answer to has nothing to be drawn against in any geometry. (Two geometries in one link is refused before this is ever called.)
Source code in src/visualdynamics/compatibility.py
check_object
¶
check_object(name: str, obj: Any, geometry: Geometry | None, geometry_name: str = 'the active geometry', companions: Mapping[str, Any] | None = None) -> Issue | None
The Issue for one object against a geometry, or None if it fits.
companions are the objects it is grouped with, for a modal
object, which answers to a shape set among them rather than to
the geometry.
Source code in src/visualdynamics/compatibility.py
check_compatibility
¶
check_compatibility(objects: Mapping[str, Any], geometry_name: str | None = None, links: Sequence[Mapping[str, Any]] | None = None) -> Report
Check every object in a test against the geometry it answers to.
objects maps name -> object. An object linked into a group that
holds a geometry is judged against that geometry — a FEM shape
set beside its own FEM mesh is consistent, whichever geometry is
active. Everything else is judged against geometry_name (the
active geometry; without it the first geometry found). Returns a
Report.