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

Queue experiment from existing #1159

Merged
merged 6 commits into from
Dec 15, 2021
Merged

Queue experiment from existing #1159

merged 6 commits into from
Dec 15, 2021

Conversation

mattseddon
Copy link
Member

@mattseddon mattseddon commented Dec 15, 2021

This PR begins to address the first part of #1135 by adding a multi-step quick pick/input box process to queue a new experiment from an existing one's params. We will be able to wire this up to the webview in the future and execute the command by selecting a row.

The steps are:

  1. choose an existing experiment
  2. choose params to vary
  3. queue experiment with new params

Demo

Screen.Recording.2021-12-15.at.4.49.03.pm.mov

Note: Queueing experiments using -S causes weird things to happen when we try to run them. This is a known issue: iterative/dvc#5971

@mattseddon mattseddon added the product PR that affects product label Dec 15, 2021
@mattseddon mattseddon self-assigned this Dec 15, 2021
@mattseddon mattseddon marked this pull request as ready for review December 15, 2021 05:52
import { Flag } from '../../../cli/args'
import { definedAndNonEmpty } from '../../../util/array'

export const pickParamsAndVary = async (params: Param[]) => {
Copy link

Choose a reason for hiding this comment

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

Function pickParamsAndVary has 30 lines of code (exceeds 25 allowed). Consider refactoring.

Comment on lines +171 to +176
public getExperimentNames() {
return [
'workspace',
...this.flattenExperiments().map(experiment => experiment.displayName)
].filter(Boolean) as string[]
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we consolidate this and pickExperimentName from extension/src/experiments/workspace.ts? As far as I can tell, they do the same thing but this is more efficient since it uses our internal model over running exp list.

Copy link
Member Author

Choose a reason for hiding this comment

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

This includes queued experiments. The other does not. I will take a look though.

Copy link
Member Author

Choose a reason for hiding this comment

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

@rogermparent we use AvailableCommands.EXPERIMENT_LIST_CURRENT for applying and branching experiments. We can switch to using code that pulls the names out of the model. I will follow up.

@codeclimate
Copy link

codeclimate bot commented Dec 15, 2021

Code Climate has analyzed commit bdae358 and detected 2 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 2

The test coverage on the diff in this pull request is 92.7% (85% is the threshold).

This pull request will bring the total coverage in the repository to 96.1% (-0.1% change).

View more on Code Climate.

@mattseddon mattseddon merged commit 193ef56 into master Dec 15, 2021
@mattseddon mattseddon deleted the queue-single-experiment branch December 15, 2021 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR that affects product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants