|
1 | | -import { |
2 | | - CHECKPOINTS_PARAM, |
3 | | - cleanupOldOrderValue, |
4 | | - doesCustomPlotAlreadyExist |
5 | | -} from './custom' |
| 1 | +import { cleanupOldOrderValue } from './custom' |
6 | 2 | import { CustomPlotType } from '../webview/contract' |
7 | 3 | import { FILE_SEPARATOR } from '../../experiments/columns/paths' |
8 | 4 |
|
9 | | -describe('doesCustomPlotAlreadyExist', () => { |
10 | | - it('should return true if plot exists', () => { |
11 | | - const output = doesCustomPlotAlreadyExist( |
12 | | - [ |
13 | | - { |
14 | | - metric: 'summary.json:loss', |
15 | | - param: 'params.yaml:dropout', |
16 | | - type: CustomPlotType.METRIC_VS_PARAM |
17 | | - }, |
18 | | - { |
19 | | - metric: 'summary.json:accuracy', |
20 | | - param: 'params.yaml:epochs', |
21 | | - type: CustomPlotType.METRIC_VS_PARAM |
22 | | - }, |
23 | | - { |
24 | | - metric: 'summary.json:loss', |
25 | | - param: CHECKPOINTS_PARAM, |
26 | | - type: CustomPlotType.CHECKPOINT |
27 | | - } |
28 | | - ], |
29 | | - 'summary.json:accuracy', |
30 | | - 'params.yaml:epochs' |
31 | | - ) |
32 | | - expect(output).toStrictEqual(true) |
33 | | - }) |
34 | | - |
35 | | - it('should return false if plot does not exists', () => { |
36 | | - const output = doesCustomPlotAlreadyExist( |
37 | | - [ |
38 | | - { |
39 | | - metric: 'summary.json:loss', |
40 | | - param: 'params.yaml:dropout', |
41 | | - type: CustomPlotType.METRIC_VS_PARAM |
42 | | - }, |
43 | | - { |
44 | | - metric: 'summary.json:accuracy', |
45 | | - param: 'params.yaml:epochs', |
46 | | - type: CustomPlotType.METRIC_VS_PARAM |
47 | | - }, |
48 | | - { |
49 | | - metric: 'summary.json:loss', |
50 | | - param: CHECKPOINTS_PARAM, |
51 | | - type: CustomPlotType.CHECKPOINT |
52 | | - } |
53 | | - ], |
54 | | - 'summary.json:loss', |
55 | | - 'params.yaml:epochs' |
56 | | - ) |
57 | | - expect(output).toStrictEqual(false) |
58 | | - }) |
59 | | -}) |
60 | | - |
61 | 5 | describe('cleanupOlderValue', () => { |
62 | 6 | it('should update value if contents are outdated', () => { |
63 | 7 | const output = cleanupOldOrderValue( |
|
0 commit comments