Providing ways to check if an assembly or block is "detailed" #2256
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the change? Why is it being made?
Detailed assemblies are those designated to get special treatment in physics codes. Sometimes, you have a specific
AssemblyorBlockand you want to check if it is eligible for this detailed treatment. Before, you would have to do something like:This PR introduces
HistoryTrackerInterface.isDetailedAssemblyto check if a given assembly is considered detailed or not. Similarly, theHistoryTrackerInterface.isDetailedBlockwill check if a block is in a detailed assembly. Mostly by just checking if the parentisDetailedAssemblyso maybe not a lot of value?Doing this, you can pretty easily write iterators/generators to find all the detailed assemblies in the
Coreright now. I added one example in ba054c6:You could use
itertools.chain.from_iterableto get the detailed blocks with e.g.,:We could move those into the full API if we want.
Closes #2156
At least for the scope I was looking for when I wrote that. I've scoped out internal usage and these methods will be useful and remove the need (well, my need) for an iterator of detailed assemblies.
SCR Information
Change Type: features
One-Sentence Description: Provide
HistoryTrackerInterface.isDetailedAssemblyandisDetailedBlockfor checking if an assembly or block is considered "detailed"One-line Impact on Requirements: N/A
Checklist
docfolder.pyproject.toml.