Skip to content

Refactor strategies into a base class and child classes, good ol' OOO#326

Open
quantinuum-richard-morrison wants to merge 1 commit intofeat/long-running-job-monitoringfrom
class-based-strategies
Open

Refactor strategies into a base class and child classes, good ol' OOO#326
quantinuum-richard-morrison wants to merge 1 commit intofeat/long-running-job-monitoringfrom
class-based-strategies

Conversation

@quantinuum-richard-morrison
Copy link
Contributor

@quantinuum-richard-morrison quantinuum-richard-morrison commented Mar 11, 2026

Same code but refactored into classes with inheritance.

  • more pythonic (subjective, hand-wavy)
  • encapsulates functionality in classes, fewer names in the namespace (no more listen_job_status, hybrid_wait...)
  • fewer lines of python
  • extensible (user could subclass and adjust to their needs; the WaitStrategy is otherwise baked-in to qnexus and only offers three choices)
  • HybridStrategy explicitly uses the methods of its parent classes
  • shares code (not much, admittedly, but it's key logic: repeating key logic was previously repeated across multiple functions)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant