Skip to content

Commit

Permalink
Use cached_statepoint in groupby.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaander committed Feb 12, 2024
1 parent 4ebf74f commit 1de7155
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions signac/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -1913,7 +1913,7 @@ def keyfunction(job):
else:

def keyfunction(job):
return job.sp[stripped_key]
return job.cached_statepoint[stripped_key]

else:
if _is_doc_key(key):
Expand All @@ -1924,7 +1924,7 @@ def keyfunction(job):
else:

def keyfunction(job):
return job.sp.get(stripped_key, default)
return job.cached_statepoint.get(stripped_key, default)

elif isinstance(key, Iterable):
sp_keys = []
Expand All @@ -1943,15 +1943,15 @@ def keyfunction(job):

def keyfunction(job):
return tuple(
[job.sp[k] for k in sp_keys]
[job.cached_statepoint[k] for k in sp_keys]
+ [job.document[k] for k in doc_keys]
)

else:

def keyfunction(job):
return tuple(
[job.sp.get(k, default) for k in sp_keys]
[job.cached_statepoint.get(k, default) for k in sp_keys]
+ [job.document.get(k, default) for k in doc_keys]
)

Expand Down

0 comments on commit 1de7155

Please sign in to comment.