Skip to content

Fix #23: Divide the launch modes into default vs internal#25

Merged
Intuity merged 9 commits intoIntuity:mainfrom
EdNutting:ednutting/issue-23
Jan 24, 2026
Merged

Fix #23: Divide the launch modes into default vs internal#25
Intuity merged 9 commits intoIntuity:mainfrom
EdNutting:ednutting/issue-23

Conversation

@EdNutting
Copy link
Contributor

Default is to assume the user is calling Gator and therefore to treat a single Job as though it is to be launched as per a normal JobGroup/JobArray, i.e. via the scheduler.

Internal mode tells Gator it's executing as a child on the actual runner instance, and therefore to expect a single job to run locally regardless of scheduler options.

Default is to assume the user is calling Gator and therefore to treat a single Job as though it is to be launched as per a normal JobGroup/JobArray, i.e. via the scheduler.

Internal mode tells Gator it's executing as a child on the actual runner instance, and therefore to expect a single job to run locally regardless of scheduler options.
@EdNutting
Copy link
Contributor Author

Tested on my cluster deployment of Gator on Slurm and it works.

I hadn't appreciated that Gator invokes itself for nested JobArray and JobGroup specs. This seems like an odd choice as it might result in the JobArray/JobGroup being dispatched onto individual Slurm nodes and then further distribution is restricted to just that slurm node. May need further investigation/consideration.
Copy link
Owner

@Intuity Intuity left a comment

Choose a reason for hiding this comment

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

The tests and handling look good, I'm just not 100% convinced on the necessity of the introduction of cast and a second minor style point around the assertion

# - Passed in directly (when used as a library
elif spec is not None and isinstance(spec, (Job, JobArray, JobGroup)):
pass
parsed_spec = cast(SpecBase, spec)
Copy link
Owner

Choose a reason for hiding this comment

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

I don't understand the need for this - introduction of this parsed_spec variable seems unnecessary, and the cast only exists to assist type checking (which is then replicated by line 101-104)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Introduction of this variable is necessary to stop mypy complaining like crazy about the types. The cast is necessary because of the inferred type of Spec not matching the specified type of parsed_spec.

Copy link
Contributor Author

@EdNutting EdNutting Jan 15, 2026

Choose a reason for hiding this comment

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

The check is repeated again later because the other if cases also cause MyPy to relax the inferred type, which causes the typecheck of parsed_spec to go awry later in the file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My suggestion is mypy is basically worthless if we're not going to actually fix the errors/warnings it generates. The current codebase has mypy configured and generates a very large number of issues. Happy to address them, or we could remove MyPy if it's just generating noise.

Copy link
Owner

Choose a reason for hiding this comment

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

I'm not sure where mypy is configured - I can't see any evidence of it existing in the codebase.

Having a type checker and fixing issues is probably a sensible thing to do - but it's worth considering using something like Astral ty for speed, and adding it into the precommit/CI flow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Huh, I wonder where my VSCode environment is running it from. I get a lot of stuff show up in my Problems view, and I assumed it'd come from the poetry install. Maybe one of the VSCode Python extensions has it enabled by default. Sorry about that. Either way, I think it's worth keeping the code type-correct (it's a personal dislike that so much Python code reuses variables mutating the type halfway through a function. I get that "it's Pythonic" but it just seems wrong to me.)

Co-authored-by: Peter Birch <peter.birch@intuity-design.co.uk>
@Intuity Intuity merged commit df95aa5 into Intuity:main Jan 24, 2026
5 of 6 checks passed
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.

2 participants