Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
44c5bdd
commit 2ffdf04
Showing
6 changed files
with
21 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 11 additions & 4 deletions
15
biosimulations/libs/datamodel/core/src/lib/common/algorithm-parameter.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
import { DTO } from '@biosimulations/datamodel/utils'; | ||
import { DTO, isOfType } from '@biosimulations/datamodel/utils'; | ||
import { AlgorithmDTO } from './algorithm.dto'; | ||
|
||
export interface AlgorithmParameterCore { | ||
class AlgorithmParameterCore { | ||
id?: string; | ||
name?: string; | ||
value?: number; | ||
kisaoId?: number; | ||
} | ||
export const isAlgorithmParameterDTO = (param: any): param is AlgorithmDTO => | ||
'kisaoId' in param; | ||
|
||
export type AlgorithmParameterDTO = DTO<AlgorithmParameterCore>; | ||
|
||
/* | ||
* // TODO can this be made generic? | ||
* Perhaps can create a method that takes in a param as well as new instantiated "core" class | ||
* would then use reflect to check all parameters? | ||
*/ | ||
|
||
export const isAlgorithmParameterDTO = (param: any): param is AlgorithmDTO => | ||
'kisaoId' in param && 'id' in param && 'name' in param && 'value' in param; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
biosimulations/libs/datamodel/core/src/lib/common/model-parameter.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
import { DTO } from '@biosimulations/datamodel/utils'; | ||
|
||
export interface ModelParameterCore { | ||
export class ModelParameterCore { | ||
id: string; | ||
name: string; | ||
value: number; | ||
units: string; | ||
} | ||
|
||
export type ModelParameterDTO = DTO<ModelParameterCore>; | ||
|
||
export const isModelParameterDTO = (param: any): param is ModelParameterDTO => | ||
'units' in param && 'id' in param && 'name' in param && 'value' in param; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export * from './types'; | ||
export { isOfType } from './guard'; | ||
export * from './guard'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters