Skip to content

Commit

Permalink
Merge branch 'main' into sticky-storybook-preview
Browse files Browse the repository at this point in the history
  • Loading branch information
rogermparent authored Jun 6, 2022
2 parents 45a96a0 + 6824d66 commit 2b0ee97
Show file tree
Hide file tree
Showing 65 changed files with 1,698 additions and 1,311 deletions.
20 changes: 16 additions & 4 deletions extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,18 @@
"homepage": "https://github.com/iterative/vscode-dvc/README.md",
"keywords": [
"iterative",
"data",
"version",
"control",
"data version control",
"plots",
"experiment tracking",
"hyperparameters",
"dataset",
"dvc"
],
"categories": [
"Machine Learning",
"Data Science",
"Visualization"
"Visualization",
"SCM Providers"
],
"galleryBanner": {
"color": "#333",
Expand All @@ -50,6 +54,14 @@
},
"contributes": {
"colors": [
{
"id": "dvc.deps",
"description": "Color to indicate a DVC dep column in the experiments table",
"defaults": {
"dark": "#b079e7",
"light": "#4f1886"
}
},
{
"id": "dvc.metrics",
"description": "Color to indicate a DVC metric column in the experiments table",
Expand Down
6 changes: 4 additions & 2 deletions extension/src/cli/reader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ type RelPathObject<T> = {

export type ValueTreeRoot = RelPathObject<ValueTreeOrError>

interface ValueTreeNode {
export interface ValueTreeNode {
[key: string]: Value | ValueTree
}

Expand All @@ -88,10 +88,12 @@ export interface BaseExperimentFields {
type Dep = { hash: string; size: number; nfiles: null | number }
type Out = Dep & { use_cache: boolean; is_data_source: boolean }

export type Deps = RelPathObject<Dep>

export interface ExperimentFields extends BaseExperimentFields {
params?: ValueTreeRoot
metrics?: ValueTreeRoot
deps?: RelPathObject<Dep>
deps?: Deps
outs?: RelPathObject<Out>
}

Expand Down
21 changes: 19 additions & 2 deletions extension/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { Disposable } from '@hediet/std/disposable'
import { EventEmitter, Event, workspace } from 'vscode'
import {
getOnDidChangePythonExecutionDetails,
getPythonBinPath
} from './extensions/python'
import { ConfigKey, getConfigValue } from './vscode/config'
import { DeferredDisposable } from './class/deferred'
import { getOnDidChangeExtensions } from './vscode/extensions'

export class Config extends DeferredDisposable {
public readonly onDidChangeExecutionDetails: Event<void>
Expand All @@ -15,15 +17,20 @@ export class Config extends DeferredDisposable {

private readonly executionDetailsChanged: EventEmitter<void>

constructor() {
private pythonExecutionDetailsListener?: Disposable
private readonly onDidChangeExtensionsEvent: Event<void>

constructor(onDidChangeExtensionsEvent = getOnDidChangeExtensions()) {
super()

this.executionDetailsChanged = this.dispose.track(new EventEmitter())
this.onDidChangeExecutionDetails = this.executionDetailsChanged.event
this.onDidChangeExtensionsEvent = onDidChangeExtensionsEvent

this.setPythonBinPath()

this.onDidChangePythonExecutionDetails()
this.onDidChangeExtensions()

this.onDidConfigurationChange()
}
Expand All @@ -46,15 +53,25 @@ export class Config extends DeferredDisposable {
}

private async onDidChangePythonExecutionDetails() {
this.pythonExecutionDetailsListener?.dispose()
const onDidChangePythonExecutionDetails =
await getOnDidChangePythonExecutionDetails()
this.dispose.track(
this.pythonExecutionDetailsListener = this.dispose.track(
onDidChangePythonExecutionDetails?.(() => {
this.setPythonAndNotifyIfChanged()
})
)
}

private onDidChangeExtensions() {
this.dispose.track(
this.onDidChangeExtensionsEvent(() => {
this.onDidChangePythonExecutionDetails()
this.setPythonAndNotifyIfChanged()
})
)
}

private onDidConfigurationChange() {
this.dispose.track(
workspace.onDidChangeConfiguration(e => {
Expand Down
247 changes: 0 additions & 247 deletions extension/src/experiments/columns/collect.ts

This file was deleted.

Loading

0 comments on commit 2b0ee97

Please sign in to comment.