-
Notifications
You must be signed in to change notification settings - Fork 1
start status summarize option #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
format! |
Co-authored-by: Lukas <lupeterm@users.noreply.github.com>
format! |
Co-authored-by: Lukas <lupeterm@users.noreply.github.com>
!format |
format! |
Co-authored-by: Lukas <lupeterm@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor things to be resolved then it can be merged.
src/obr/signac_wrapper/operations.py
Outdated
def group_jobs(self, jobs: list[Job], summarize: int = 0) -> dict[str, list[Job]]: | ||
"""Returns the list of jobs of the given OpenFOAMProject where the last `summarize` levels are grouped together at the corresponding parent view.""" | ||
grouped = {} | ||
id_view_map = map_view_folder_to_job_id(os.path.join(self.path, "view")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should pass it as parameter, then we are more flexible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be clear, you suggest to pass the path, or the view map?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im going to go ahead and assume the former
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no the latter, generate the view map outside of this function and pass the map to group_jobs. Because we might pregenerate the map and use it somewhere else too.
src/obr/signac_wrapper/operations.py
Outdated
if p_view and p_view not in grouped: | ||
grouped[p_view] = [] | ||
view = p_view or id_view_map.get(jobid) | ||
job.doc["state"]["view"] = view |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
job.doc["state"]["view"] = view |
I think that should be somewhere else, otherwise it an unexpected side effect and hard to find later.
Co-authored-by: Gregor Olenik <go@hpsim.de>
format! |
Co-authored-by: Gregor Olenik <greole@users.noreply.github.com>
format! |
Adds
--summarize
CLI option forobr status