Skip to content

Commit

Permalink
[speckle] speckle.from_name
Browse files Browse the repository at this point in the history
  • Loading branch information
majidaldo committed Feb 20, 2025
1 parent 263e5c5 commit 9a45c28
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions speckle/src/bim2rdf_speckle/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ def __init__(self, id: str):
if p['id'] != id:
raise ValueError('project not found')
self.id = id

@classmethod
def from_name(cls, name: str):
_ = [p for p in cls.s() if p.name == name ]
assert(len(_) == 1)
return _[0]

from functools import cached_property, cache
@cached_property
Expand Down

0 comments on commit 9a45c28

Please sign in to comment.