Skip to content

Conversation

@AlexJones0
Copy link

@AlexJones0 AlexJones0 commented Jan 30, 2026

This PR performs some small cleanup of the scheduler in preparation for potential larger-scale changes. Specifically, it aims to fix any outstanding pyright and ruff check failures that exist within the scheduler itself, to provide a good base for further refactoring or modification.

One other clear deficiency in the design that I wanted to address was the use of a string (always a single upper-case character) like "D", "P" or "K" to refer to the Job status, rather than the more standard Enumerated type. Using an Enum improves code readability & ergonomics, adds stricter typing of status values and better modularises the code - this is however a more wide-spread change that touches many different parts of DVSim, albeit a simple one.

Address the `S101` failure with ruff check.

Signed-off-by: Alex Jones <[email protected]>
Break apart a couple of the more complex functions to resolve ruff lint
warnings related to method complexity. Also take the opportunity to
slightly improve some of the documentation on these functions and to
refactor some of the code to be nicer to read.

Signed-off-by: Alex Jones <[email protected]>
There may still be more work needed on the typing front but this
resolves the singular remaining type error given by pyright within the
scheduler.

Signed-off-by: Alex Jones <[email protected]>
Currently the job status is passed around DVSim as a string, where the
expectation is that it is always a single upper case character in ('Q',
'D', 'P', 'F', 'K') - some limited parts of the code also handle an 'E'
error case.

Turn these into a small Enum type so that we have much stricter typing
on these values and improved ergonomics when referring to different job
statuses in code.

This status Enum lives in its own module instead of with the other job
data to avoid circular imports (as the job status' registered callbacks
reference the launcher definition).

Signed-off-by: Alex Jones <[email protected]>
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.

1 participant