mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-04-22 09:10:01 +02:00
fixes detection of property dependencies for classes inheriting from other observables
Inheriting from a class that itself has defined properties, you cannot get those properties by calling vars(type(obj)). Instead, you have to go through all the classes' members and check if they are properties. You can either do this using dir(type(obj)) and get the members using getattr or just use inspect.getmembers.
This commit is contained in:
parent
73b2355d35
commit
5b762db535
@ -49,7 +49,7 @@ class PropertyObserver(Observer):
|
|||||||
def _process_observable_properties(
|
def _process_observable_properties(
|
||||||
self, obj: Observable, deps: dict[str, Any], prefix: str
|
self, obj: Observable, deps: dict[str, Any], prefix: str
|
||||||
) -> None:
|
) -> None:
|
||||||
for k, value in vars(type(obj)).items():
|
for k, value in inspect.getmembers(type(obj)):
|
||||||
prefix = (
|
prefix = (
|
||||||
f"{prefix}." if prefix != "" and not prefix.endswith(".") else prefix
|
f"{prefix}." if prefix != "" and not prefix.endswith(".") else prefix
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user