chore(deps): drop poetry as a dependency in the python automate template (#40)
* chore: bump specklepy * refactor: requirements files * refactor: dockerfile * refactor: update GitHub actions * refactor: update devcontainer config * docs: updated `README` * docs: better explanations * docs: wording * chore: dependabot config * docs: keeping things in sync * fix: skip pip upgrade * refactor: updated devcontainer * refactor: toml instead of requirements * refactor: update docker * docs: updated `README` * chore: classifiers does nothing * chore: wrap up the v3 transition --------- Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
This commit is contained in:
+4
-4
@@ -7,8 +7,8 @@ from specklepy.objects import Base
|
||||
|
||||
def flatten_base(base: Base) -> Iterable[Base]:
|
||||
"""Flatten a base object into an iterable of bases.
|
||||
|
||||
This function recursively traverses the `elements` or `@elements` attribute of the
|
||||
|
||||
This function recursively traverses the `elements` or `@elements` attribute of the
|
||||
base object, yielding each nested base object.
|
||||
|
||||
Args:
|
||||
@@ -19,9 +19,9 @@ def flatten_base(base: Base) -> Iterable[Base]:
|
||||
"""
|
||||
# Attempt to get the elements attribute, fallback to @elements if necessary
|
||||
elements = getattr(base, "elements", getattr(base, "@elements", None))
|
||||
|
||||
|
||||
if elements is not None:
|
||||
for element in elements:
|
||||
yield from flatten_base(element)
|
||||
|
||||
|
||||
yield base
|
||||
|
||||
Reference in New Issue
Block a user