Skip to content

Commit 81d16f4

Browse files
committed
Add CellMLGenerationOptions to celldl2cellml().
1 parent 539bb1d commit 81d16f4

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/bg2cellml/index.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ export interface CellMLOutput {
3131
issues?: string[]
3232
}
3333

34+
export type CellMLGenerationOptions = {
35+
debug?: boolean
36+
rdfSource?: boolean
37+
}
38+
3439
//==============================================================================
3540
//==============================================================================
3641

@@ -144,11 +149,11 @@ function bg2cellml(uri: string, bgRdf: string, debug: boolean=false): CellMLOutp
144149
}
145150
}
146151

147-
export function celldl2cellml(uri: string, celldl: string, debug: boolean=false): CellMLOutput {
152+
export function celldl2cellml(uri: string, source: string, options: CellMLGenerationOptions|undefined=undefined): CellMLOutput {
148153
if (pyodide) {
149-
const bgRdf = getBgRdf(celldl)
154+
const bgRdf = options?.rdfSource ? source : getBgRdf(source)
150155
const bg2cellml = pyodide.runPython(RUN_BG2CELLML)
151-
return bg2cellml(uri, bgRdf, debug)
156+
return bg2cellml(uri, bgRdf, options?.debug)
152157
}
153158
return {
154159
issues: ['CellML conversion service has not been initialised']

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Export CellML generation tools
22

33
export { initialisePython, celldl2cellml } from './bg2cellml'
4-
export type { CellMLOutput, RdfInterface } from './bg2cellml'
4+
export type { CellMLGenerationOptions, CellMLOutput, RdfInterface } from './bg2cellml'
55

66
// Export module loading functions
77

0 commit comments

Comments
 (0)