Skip to content

Commit

Permalink
Watch deps and outs files for experiment updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mattseddon committed Oct 9, 2023
1 parent 7749280 commit 857f6ed
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
8 changes: 8 additions & 0 deletions extension/src/experiments/data/collect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,17 @@ describe('collectFiles', () => {
files.sort()

expect(files).toStrictEqual([
join('data', 'data.xml'),
join('data', 'features'),
join('data', 'prepared'),
'metrics.json',
'model.pkl',
join('nested', 'params.yaml'),
'params.yaml',
join('src', 'evaluate.py'),
join('src', 'featurization.py'),
join('src', 'prepare.py'),
join('src', 'train.py'),
'summary.json'
])
})
Expand Down
11 changes: 9 additions & 2 deletions extension/src/experiments/data/collect.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import { ExpData, ExpShowOutput, MetricsOrParams } from '../../cli/dvc/contract'
import {
Deps,
ExpData,
ExpShowOutput,
MetricsOrParams
} from '../../cli/dvc/contract'
import { getExpData } from '../columns/collect'

const collectFilesFromKeys = (
acc: Set<string>,
metricsOrParams: MetricsOrParams | null | undefined
metricsOrParams: MetricsOrParams | Deps | null | undefined
): void => {
for (const file of Object.keys(metricsOrParams || {})) {
if (!file) {
Expand All @@ -22,6 +27,8 @@ const collectFilesFromExperiment = (
}
collectFilesFromKeys(acc, data.params)
collectFilesFromKeys(acc, data.metrics)
collectFilesFromKeys(acc, data.deps)
collectFilesFromKeys(acc, data.outs)
}

export const collectFiles = (
Expand Down

0 comments on commit 857f6ed

Please sign in to comment.