-
Notifications
You must be signed in to change notification settings - Fork 97
Open
Labels
feature requestSmaller user requestSmaller user request
Description
The history tracker has two get* methods for retrieving detailed assemblies and blocks
getDetailAssembliesgetDetailBlocks
armi/armi/bookkeeping/historyTracker.py
Lines 246 to 266 in 41e169a
| def getDetailAssemblies(self) -> list["Assembly"]: | |
| """Returns the assemblies that have been signaled as detail assemblies.""" | |
| assems = [] | |
| if not self.detailAssemblyNames: | |
| runLog.info("No detail assemblies HistoryTrackerInterface") | |
| for name in self.detailAssemblyNames: | |
| try: | |
| assems.append(self.r.core.getAssemblyByName(name)) | |
| except KeyError: | |
| if name in {a.name for a in self.r.core}: | |
| raise Exception("Found it") | |
| runLog.warning( | |
| "Cannot find detail assembly {} in assemblies-by-name lookup table, which has {} entries".format( | |
| name, len(self.r.core.assembliesByName) | |
| ) | |
| ) | |
| return assems | |
| def getDetailBlocks(self) -> list["Block"]: | |
| """Get all blocks in all detail assemblies.""" | |
| return [block for a in self.getDetailAssemblies() for block in a] |
An iterator approach would be useful for cases where a client (me in this case) may not want a list of all the assemblies / blocks because that could be manifold.
Metadata
Metadata
Assignees
Labels
feature requestSmaller user requestSmaller user request