Skip to content

Conversation

@drewj-tp
Copy link
Contributor

@drewj-tp drewj-tp commented Aug 29, 2025

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 Assembly or Block and you want to check if it is eligible for this detailed treatment. Before, you would have to do something like:

allDetailed = hti.getDetailedAssemblies()
for a in r.core:
    if a in allDetailed:
        # do detailed thing
    else:
        # don't

This PR introduces HistoryTrackerInterface.isDetailedAssembly to check if a given assembly is considered detailed or not. Similarly, the HistoryTrackerInterface.isDetailedBlock will check if a block is in a detailed assembly. Mostly by just checking if the parent isDetailedAssembly so maybe not a lot of value?

Doing this, you can pretty easily write iterators/generators to find all the detailed assemblies in the Core right now. I added one example in ba054c6:

for a in filter(hti.isDetailedAssembly, r.core):
    # do detailed thing

You could use itertools.chain.from_iterable to get the detailed blocks with e.g.,:

asms = filter(hti.isDetailedAssembly, r.core)
blocks = itertools.chain.from_iterable(asms)

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.isDetailedAssembly and isDetailedBlock for checking if an assembly or block is considered "detailed"

One-line Impact on Requirements: N/A


Checklist

@drewj-tp drewj-tp self-assigned this Aug 29, 2025
@john-science john-science self-requested a review August 29, 2025 19:31
@john-science john-science added the feature request Smaller user request label Aug 29, 2025
@john-science john-science changed the title Provide ways to quicky check if an assembly or block is "detailed" Providing ways to check if an assembly or block is "detailed" Aug 29, 2025
@drewj-tp drewj-tp marked this pull request as draft August 29, 2025 20:39
@drewj-tp
Copy link
Contributor Author

Drafting to make sure we've got the history tools we need. Should be good, but let's not waste some CI time

@john-science
Copy link
Member

Drafting to make sure we've got the history tools we need. Should be good, but let's not waste some CI time

In GitHub, CI still runs on Draft.

The ARMI workflow for Draft vs Open PRs is this:

If the PR Author does not want the PR Reviewer to review the PR yet, they mark the PR as "Draft".

This is typically done because the PR is still under development, and reviewing an incomplete PR wastes REVIEWER time. Though, for the sake of the PR author, CI will still run so they can see if their tests pass.

Just FYI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request Smaller user request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a generator/iterator method to retrieve detailed assemblies

3 participants