Skip to content
This repository was archived by the owner on Nov 24, 2021. It is now read-only.

Commit a3f2767

Browse files
authored
Merge pull request #17 from covid-modeling/gorzell/remove-modelslug-type
api: Remove ModelSlug enum.
2 parents 7119407 + d3ab649 commit a3f2767

File tree

11 files changed

+14
-34
lines changed

11 files changed

+14
-34
lines changed

packages/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@covid-modeling/api",
3-
"version": "0.9.1",
3+
"version": "0.10.0",
44
"main": "dist/src/index",
55
"types": "dist/src/index.d.ts",
66
"scripts": {

packages/api/schema/runner.json

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"type": "string"
5555
},
5656
"slug": {
57-
"$ref": "#/definitions/ModelSlug"
57+
"type": "string"
5858
}
5959
},
6060
"required": [
@@ -122,15 +122,6 @@
122122
],
123123
"type": "object"
124124
},
125-
"ModelSlug": {
126-
"enum": [
127-
"mrc-ide-covid-sim",
128-
"basel",
129-
"mc19",
130-
"idm-covasim"
131-
],
132-
"type": "string"
133-
},
134125
"RequestInput": {
135126
"additionalProperties": false,
136127
"properties": {

packages/api/src/index.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,14 @@ export enum RunStatus {
1818
}
1919

2020
export interface RunOutput {
21-
modelSlug: ModelSlug
21+
modelSlug: string
2222
status: RunStatus
2323
resultsLocation: string
2424
exportLocation: string
2525
workflowRunID?: string
2626
}
2727

28-
export enum ModelSlug {
29-
MRCIDECovidSim = 'mrc-ide-covid-sim',
30-
Basel = 'basel',
31-
MC19 = 'mc19',
32-
IDMCovasim = 'idm-covasim',
33-
}
34-
3528
export interface Model {
36-
slug: ModelSlug
29+
slug: string
3730
imageURL: string
3831
}

packages/model-runner/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@covid-modeling/model-runner",
3-
"version": "1.1.2",
3+
"version": "1.2.0",
44
"main": "dist/index.js",
55
"scripts": {
66
"test": "PATH=$PATH:../../node_modules/.bin && mocha --debug-brk --ui tdd -r ts-node/register test/unit/*-test.ts",
@@ -19,7 +19,7 @@
1919
"dependencies": {
2020
"@azure/identity": "^1.1.0-preview1",
2121
"@azure/storage-blob": "^12.1.1",
22-
"@covid-modeling/api": "0.9.1",
22+
"@covid-modeling/api": "^0.10.0",
2323
"archiver": "^4.0.1",
2424
"d3": "^5.15.0",
2525
"dockerode": "^3.2.0",

packages/model-runner/src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as pino from 'pino'
22
import * as path from 'path'
33
import * as mkdirp from 'mkdirp'
4-
import { ModelSlug, RunStatus, RequestInput } from '@covid-modeling/api'
4+
import { RunStatus, RequestInput } from '@covid-modeling/api'
55
import { BlobStorage } from './blobstore'
66
import { notifyUI } from './notify-ui'
77
import { logger } from './logger'
@@ -23,7 +23,7 @@ import { enforceRunnerInputSchema, enforceOutputSchema } from './schema'
2323

2424
let inputID: string | number | null = null
2525
let callbackURL: string | null = null
26-
let modelSlug: ModelSlug | null = null
26+
let modelSlug: string | null = null
2727

2828
const handleRejection: NodeJS.UnhandledRejectionListener = err => {
2929
const finalLogger = pino.final(logger)

packages/mrc-ide-covidsim/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"license": "MIT",
1919
"dependencies": {
20-
"@covid-modeling/api": "0.9.*",
20+
"@covid-modeling/api": "^0.10.0",
2121
"d3": "^5.15.0",
2222
"jsen": "^0.6.6",
2323
"luxon": "^1.23.0",

packages/mrc-ide-covidsim/test/integration/imperial-integration-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as fs from 'fs'
33
import { assert } from 'chai'
44
import { ImperialModel } from '../../src/imperial'
55
import { BIN_DIR, MODEL_DATA_DIR } from '../../src/config'
6-
import { input, ModelSlug } from '@covid-modeling/api'
6+
import { input } from '@covid-modeling/api'
77

88
suite('imperial integration', () => {
99
test('run imperial model for Wyoming', async () => {

packages/mrc-ide-covidsim/test/unit/convert-output-test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { assert } from 'chai'
2-
import { ModelSlug, input } from '@covid-modeling/api'
2+
import { input } from '@covid-modeling/api'
33
import { convertOutput } from '../../src/convert-output'
44

55
const parameters: input.ModelParameters = {
@@ -13,10 +13,6 @@ const parameters: input.ModelParameters = {
1313
suite('converting imperial model output to JSON', () => {
1414
test('returns a time series for each metric', () => {
1515
const input = {
16-
model: {
17-
slug: ModelSlug.MRCIDECovidSim,
18-
imageURL: '',
19-
},
2016
region: 'US',
2117
subregion: 'US-WY',
2218
parameters,

packages/neherlab-covid-19-scenarios/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"license": "MIT",
1919
"dependencies": {
20-
"@covid-modeling/api": "0.9.*",
20+
"@covid-modeling/api": "^0.10.0",
2121
"d3": "^5.15.0",
2222
"jsen": "^0.6.6",
2323
"luxon": "^1.23.0",

packages/neherlab-covid-19-scenarios/test/integration/basel-integration-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as path from 'path'
22
import * as temp from 'temp'
33
import * as fs from 'fs'
44
import { assert } from 'chai'
5-
import { input, ModelSlug } from '@covid-modeling/api'
5+
import { input } from '@covid-modeling/api'
66
import { BaselModel } from '../../src/basel'
77
import { BIN_DIR, MODEL_DATA_DIR } from '../../src/config'
88

0 commit comments

Comments
 (0)