Skip to content

Commit

Permalink
? does each TempIOC subclass need a unique name?
Browse files Browse the repository at this point in the history
  • Loading branch information
shilorigins committed Aug 1, 2024
1 parent 39c3cce commit f6e5b6f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions superscore/tests/ioc/ioc.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,18 @@ class IOCFactory:
"""
Generates TempIOC subclasses bound to a set of PVs.
"""
@staticmethod
def from_entries(entries: Iterable[Entry], **ioc_options) -> PVGroup:

count = 0

@classmethod
def from_entries(cls, entries: Iterable[Entry], **ioc_options) -> PVGroup:
"""
Defines and instantiates a TempIOC subclass containing all PVs reachable
from entries.
"""
attrs = IOCFactory.prepare_attrs(entries)
IOC = type("IOC", (TempIOC,), attrs)
IOC = type(f"IOC{cls.count}", (TempIOC,), attrs)
cls.count += 1
ioc = IOC(**ioc_options)
return ioc

Expand Down

0 comments on commit f6e5b6f

Please sign in to comment.