release v1.10 (#51)

This commit is contained in:
shyallegro
2023-03-29 18:04:17 +03:00
committed by GitHub
parent 8f6029cf5f
commit 29c68abeb4
1001 changed files with 13503 additions and 9954 deletions

View File

View File

View File

@@ -1 +0,0 @@
<sm-common-experiments></sm-common-experiments>

View File

@@ -1,9 +0,0 @@
import {ChangeDetectionStrategy, Component} from '@angular/core';
@Component({
selector : 'sm-experiments',
templateUrl : './experiments.component.html',
styleUrls : ['./experiments.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ExperimentsComponent {}

0
src/app/features/experiments/experiments.consts.ts Normal file → Executable file
View File

123
src/app/features/experiments/experiments.module.ts Normal file → Executable file
View File

@@ -1,70 +1,55 @@
import {InjectionToken, NgModule} from '@angular/core';
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {ExperimentSharedModule} from './shared/experiment-shared.module';
import {SMSharedModule} from '@common/shared/shared.module';
import {ExperimentRouterModule} from './experiments-routing.module';
import {ExperimentsComponent} from './experiments.component';
import {EffectsModule} from '@ngrx/effects';
import {StoreConfig, StoreModule} from '@ngrx/store';
import {experimentsReducers, ExperimentState} from './reducers';
import {AdminService} from '~/shared/services/admin.service';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {SelectModelModule} from '@common/select-model/select-model.module';
import {SmSyncStateSelectorService} from '@common/core/services/sync-state-selector.service';
import {ExperimentOutputEffects} from './effects/experiment-output.effects';
import {ExperimentsMenuEffects} from './effects/experiments-menu.effects';
import {LayoutModule} from '~/layout/layout.module';
import {ExperimentGraphsModule} from '@common/shared/experiment-graphs/experiment-graphs.module';
import {ExperimentCompareSharedModule} from '@common/experiments-compare/shared/experiment-compare-shared.module';
import {AngularSplitModule} from 'angular-split';
import {SMMaterialModule} from '@common/shared/material/material.module';
import {ExperimentsCommonModule} from '@common/experiments/common-experiments.module';
import {CommonLayoutModule} from '@common/layout/layout.module';
import {EXPERIMENTS_STORE_KEY} from '@common/experiments/shared/common-experiments.const';
import {DebugImagesModule} from '@common/debug-images/debug-images.module';
import {ExperimentInfoExecutionComponent} from '@common/experiments/containers/experiment-info-execution/experiment-info-execution.component';
import {MatSidenavModule} from '@angular/material/sidenav';
import {MatListModule} from '@angular/material/list';
import {MatLegacyListModule as MatListModule} from '@angular/material/legacy-list';
import {ExperimentOutputComponent} from './containers/experiment-ouptut/experiment-output.component';
import {merge, pick} from 'lodash/fp';
import {EXPERIMENTS_PREFIX} from '@common/experiments/actions/common-experiments-view.actions';
import {ExperimentInfoNavbarComponent} from './containers/experiment-info-navbar/experiment-info-navbar.component';
export const experimentSyncedKeys = [
'view.projectColumnsSortOrder',
'view.projectColumnFilter',
'view.projectColumnsWidth',
'view.hiddenProjectTableCols',
'view.metricsCols',
'view.colsOrder',
'output.scalarsHoverMode',
'info.userKnowledge',
'output.settingsList',
];
export const EXPERIMENT_CONFIG_TOKEN =
new InjectionToken<StoreConfig<ExperimentState, any>>('ExperimentConfigToken');
const localStorageKey = '_saved_experiment_state_';
const getExperimentsConfig = () => ({
metaReducers: [reducer => {
let onInit = true;
return (state, action) => {
const nextState = reducer(state, action);
if (onInit) {
onInit = false;
const savedState = JSON.parse(localStorage.getItem(localStorageKey));
return merge(nextState, savedState);
}
if (action.type.startsWith(EXPERIMENTS_PREFIX)) {
localStorage.setItem(localStorageKey, JSON.stringify(pick(['view.tableMode'], nextState)));
}
return nextState;
};
}]
});
import {ExperimentInfoHyperParametersComponent} from '@common/experiments/containers/experiment-info-hyper-parameters/experiment-info-hyper-parameters.component';
import {ExperimentInfoArtifactItemComponent} from '@common/experiments/containers/experiment-info-artifact-item/experiment-info-artifact-item.component';
import {ExperimentGeneralInfoComponent} from '@common/experiments/dumb/experiment-general-info/experiment-general-info.component';
import {ExperimentArtifactItemViewComponent} from '@common/experiments/dumb/experiment-artifact-item-view/experiment-artifact-item-view.component';
import {ExperimentHyperParamsNavbarComponent} from '@common/experiments/dumb/experiment-hyper-params-navbar/experiment-hyper-params-navbar.component';
import {ExperimentExecutionSourceCodeComponent} from '@common/experiments/dumb/experiment-execution-source-code/experiment-execution-source-code.component';
import {ExperimentInfoEditDescriptionComponent} from '@common/experiments/dumb/experiment-info-edit-description/experiment-info-edit-description.component';
import {ExperimentOutputModelViewComponent} from '@common/experiments/dumb/experiment-output-model-view/experiment-output-model-view.component';
import {ExperimentInfoGeneralComponent} from '@common/experiments/containers/experiment-info-general/experiment-info-general.component';
import {BaseClickableArtifactComponent} from '@common/experiments/dumb/base-clickable-artifact.component';
import {ExperimentModelsFormViewComponent} from '@common/experiments/dumb/experiment-models-form-view/experiment-models-form-view.component';
import {ExperimentArtifactsNavbarComponent} from '@common/experiments/dumb/experiment-artifacts-navbar/experiment-artifacts-navbar.component';
import {ExperimentInfoArtifactsComponent} from '@common/experiments/containers/experiment-info-aritfacts/experiment-info-artifacts.component';
import {ExperimentInfoHeaderComponent} from '@common/experiments/dumb/experiment-info-header/experiment-info-header.component';
import {ExperimentInfoTaskModelComponent} from '@common/experiments/containers/experiment-info-task-model/experiment-info-task-model.component';
import {ModelAutoPopulateDialogComponent} from '@common/experiments/dumb/model-auto-populate-dialog/model-auto-populate-dialog.component';
import {ExperimentOutputScalarsComponent} from '@common/experiments/containers/experiment-output-scalars/experiment-output-scalars.component';
import {ExperimentInfoModelComponent} from '@common/experiments/containers/experiment-info-model/experiment-info-model.component';
import {ExperimentInfoHyperParametersFormContainerComponent} from '@common/experiments/containers/experiment-info-hyper-parameters-form-container/experiment-info-hyper-parameters-form-container.component';
import {SharedPipesModule} from '@common/shared/pipes/shared-pipes.module';
import {ExperimentOutputLogModule} from '@common/experiments/shared/experiment-output-log/experiment-output-log.module';
import {RouterModule} from '@angular/router';
import {ScrollingModule} from '@angular/cdk/scrolling';
import {CommonDeleteDialogModule} from '@common/shared/entity-page/entity-delete/common-delete-dialog.module';
import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
import {MatRadioModule} from '@angular/material/radio';
import {SharedModule} from '~/shared/shared.module';
import {MAT_AUTOCOMPLETE_SCROLL_STRATEGY} from '@angular/material/autocomplete';
import {scrollFactory} from '@common/shared/utils/scroll-factory';
import {Overlay} from '@angular/cdk/overlay';
import {ExperimentsComponent} from '@common/experiments/experiments.component';
@NgModule({
@@ -74,7 +59,6 @@ const getExperimentsConfig = () => ({
LayoutModule,
ReactiveFormsModule,
CommonModule,
ExperimentsCommonModule,
SMSharedModule,
ExperimentRouterModule,
ExperimentSharedModule,
@@ -86,19 +70,52 @@ const getExperimentsConfig = () => ({
MatSidenavModule,
MatListModule,
AngularSplitModule,
StoreModule.forFeature(EXPERIMENTS_STORE_KEY, experimentsReducers, EXPERIMENT_CONFIG_TOKEN),
EffectsModule.forFeature([ExperimentOutputEffects, ExperimentsMenuEffects]),
SharedPipesModule,
ScrollingModule,
CommonDeleteDialogModule,
SMSharedModule,
RouterModule,
SharedModule,
ExperimentOutputLogModule,
MatProgressSpinnerModule,
MatRadioModule,
ExperimentSharedModule,
],
declarations: [
ExperimentsComponent,
ExperimentInfoExecutionComponent,
ExperimentOutputComponent,
ExperimentInfoNavbarComponent
ExperimentInfoNavbarComponent,
ExperimentInfoNavbarComponent,
BaseClickableArtifactComponent,
ExperimentInfoHeaderComponent,
ExperimentInfoModelComponent,
ExperimentInfoTaskModelComponent,
ExperimentInfoGeneralComponent,
ExperimentGeneralInfoComponent,
ExperimentModelsFormViewComponent,
ExperimentOutputModelViewComponent,
ExperimentExecutionSourceCodeComponent,
ExperimentOutputScalarsComponent,
ModelAutoPopulateDialogComponent,
ExperimentInfoHyperParametersComponent,
ExperimentInfoHyperParametersFormContainerComponent,
ExperimentArtifactsNavbarComponent,
ExperimentInfoArtifactsComponent,
ExperimentHyperParamsNavbarComponent,
ExperimentInfoArtifactItemComponent,
ExperimentArtifactItemViewComponent,
ExperimentInfoEditDescriptionComponent,
],
exports: [
ExperimentsComponent,
ExperimentInfoHeaderComponent,
ExperimentExecutionSourceCodeComponent,
],
providers: [
AdminService,
SmSyncStateSelectorService,
{provide: EXPERIMENT_CONFIG_TOKEN, useFactory: getExperimentsConfig},
{provide: MAT_AUTOCOMPLETE_SCROLL_STRATEGY, useFactory: scrollFactory, deps: [Overlay]},
]
})
export class ExperimentsModule {

View File

View File

@@ -1,11 +0,0 @@
import {commonExperimentOutputReducer, CommonExperimentOutputState, initialCommonExperimentOutputState} from '../../../webapp-common/experiments/reducers/common-experiment-output.reducer';
export type ExperimentOutputState = CommonExperimentOutputState;
export const initialState: ExperimentOutputState = {
...initialCommonExperimentOutputState
};
export function experimentOutputReducer(state = initialState, action): ExperimentOutputState {
return commonExperimentOutputReducer(state as CommonExperimentOutputState, action) as ExperimentOutputState;
}

View File

@@ -1,5 +0,0 @@
export {
commonExperimentsInitialState as initialState,
commonExperimentsViewReducer as experimentsViewReducer,
CommonExperimentsViewState as ExperimentsViewState
} from '../../../webapp-common/experiments/reducers/common-experiments-view.reducer';

8
src/app/features/experiments/reducers/index.ts Normal file → Executable file
View File

@@ -1,7 +1,7 @@
import {ActionReducerMap, createSelector} from '@ngrx/store';
import {experimentsViewReducer, ExperimentsViewState, initialState as viewInitialState} from './experiments-view.reducer';
import {experimentInfoReducer, ExperimentInfoState, initialState as infoInitialState} from './experiment-info.reducer';
import {experimentOutputReducer, ExperimentOutputState, initialState as outputInitialState} from './experiment-output.reducer';
import {experimentOutputReducer, ExperimentOutputState, experimentOutputInitState} from '@common/experiments/reducers/experiment-output.reducer';
import {experimentsViewReducer, ExperimentsViewState, experimentsViewInitialState} from '@common/experiments/reducers/experiments-view.reducer';
import {IExperimentInfo} from '../shared/experiment-info.model';
import {TaskStatusEnum} from '~/business-logic/model/tasks/taskStatusEnum';
import {selectSelectedModel} from '@common/models/reducers';
@@ -24,7 +24,7 @@ export const experimentsReducers: ActionReducerMap<ExperimentState, any> = {
export const experiments = state => state.experiments ?? {} as ExperimentState;
// view selectors.
export const experimentsView = createSelector(experiments, state => (state?.view ?? viewInitialState) as ExperimentsViewState);
export const experimentsView = createSelector(experiments, state => (state?.view ?? experimentsViewInitialState) as ExperimentsViewState);
export const selectExperimentsMetricsCols = createSelector(experimentsView, state => state.metricsCols);
export const selectMetricVariants = createSelector(experimentsView, state => state.metricVariants);
export const selectMetricsLoading = createSelector(experimentsView, state => state.metricsLoading);
@@ -38,7 +38,7 @@ export const selectShowExtraDataSpinner = createSelector(experimentInfo, state =
// output selectors
export const experimentOutput = createSelector(experiments, state => (state.output ?? outputInitialState) as ExperimentOutputState);
export const experimentOutput = createSelector(experiments, state => (state.output ?? experimentOutputInitState) as ExperimentOutputState);
export const selectIsExperimentEditable = createSelector(selectSelectedExperiment, selectCurrentUser,
(experiment, user): boolean => experiment && experiment.status === TaskStatusEnum.Created && !isReadOnly(experiment) && !isSharedAndNotOwner(experiment, user.company));
export const selectIsSharedAndNotOwner = createSelector(selectSelectedExperiment, selectSelectedModel, selectCurrentUser,

View File

View File

View File

@@ -1,22 +1,129 @@
import {NgModule} from '@angular/core';
import {InjectionToken, NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {SMSharedModule} from '../../../webapp-common/shared/shared.module';
import {SMSharedModule} from '@common/shared/shared.module';
import {ExperimentConverterService} from './services/experiment-converter.service';
import { ExperimentMenuComponent } from '../../../webapp-common/experiments/shared/components/experiment-menu/experiment-menu.component';
import { ExperimentMenuComponent } from '@common/experiments/shared/components/experiment-menu/experiment-menu.component';
import {ExperimentMenuExtendedComponent} from '../containers/experiment-menu-extended/experiment-menu-extended.component';
import {GetParamMetricValuePipe} from '@common/experiments/dumb/experiments-table/hyper-param-metric-column/get-param-metric-value.pipe';
import {ExperimentHeaderComponent} from '@common/experiments/dumb/experiment-header/experiment-header.component';
import {SelectHyperParamsForCustomColComponent} from '@common/experiments/dumb/select-hyper-params-for-custom-col/select-hyper-params-for-custom-col.component';
import {ExperimentExecutionParametersComponent} from '@common/experiments/dumb/experiment-execution-parameters/experiment-execution-parameters.component';
import {CloneDialogComponent} from '@common/experiments/shared/components/clone-dialog/clone-dialog.component';
import {HyperParamMetricColumnComponent} from '@common/experiments/dumb/experiments-table/hyper-param-metric-column/hyper-param-metric-column.component';
import {ExperimentSystemTagsComponent} from '@common/experiments/shared/components/experiments-system-tags/experiment-system-tags.component';
import {AbortAllChildrenDialogComponent} from '@common/experiments/shared/components/abort-all-children-dialog/abort-all-children-dialog.component';
import {ExperimentsTableComponent} from '@common/experiments/dumb/experiments-table/experiments-table.component';
import {GetVariantWithoutRoundPipe} from '@common/experiments/dumb/experiments-table/hyper-param-metric-column/get-variant-without-round.pipe';
import {ChangeProjectDialogComponent} from '@common/experiments/shared/components/change-project-dialog/change-project-dialog.component';
import {ExperimentOutputPlotsComponent} from '@common/experiments/containers/experiment-output-plots/experiment-output-plots.component';
import {ExperimentCustomColsMenuComponent} from '@common/experiments/dumb/experiment-custom-cols-menu/experiment-custom-cols-menu.component';
import {SharedPipesModule} from '@common/shared/pipes/shared-pipes.module';
import {EffectsModule} from '@ngrx/effects';
import {CommonExperimentsMenuEffects} from '@common/experiments/effects/common-experiments-menu.effects';
import {CommonExperimentOutputEffects} from '@common/experiments/effects/common-experiment-output.effects';
import {ScrollingModule} from '@angular/cdk/scrolling';
import {ExperimentsMenuEffects} from '~/features/experiments/effects/experiments-menu.effects';
import {ActionReducer, StoreConfig, StoreModule} from '@ngrx/store';
import {CommonLayoutModule} from '@common/layout/layout.module';
import {FormsModule} from '@angular/forms';
import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
import {ExperimentOutputEffects} from '~/features/experiments/effects/experiment-output.effects';
import {EXPERIMENTS_PREFIX, EXPERIMENTS_STORE_KEY} from '@common/experiments/experiment.consts';
import {ExperimentCompareSharedModule} from '@common/experiments-compare/shared/experiment-compare-shared.module';
import {CommonExperimentsViewEffects} from '@common/experiments/effects/common-experiments-view.effects';
import {ExperimentGraphsModule} from '@common/shared/experiment-graphs/experiment-graphs.module';
import {CommonExperimentsInfoEffects} from '@common/experiments/effects/common-experiments-info.effects';
import {UserPreferences} from '@common/user-preferences';
import {createUserPrefFeatureReducer} from '@common/core/meta-reducers/user-pref-reducer';
import {ExperimentState} from '~/features/experiments/reducers';
import {merge, pick} from 'lodash-es';
import {EXPERIMENTS_OUTPUT_PREFIX} from '@common/experiments/actions/common-experiment-output.actions';
import {EXPERIMENTS_INFO_PREFIX} from '@common/experiments/actions/common-experiments-info.actions';
import {experimentsReducers} from '~/features/experiments/reducers';
import {CommonExperimentConverterService} from '@common/experiments/shared/services/common-experiment-converter.service';
export const experimentSyncedKeys = [
'view.projectColumnsSortOrder',
'view.projectColumnFilters',
'view.projectColumnsWidth',
'view.hiddenProjectTableCols',
'view.metricsCols',
'view.colsOrder',
'output.scalarsHoverMode',
'info.userKnowledge',
'output.settingsList',
];
export const EXPERIMENT_CONFIG_TOKEN =
new InjectionToken<StoreConfig<ExperimentState, any>>('ExperimentConfigToken');
const localStorageKey = '_saved_experiment_state_';
export const getExperimentsConfig = (userPreferences: UserPreferences) => ({
metaReducers: [
reducer => {
let onInit = true;
return (state, action) => {
const nextState = reducer(state, action);
if (onInit) {
onInit = false;
const savedState = JSON.parse(localStorage.getItem(localStorageKey));
return merge({}, nextState, savedState);
}
if (action.type.startsWith(EXPERIMENTS_PREFIX)) {
localStorage.setItem(localStorageKey, JSON.stringify(pick(nextState, ['view.tableMode'])));
}
return nextState;
};
},
(reducer: ActionReducer<any>) =>
createUserPrefFeatureReducer(EXPERIMENTS_STORE_KEY, experimentSyncedKeys, [EXPERIMENTS_PREFIX, EXPERIMENTS_INFO_PREFIX, EXPERIMENTS_OUTPUT_PREFIX], userPreferences, reducer),
]
});
const DECLARATIONS = [
ExperimentMenuComponent,
ExperimentMenuExtendedComponent,
ExperimentSystemTagsComponent,
ChangeProjectDialogComponent,
CloneDialogComponent,
AbortAllChildrenDialogComponent,
ExperimentExecutionParametersComponent,
ExperimentsTableComponent,
HyperParamMetricColumnComponent,
GetParamMetricValuePipe,
GetVariantWithoutRoundPipe,
ExperimentHeaderComponent,
ExperimentCustomColsMenuComponent,
SelectHyperParamsForCustomColComponent,
ExperimentOutputPlotsComponent,
];
@NgModule({
imports : [
SMSharedModule,
CommonModule
CommonModule,
FormsModule,
StoreModule.forFeature(EXPERIMENTS_STORE_KEY, experimentsReducers, EXPERIMENT_CONFIG_TOKEN),
EffectsModule.forFeature([
ExperimentOutputEffects, ExperimentsMenuEffects,
CommonExperimentsViewEffects,
CommonExperimentsInfoEffects,
CommonExperimentOutputEffects,
CommonExperimentsMenuEffects
]),
SharedPipesModule,
ExperimentCompareSharedModule,
ExperimentGraphsModule,
MatProgressSpinnerModule,
ScrollingModule,
CommonLayoutModule,
],
declarations : [...DECLARATIONS],
providers : [ExperimentConverterService],
providers : [
ExperimentConverterService,
CommonExperimentConverterService,
{provide: EXPERIMENT_CONFIG_TOKEN, useFactory: getExperimentsConfig, deps: [UserPreferences]},
],
exports : [...DECLARATIONS]
})
export class ExperimentSharedModule {

View File

View File

View File

View File

@@ -3,7 +3,7 @@ import {TasksEditRequest} from '../../../../business-logic/model/tasks/tasksEdit
import {IExperimentInfo, ISelectedExperiment} from '../experiment-info.model';
import {IExecutionForm} from '../experiment-execution.model';
import {Execution} from '../../../../business-logic/model/tasks/execution';
import {isEqual} from 'lodash/fp';
import {isEqual} from 'lodash-es';
import {CommonExperimentConverterService} from '../../../../webapp-common/experiments/shared/services/common-experiment-converter.service';
import {IHyperParamsForm} from '../../../../webapp-common/experiments/shared/experiment-hyper-params.model';
import {IExperimentModelInfo} from '../../../../webapp-common/experiments/shared/common-experiment-model.model';