Merged
Conversation
Collaborator
james-bruten-mo
left a comment
There was a problem hiding this comment.
Nice use of the classmethod!
A couple of minor suggestions
gh_review_project/review_project.py
Outdated
| self.test = test | ||
|
|
||
| @classmethod | ||
| def from_github(cls, capture: bool = False, file: Path = None) -> "ProjectData": |
Collaborator
There was a problem hiding this comment.
Suggested change
| def from_github(cls, capture: bool = False, file: Path = None) -> "ProjectData": | |
| def from_github(cls, capture: bool = False, file: Path = None) -> ProjectData: |
And then you'll need from __future__ import annotations. You actually don't need the import at python 14.0, but we're not commonly using that yet
gh_review_project/review_project.py
Outdated
| Retrieve data from GitHub API and initialise the class. | ||
| """ | ||
| command = "gh project item-list 376 -L 500 --owner MetOffice --format json" | ||
| output = subprocess.run(command.split(), capture_output=True, timeout=180) |
Collaborator
There was a problem hiding this comment.
Suggested change
| output = subprocess.run(command.split(), capture_output=True, timeout=180) | |
| output = subprocess.run(shlex.split(command), capture_output=True, timeout=180) |
and import shlex - I learnt this one recently, it's great!
gh_review_project/review_project.py
Outdated
| store it in a dictionary keyed by repository. | ||
| """ | ||
|
|
||
| data = {} |
Collaborator
There was a problem hiding this comment.
Suggested change
| data = {} | |
| data = defaultdict(list) |
with from collections import defaultdict
And then below there's no need to check if repo is in data. Just do data[repo].append(pull_request) and it'll create it
james-bruten-mo
approved these changes
Feb 2, 2026
Collaborator
james-bruten-mo
left a comment
There was a problem hiding this comment.
Looks good, cheers
r-sharp
pushed a commit
to r-sharp/SimSys_Scripts
that referenced
this pull request
Feb 4, 2026
* Expand list of repositories for milestones * Extract project class into own file * Rename directory * tidy unneeded structure. * typo * black * refactor with classmethods * black * process filepath better * CR suggestions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR Summary
Sci/Tech Reviewer:
Code Reviewer: @james-bruten-mo
I've pulled the code for interacting with a github project into its own module as I would like to use this for a new script too. I've refactored workload.py to use this, and modified the interface to hopefully make it a little more generic. I've also removed the hardcoded list of repositories from workload.py, instead now including columns in the SSD table for all repos that have PRs in the project so that everything is included. This is lots at the moment as we had some wide-reaching workflow updates, but hopefully in the future this will actually reduce the size of the table to not include empty columns.
I've also updated the repository list in the manage milestones list to be more complete and fixed a bug with "'s.
Code Quality Checklist
Testing
Security Considerations
AI Assistance and Attribution
Sci/Tech Review
(Please alert the code reviewer via a tag when you have approved the SR)
Code Review