-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could trivially generate util functions that maintain the same interface as before, and would avoid breaking designs. That said, I think only Ruben falls into that bucket
@deprecated("Use instance method `nodes_with_trait` instead")
def get_all_nodes_with_trait[T](node: T, trait) -> list[Nodes]:
return node.nodes_with_trait(trait)
etc....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah generally good idea. Had it like that. But deliberately chose to get rid of util.py for good.
This is ofc resulting in a 4.1.0 next release.
from faebryk.core.util import get_all_nodes_with_trait | ||
|
||
esphome_components = get_all_nodes_with_trait(G, F.has_esphome_config) | ||
esphome_components = G.nodes_with_trait(F.has_esphome_config) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the implication of using a Graph
, rather than a Node
that you can pre-process it with other filters etc...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but also node should be only used if we respect the hierarchy.
Since the esphome exporter looks for connected buses this breaks hierarchy and thus is better of using the full graph.
Core: OO style functions
Description
Move core/util.py functions into respective classes (Node, Module, ...)
Improves ergonomics by a lot.
Checklist
Please read and execute the following:
Code of Conduct
By submitting this issue, you agree to follow our Code of Conduct: