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

Refactor JobQueue & JobQueueStatus #5845

Merged
merged 1 commit into from
Aug 14, 2023

Conversation

andreas-el
Copy link
Contributor

@andreas-el andreas-el commented Aug 9, 2023

Issue
Resolves #my_issue

Approach
Short description of the approach

Pre review checklist

  • Added appropriate release note label
  • PR title captures the intent of the changes, and is fitting for release notes.
  • Commit history is consistent and clean, in line with the contribution guidelines.
  • Updated documentation
  • Ensured new behaviour is tested

Adding labels helps the maintainers when writing release notes. This is the list of release note labels.

@codecov-commenter
Copy link

codecov-commenter commented Aug 9, 2023

Codecov Report

Merging #5845 (fb3af75) into main (f66affb) will decrease coverage by 4.31%.
Report is 10 commits behind head on main.
The diff coverage is 60.00%.

@@            Coverage Diff             @@
##             main    #5845      +/-   ##
==========================================
- Coverage   86.03%   81.72%   -4.31%     
==========================================
  Files         329      347      +18     
  Lines       19386    21705    +2319     
  Branches        0      737     +737     
==========================================
+ Hits        16678    17738    +1060     
- Misses       2708     3714    +1006     
- Partials        0      253     +253     
Files Changed Coverage Δ
src/clib/lib/job_queue/job_queue.cpp 60.86% <0.00%> (ø)
src/ert/job_queue/queue.py 87.23% <50.00%> (+0.74%) ⬆️
src/clib/lib/job_queue/job_queue_status.cpp 94.11% <85.71%> (ø)

... and 21 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@andreas-el andreas-el added the release-notes:maintenance Automatically categorise as maintenance change in release notes label Aug 9, 2023
@andreas-el andreas-el changed the title Refactor counting of jobs Refactor JobQueue & JobQueueStatus Aug 9, 2023
@andreas-el andreas-el self-assigned this Aug 9, 2023
@@ -131,19 +129,19 @@ def __init__(self, driver: "Driver", max_submit: int = 2):

@property
def num_running(self) -> int:
return self._num_running() # type: ignore
return self._num_jobs(JobStatusType.JOB_QUEUE_RUNNING) # type: ignore

@property
Copy link
Contributor

Choose a reason for hiding this comment

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

Turns out that these are only used in __str__ and __repr__ could we just make those standard instead and remove these?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you clarify what you mean with 'standard' in this context?

Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking str the same as repr and repr satisfies https://docs.python.org/3/library/functions.html#repr in a simple way, such as "<JobQueue()>".

@andreas-el andreas-el force-pushed the remove_more_queue_related branch 3 times, most recently from fb3af75 to e7b1742 Compare August 10, 2023 07:45
Copy link
Contributor

@eivindjahren eivindjahren left a comment

Choose a reason for hiding this comment

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

👍

@andreas-el andreas-el merged commit a07afe4 into equinor:main Aug 14, 2023
41 of 42 checks passed
@andreas-el andreas-el deleted the remove_more_queue_related branch August 14, 2023 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes:maintenance Automatically categorise as maintenance change in release notes
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants