Skip to content

Commit

Permalink
Added documentation urls (#3437)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Chang <[email protected]>
  • Loading branch information
jryu01 and mwdchang authored Apr 26, 2024
1 parent e5191d9 commit f904892
Show file tree
Hide file tree
Showing 21 changed files with 71 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
<div class="title-row">
<h4><slot /> <i v-if="props.tooltip" v-tooltip="tooltip" class="pi pi-info-circle" /></h4>
<slot name="inputs" />
<!-- <a :href="documentationUrl" rel="noopener noreferrer">Documentation</a> -->
<a v-if="documentationUrl" :href="documentationUrl" rel="noopener noreferrer"
>Documentation</a
>
<Button
class="close-mask"
icon="pi pi-times"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
:active-index="selectedViewIndex"
:views="views"
:tooltip="tooltip"
:documentation-url="node.documentationUrl"
@tab-change="handleTabChange"
@close="emit('on-close-clicked')"
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { Operation, WorkflowOperationTypes, BaseState } from '@/types/workflow';
import { CalibrateMap } from '@/services/calibrate-workflow';

const DOCUMENTATION_URL =
'https://github.com/ciemss/pyciemss/blob/main/pyciemss/interfaces.py#L529';

export interface CalibrationOperationStateCiemss extends BaseState {
chartConfigs: string[][];
mapping: CalibrateMap[];
Expand All @@ -22,6 +25,7 @@ export const CalibrationOperationCiemss: Operation = {
displayName: 'Calibrate with PyCIEMSS',
description:
'given a model id, a dataset id, and optionally a configuration. calibrate the models initial values and rates',
documentationUrl: DOCUMENTATION_URL,
inputs: [
{ type: 'modelConfigId', label: 'Model configuration' },
{ type: 'datasetId', label: 'Dataset' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { Operation, WorkflowOperationTypes, BaseState } from '@/types/workflow';
import type { EnsembleModelConfigs } from '@/types/Types';

const DOCUMENTATION_URL =
'https://github.com/ciemss/pyciemss/blob/main/pyciemss/interfaces.py#L156';

export interface EnsembleCalibrateExtraCiemss {
solverMethod: string;
numParticles: number; // The number of particles to use for the inference algorithm. https://github.com/ciemss/pyciemss/blob/1fc62b0d4b0870ca992514ad7a9b7a09a175ce44/pyciemss/interfaces.py#L225
Expand All @@ -22,6 +25,7 @@ export const CalibrateEnsembleCiemssOperation: Operation = {
name: WorkflowOperationTypes.CALIBRATE_ENSEMBLE_CIEMSS,
displayName: 'Calibrate ensemble',
description: '',
documentationUrl: DOCUMENTATION_URL,
inputs: [
{ type: 'datasetId', label: 'Dataset' },
{ type: 'modelConfigId', label: 'Model configuration', acceptMultiple: false }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { Operation, WorkflowOperationTypes, BaseState } from '@/types/workflow';

const DOCUMENTATION_URL =
'https://github.com/DARPA-ASKEM/sciml-service/blob/main/src/operations.jl#L245';

export interface CalibrateMap {
modelVariable: string;
datasetVariable: string;
Expand Down Expand Up @@ -35,6 +38,7 @@ export const CalibrationOperationJulia: Operation = {
displayName: 'Calibrate with SciML',
description:
'given a model id, a dataset id, and optionally a configuration. calibrate the models initial values and rates',
documentationUrl: DOCUMENTATION_URL,
inputs: [
{ type: 'modelConfigId', label: 'Model configuration' },
{ type: 'datasetId', label: 'Dataset' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Operation, WorkflowOperationTypes, BaseState } from '@/types/workflow';

const DOCUMENTATION_URL = 'https://pandas.pydata.org/docs/user_guide/index.html#user-guide';

export interface DatasetTransformerState extends BaseState {
datasetId: string | null;
notebookSessionId?: string;
Expand All @@ -8,6 +10,7 @@ export interface DatasetTransformerState extends BaseState {
export const DatasetTransformerOperation: Operation = {
name: WorkflowOperationTypes.DATASET_TRANSFORMER,
description: 'Select a dataset',
documentationUrl: DOCUMENTATION_URL,
displayName: 'Transform dataset',
isRunnable: true,
inputs: [{ type: 'datasetId|simulationId', label: 'Dataset or Simulation' }],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Operation, WorkflowOperationTypes, BaseState } from '@/types/workflow';
import type { FunmanInterval, TimeSpan } from '@/types/Types';

const DOCUMENTATION_URL = 'https://github.com/siftech/funman';

export interface ConstraintGroup {
borderColour: string;
name: string;
Expand Down Expand Up @@ -38,6 +40,7 @@ export const FunmanOperation: Operation = {
name: WorkflowOperationTypes.FUNMAN,
displayName: 'Validate configuration',
description: 'Validate configuration',
documentationUrl: DOCUMENTATION_URL,
inputs: [{ type: 'modelConfigId', label: 'Model configuration', acceptMultiple: false }],
outputs: [{ type: 'funmanQueryId' }],
isRunnable: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { Operation, WorkflowOperationTypes, BaseState } from '@/types/workflow';
import { NotebookHistory } from '@/services/notebook';

const DOCUMENTATION_URL =
'https://githubicom/gyorilab/mira/blob/7314765ab409ddc9647269ad2381055f1cd67706/notebooks/hackathon_2023.10/dkg_grounding_model_comparison.ipynb#L307';

export interface ModelComparisonOperationState extends BaseState {
notebookHistory: NotebookHistory[];
hasCodeRun: boolean;
Expand All @@ -11,6 +14,7 @@ export const ModelComparisonOperation: Operation = {
name: WorkflowOperationTypes.MODEL_COMPARISON,
displayName: 'Compare models',
description: '',
documentationUrl: DOCUMENTATION_URL,
inputs: [
{ type: 'modelId', label: 'Model' },
{ type: 'modelId', label: 'Model' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import type { Operation, BaseState } from '@/types/workflow';
import { WorkflowOperationTypes } from '@/types/workflow';

const DOCUMENTATION_URL =
'https://algebraicjulia.github.io/Decapodes.jl/dev/overview/#Merging-Multiple-Physics';

export interface ModelCouplingState extends BaseState {}

export const ModelCouplingOperation: Operation = {
name: WorkflowOperationTypes.MODEL_COUPLING,
description: 'Couple models',
displayName: 'Couple models',
documentationUrl: DOCUMENTATION_URL,
isRunnable: true,
inputs: [{ type: 'modelId', label: 'Model' }],
outputs: [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { Operation, WorkflowOperationTypes, BaseState } from '@/types/workflow';

const DOCUMENTATION_URL =
'https://github.com/DARPA-ASKEM/beaker-kernel/blob/main/docs/contexts_mira_model_edit.md';

export interface ModelEditCode {
code: string;
timestamp: number;
Expand All @@ -14,6 +17,7 @@ export const ModelEditOperation: Operation = {
name: WorkflowOperationTypes.MODEL_EDIT,
displayName: 'Edit model',
description: 'Edit a model',
documentationUrl: DOCUMENTATION_URL,
isRunnable: false,
inputs: [
{ type: 'modelId|modelConfigId', label: 'Model or Model configuration', acceptMultiple: false }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { ModelServiceType } from '@/types/common';
import { AssetBlock, Operation, WorkflowOperationTypes } from '@/types/workflow';
import { CodeBlock } from '@/utils/code-asset';

const DOCUMENTATION_URL = 'https://github.com/ml4ai/ASKEM-TA1-DockerVM?tab=readme-ov-file#code2amr';

export interface ModelFromCodeState {
codeLanguage: ProgrammingLanguage;
codeBlocks: AssetBlock<CodeBlock>[];
Expand All @@ -15,6 +17,7 @@ export const ModelFromCodeOperation: Operation = {
name: WorkflowOperationTypes.MODEL_FROM_CODE,
description: 'Create model',
displayName: 'Create model from code',
documentationUrl: DOCUMENTATION_URL,
isRunnable: true,
inputs: [
{ type: 'codeAssetId', label: 'Code' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import type { DocumentExtraction } from '@/types/Types';
import { ModelServiceType } from '@/types/common';
import { AssetBlock, Operation, WorkflowOperationTypes } from '@/types/workflow';

const DOCUMENTATION_URL =
'https://github.com/DARPA-ASKEM/model-service/blob/07ae21cae2d5465f9ac5b5bbbe6c7b28b7259f04/src/ModelService.jl#L54';

export interface EquationBlock {
text: string;
extractionError?: boolean;
Expand Down Expand Up @@ -29,6 +32,7 @@ export const ModelFromEquationsOperation: Operation = {
name: WorkflowOperationTypes.MODEL_FROM_EQUATIONS,
description: 'Create model from equations',
displayName: 'Create model from equations',
documentationUrl: DOCUMENTATION_URL,
isRunnable: true,
inputs: [{ type: 'documentId', label: 'Document' }],
outputs: [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { Operation, WorkflowOperationTypes, BaseState } from '@/types/workflow';

const DOCUMENTATION_URL =
'https://github.com/ciemss/pyciemss/blob/main/pyciemss/interfaces.py#L747';

export enum InterventionTypes {
paramValue = 'param_value',
startTime = 'start_time'
Expand Down Expand Up @@ -65,6 +68,7 @@ export const OptimizeCiemssOperation: Operation = {
name: WorkflowOperationTypes.OPTIMIZE_CIEMSS,
displayName: 'Optimize with PyCIEMSS',
description: 'Optimize with PyCIEMSS',
documentationUrl: DOCUMENTATION_URL,
inputs: [
{ type: 'modelConfigId', label: 'Model configuration', acceptMultiple: false },
{ type: 'calibrateSimulationId', label: 'Calibration', acceptMultiple: false, isOptional: true }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { Operation, WorkflowOperationTypes, BaseState } from '@/types/workflow';

const DOCUMENTATION_URL =
'https://github.com/DARPA-ASKEM/beaker-kernel/blob/main/docs/contexts_climate_data_utility.md';

export interface RegriddingOperationState extends BaseState {
datasetId: string | null;
notebookSessionId?: string;
Expand All @@ -9,6 +12,7 @@ export const RegriddingOperation: Operation = {
name: WorkflowOperationTypes.REGRIDDING,
description: 'Select a dataset',
displayName: 'Transform gridded dataset',
documentationUrl: DOCUMENTATION_URL,
isRunnable: true,
inputs: [{ type: 'datasetId', label: 'Dataset' }],
outputs: [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import type { TimeSpan } from '@/types/Types';
import { Operation, WorkflowOperationTypes, BaseState } from '@/types/workflow';

const DOCUMENTATION_URL =
'https://github.com/ciemss/pyciemss/blob/main/pyciemss/interfaces.py#L323';

export interface SimulateCiemssOperationState extends BaseState {
// state shared across all runs
chartConfigs: string[][];
Expand All @@ -20,6 +23,7 @@ export const SimulateCiemssOperation: Operation = {
name: WorkflowOperationTypes.SIMULATE_CIEMSS,
displayName: 'Simulate with PyCIEMSS',
description: 'given a model id, and configuration id, run a simulation',
documentationUrl: DOCUMENTATION_URL,
inputs: [
{ type: 'modelConfigId', label: 'Model configuration', acceptMultiple: false },
{ type: 'calibrateSimulationId', label: 'Calibration', acceptMultiple: false, isOptional: true }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Operation, WorkflowOperationTypes, BaseState } from '@/types/workflow';
import type { EnsembleModelConfigs, TimeSpan } from '@/types/Types';

const DOCUMENTATION_URL = 'https://github.com/ciemss/pyciemss/blob/main/pyciemss/interfaces.py#L35';

export interface SimulateEnsembleCiemssOperationState extends BaseState {
chartConfigs: string[][];
mapping: EnsembleModelConfigs[];
Expand All @@ -14,6 +16,7 @@ export const SimulateEnsembleCiemssOperation: Operation = {
name: WorkflowOperationTypes.SIMULATE_ENSEMBLE_CIEMSS,
displayName: 'Simulate ensemble',
description: '',
documentationUrl: DOCUMENTATION_URL,
inputs: [{ type: 'modelConfigId', label: 'Model configuration', acceptMultiple: false }],
outputs: [{ type: 'simulationId' }],
isRunnable: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import type { TimeSpan } from '@/types/Types';
import { Operation, WorkflowOperationTypes, BaseState } from '@/types/workflow';

const DOCUMENTATION_URL =
'https://github.com/DARPA-ASKEM/sciml-service/blob/main/src/operations.jl#L222';

export interface SimulateJuliaOperationState extends BaseState {
// state shared across all runs
chartConfigs: string[][];
Expand All @@ -16,6 +19,7 @@ export const SimulateJuliaOperation: Operation = {
name: WorkflowOperationTypes.SIMULATE_JULIA,
displayName: 'Simulate with SciML',
description: 'given a model id, and configuration id, run a simulation',
documentationUrl: DOCUMENTATION_URL,
inputs: [{ type: 'modelConfigId', label: 'Model configuration', acceptMultiple: false }],
outputs: [{ type: 'simulationId' }],
isRunnable: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import type { Operation, BaseState } from '@/types/workflow';
import { WorkflowOperationTypes } from '@/types/workflow';

const DOCUMENTATION_URL =
'https://github.com/gyorilab/mira/blob/main/notebooks/viz_strat_petri.ipynb';

export interface StratifyGroup {
borderColour: string;
name: string;
Expand Down Expand Up @@ -53,6 +56,7 @@ export const StratifyMiraOperation: Operation = {
name: WorkflowOperationTypes.STRATIFY_MIRA,
displayName: 'Stratify model',
description: 'Stratify a model',
documentationUrl: DOCUMENTATION_URL,
inputs: [
{ type: 'modelId|modelConfigId', label: 'Model or Model configuration', acceptMultiple: false }
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { Operation, WorkflowOperationTypes, BaseState } from '@/types/workflow';

const DOCUMENTATION_URL =
'https://github.com/DARPA-ASKEM/climate-data/blob/main/api/processing/filters.py#L48';

export interface SubsetDataOperationState extends BaseState {
datasetId: string | null;
fromDate: Date;
Expand All @@ -20,6 +23,7 @@ export const SubsetDataOperation: Operation = {
name: WorkflowOperationTypes.SUBSET_DATA,
displayName: 'Subset dataset',
description: '',
documentationUrl: DOCUMENTATION_URL,
inputs: [{ type: 'datasetId', label: 'Dataset' }],
outputs: [{ type: 'datasetId' }],
isRunnable: true,
Expand Down
1 change: 1 addition & 0 deletions packages/client/hmi-client/src/services/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export const addNode = (
workflowId: wf.id,
operationType: op.name,
displayName: op.displayName,
documentationUrl: op.documentationUrl,
x: pos.x,
y: pos.y,
state: options.state ?? {},
Expand Down
2 changes: 2 additions & 0 deletions packages/client/hmi-client/src/types/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export interface Operation {
name: WorkflowOperationTypes;
description: string;
displayName: string; // Human-readable name for each node.
documentationUrl?: string;

// The operation is self-runnable, that is, given just the inputs we can derive the outputs
isRunnable: boolean;
Expand Down Expand Up @@ -106,6 +107,7 @@ export interface WorkflowNode<S> {
displayName: string;
workflowId: string;
operationType: WorkflowOperationTypes;
documentationUrl?: string;

// Position on canvas
x: number;
Expand Down

0 comments on commit f904892

Please sign in to comment.