Skip to content
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

DM-34915: Add traversal of GenericWorkflow by job label. #127

Merged
merged 1 commit into from Jan 26, 2023

Conversation

MichelleGower
Copy link
Collaborator

@MichelleGower MichelleGower commented Jan 19, 2023

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

@codecov
Copy link

codecov bot commented Jan 19, 2023

Codecov Report

Base: 77.08% // Head: 78.43% // Increases project coverage by +1.34% 🎉

Coverage data is based on head (56b8137) compared to base (dceffc6).
Patch coverage: 97.65% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #127      +/-   ##
==========================================
+ Coverage   77.08%   78.43%   +1.34%     
==========================================
  Files          39       39              
  Lines        2736     2856     +120     
  Branches      412      415       +3     
==========================================
+ Hits         2109     2240     +131     
+ Misses        552      540      -12     
- Partials       75       76       +1     
Impacted Files Coverage Δ
python/lsst/ctrl/bps/generic_workflow.py 81.43% <88.00%> (+4.46%) ⬆️
tests/test_generic_workflow.py 98.97% <100.00%> (+1.14%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -394,21 +395,36 @@ def quanta_counts(self):
qcounts += gwjob.quanta_counts
return qcounts

@property
def labels(self):
"""List of job labels"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we specify property type, i.e., append

(`list` [`str`], read-only)

to the existing doctring?

gwjob = self.get_job(job_name)
jcounts[gwjob.label] += 1
for job_label in self._labels:
jcounts[job_label] = len(self._labels[job_label])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I got it right, the logic in lines 419-421 could be expressed as

jcounts = Counter({label: len(jobs) for label, jobs in self._labels.items()})

which may be IMHO somewhat easier to follow.

python/lsst/ctrl/bps/generic_workflow.py Outdated Show resolved Hide resolved
@MichelleGower MichelleGower marked this pull request as ready for review January 26, 2023 16:25
@MichelleGower MichelleGower merged commit 2ce073f into main Jan 26, 2023
@MichelleGower MichelleGower deleted the tickets/DM-34915 branch January 26, 2023 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants