Skip to content

Conversation

@mattseddon
Copy link
Contributor

@mattseddon mattseddon commented Jun 3, 2022

Closes #1183.
Closes #1768.
Relates to #1657.

This PR may seem gigantic at first glance but the file count is significantly contributed by the name change of joinColumnPath and also renaming a variable in the columns data (name => label). The diff is largely accounted for by changes to the test fixture and tests.

Demo

Screen.Recording.2022-06-06.at.9.22.51.am.mov

(plots not broken)

Screen Shot 2022-06-06 at 9 26 41 am

(colors)

Screen.Recording.2022-06-06.at.9.33.55.am.mov

@mattseddon mattseddon added the product PR that affects product label Jun 3, 2022
@mattseddon mattseddon self-assigned this Jun 3, 2022
@mattseddon mattseddon force-pushed the add-deps-to-experiment-table branch from 1b4fa68 to 2483338 Compare June 3, 2022 07:25
)
}

const walkValueTree = (

Choose a reason for hiding this comment

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

Function walkValueTree has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.

@mattseddon mattseddon force-pushed the add-deps-to-experiment-table branch from 00190fe to a7b0dd3 Compare June 4, 2022 11:37
"description": "Color to indicate a DVC dep column in the experiments table",
"defaults": {
"dark": "#b079e7",
"light": "#4f1886"
Copy link
Contributor Author

@mattseddon mattseddon Jun 4, 2022

Choose a reason for hiding this comment

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

[C] I'm open to suggestions on these.

group: type,
id: path,
name
name: label
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[F] Although we need name for react-table we now need label for both the plots and columns trees. It makes sense to use label throughout the extension and name: label here for consistency.

const paramWithNumbers = param.find(p => p.label === 'withNumbers') as Column
const paramWithoutNumbers = param.find(
p => p.name === 'withoutNumbers'
p => p.label === 'withoutNumbers'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[F] For changes of name to label see this.

column =>
column.path ===
joinColumnPath(ColumnType.PARAMS, 'params.yaml', 'mixedNumber')
buildMetricOrParamPath(ColumnType.PARAMS, 'params.yaml', 'mixedNumber')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[F] We now have different builders for Params and Metrics and Deps due to the different data structures. Hence the rename here (and throughout the PR).

collectDepChanges(changes, workspaceData, commitData)
}

export const collectParamsFiles = (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[F] This has just been relocated unchanged from extension/src/experiments/columns/collect.ts.

@@ -0,0 +1,93 @@
import { join } from 'path'
Copy link
Contributor Author

@mattseddon mattseddon Jun 5, 2022

Choose a reason for hiding this comment

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

[F] In order to accommodate the split in logic between metrics & params and deps I moved extension/src/experiments/columns/collect.ts. => extension/src/experiments/columns/collect/index.tsand created extension/src/experiments/columns/collect/deps.ts, extension/src/experiments/columns/collect/metricsAndParams.ts extension/src/experiments/columns/collect/util.ts (shared helpers) files. This has added significantly to the diff here.

return changes.sort()
}

export const collectParamsFiles = (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[F] This has just been relocated unchanged from extension/src/experiments/columns/collect.ts.

}

collectMetricAndParamChanges(changes, workspace, currentCommit)
collectDepChanges(changes, workspace, currentCommit)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[F] This is new logic. The rest is unchanged.

parentPath: string,
type: ColumnType
) => {
if (!acc[path]) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[F] This behavioral change will save us a significant amount of cycles. If we've seen the path before we've already walked all of its children so we can't gain anything by walking it again.

) => {
const [path, ...rest] = ancestors
/*
The depth is only limited for the middle of the path array.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[F] Updated this comment because I am not passing more to the function but it actually confused me more having this here.

dvcRoot,
workspaceState,
PersistenceKey.METRICS_AND_PARAMS_STATUS,
splitColumnPath
Copy link
Contributor Author

@mattseddon mattseddon Jun 5, 2022

Choose a reason for hiding this comment

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

[F] We are now adding the label to each element instead of having this function (it is no longer as simple to get this value from the path). Overall makes the base class cleaner.

[join('src', 'evaluate.py')]: '44e714021a65edf881b1716e791d7f59',
[join('src', 'featurization.py')]: 'e0265fc22f056a4b86d85c3056bc2894',
[join('src', 'prepare.py')]: '935ee6803ac617d0ef138ac33a9e9a77',
[join('src', 'train.py')]: 'c3961d777cfbd7727f9fde4851896006'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[F] This is the data structure that we're running with for deps for now.

@mattseddon mattseddon force-pushed the add-deps-to-experiment-table branch from 06cbf43 to d81a2f2 Compare June 5, 2022 23:30
@mattseddon mattseddon marked this pull request as ready for review June 5, 2022 23:42
@mattseddon mattseddon changed the title Add deps to experiment table Add deps to experiment table and columns tree Jun 5, 2022
@shcheklein
Copy link
Contributor

Cool stuff, @mattseddon ! Questions / followups (at least keep tickets open):

  • do we apply any filtering logic to deps or just show all of them?
  • showing full hash doesn't seem useful, probably showing hash is not useful at all tbh. We need to show that was touched / changed (Studio does this). And probably show file size by default not hash.

@mattseddon
Copy link
Contributor Author

mattseddon commented Jun 6, 2022

  • do we apply any filtering logic to deps or just show all of them?

We show them all, as per #1183 (comment)

  • showing full hash doesn't seem useful, probably showing hash is not useful at all tbh. We need to show that was touched / changed (Studio does this). And probably show file size by default not hash.

I can change to file size. Currently when the hash is changed against the HEAD it will be highlighted (same as for all params and metrics). E.g with train.py changed:

image

I incorrectly copied the CLI, they show the first 7 characters of the hash:

image

Can we copy the CLI to get this in and address all changes via #1657?
(#1657 is different to the issues this closes)

@mattseddon
Copy link
Contributor Author

The deps values are also based on the dvc.lock so they are not "live updated" when the workspace is changed. They are only updated by running dvc commit.

@shcheklein
Copy link
Contributor

We show them all, as per #1183 (comment)

Yep, let's just keep the relevant tickets open please. We need to the next step as part of the story.

I can change to file size. Currently when the hash is changed against the HEAD it will be highlighted (same as for all params and metrics). E.g with train.py changed:

yep, let's show size by default, but also show some yellow dot nearby to highlight the changes (dot itself might be even more useful vs size and hash to be honest)

Can we copy the CLI to get this in and address all changes via #1657?

yep

@mattseddon
Copy link
Contributor Author

We show them all, as per #1183 (comment)

Yep, let's just keep the relevant tickets open please. We need to the next step as part of the story.

I can change to file size. Currently when the hash is changed against the HEAD it will be highlighted (same as for all params and metrics). E.g with train.py changed:

yep, let's show size by default, but also show some yellow dot nearby to highlight the changes (dot itself might be even more useful vs size and hash to be honest)

Can we copy the CLI to get this in and address all changes via #1657?

yep

Updated and added a relevant comment in #1657.

@qlty-cloud-legacy
Copy link

Code Climate has analyzed commit 3fd7fa9 and detected 0 issues on this pull request.

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

This pull request will bring the total coverage in the repository to 96.9% (0.0% change).

View more on Code Climate.

@mattseddon mattseddon merged commit 88b5ad2 into main Jun 6, 2022
@mattseddon mattseddon deleted the add-deps-to-experiment-table branch June 6, 2022 17:56
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.

No experiments / no plots screen stuck Include deps columns in experiment table (dataset columns)

3 participants