@@ -28,6 +28,7 @@ class EnzymeMLDocument:
28
28
reactions : List [Reaction ] = field (default_factory = list )
29
29
measurements : List [Measurement ] = field (default_factory = list )
30
30
equations : List [Equation ] = field (default_factory = list )
31
+ parameters : List [Parameter ] = field (default_factory = list )
31
32
32
33
# JSON-LD fields
33
34
id : str = field (
@@ -44,8 +45,8 @@ class EnzymeMLDocument:
44
45
metadata = config (field_name = "@context" ),
45
46
default_factory = lambda : {
46
47
"enzml" : "http://www.enzymeml.org/v2/" ,
47
- "OBO" : "http://purl.obolibrary.org/obo/" ,
48
48
"schema" : "https://schema.org/" ,
49
+ "OBO" : "http://purl.obolibrary.org/obo/" ,
49
50
"name" : "schema:title" ,
50
51
"references" : {
51
52
"@id" : "schema:citation" ,
@@ -241,15 +242,13 @@ def add_to_equations(
241
242
equation_type : EquationType ,
242
243
species_id : Optional [str ] = None ,
243
244
variables : list [Variable ] = [],
244
- parameters : list [Parameter ] = [],
245
245
** kwargs ,
246
246
):
247
247
params = {
248
248
"equation" : equation ,
249
249
"equation_type" : equation_type ,
250
250
"species_id" : species_id ,
251
251
"variables" : variables ,
252
- "parameters" : parameters ,
253
252
}
254
253
255
254
if "id" in kwargs :
@@ -259,6 +258,40 @@ def add_to_equations(
259
258
260
259
return self .equations [- 1 ]
261
260
261
+ def add_to_parameters (
262
+ self ,
263
+ id : str ,
264
+ name : str ,
265
+ symbol : str ,
266
+ value : Optional [float ] = None ,
267
+ unit : Optional [UnitDefinition ] = None ,
268
+ initial_value : Optional [float ] = None ,
269
+ upper : Optional [float ] = None ,
270
+ lower : Optional [float ] = None ,
271
+ stderr : Optional [float ] = None ,
272
+ constant : Optional [bool ] = True ,
273
+ ** kwargs ,
274
+ ):
275
+ params = {
276
+ "id" : id ,
277
+ "name" : name ,
278
+ "symbol" : symbol ,
279
+ "value" : value ,
280
+ "unit" : unit ,
281
+ "initial_value" : initial_value ,
282
+ "upper" : upper ,
283
+ "lower" : lower ,
284
+ "stderr" : stderr ,
285
+ "constant" : constant ,
286
+ }
287
+
288
+ if "id" in kwargs :
289
+ params ["id" ] = kwargs ["id" ]
290
+
291
+ self .parameters .append (Parameter (** params ))
292
+
293
+ return self .parameters [- 1 ]
294
+
262
295
263
296
@dataclass_json
264
297
@dataclass
@@ -280,8 +313,8 @@ class Creator:
280
313
metadata = config (field_name = "@context" ),
281
314
default_factory = lambda : {
282
315
"enzml" : "http://www.enzymeml.org/v2/" ,
283
- "OBO" : "http://purl.obolibrary.org/obo/" ,
284
316
"schema" : "https://schema.org/" ,
317
+ "OBO" : "http://purl.obolibrary.org/obo/" ,
285
318
"given_name" : "schema:givenName" ,
286
319
"family_name" : "schema:familyName" ,
287
320
"mail" : "schema:email" ,
@@ -310,8 +343,8 @@ class Vessel:
310
343
metadata = config (field_name = "@context" ),
311
344
default_factory = lambda : {
312
345
"enzml" : "http://www.enzymeml.org/v2/" ,
313
- "OBO" : "http://purl.obolibrary.org/obo/" ,
314
346
"schema" : "https://schema.org/" ,
347
+ "OBO" : "http://purl.obolibrary.org/obo/" ,
315
348
"id" : {
316
349
"@id" : "schema:identifier" ,
317
350
"@type" : "@id" ,
@@ -357,8 +390,8 @@ class Protein:
357
390
metadata = config (field_name = "@context" ),
358
391
default_factory = lambda : {
359
392
"enzml" : "http://www.enzymeml.org/v2/" ,
360
- "OBO" : "http://purl.obolibrary.org/obo/" ,
361
393
"schema" : "https://schema.org/" ,
394
+ "OBO" : "http://purl.obolibrary.org/obo/" ,
362
395
"id" : {
363
396
"@type" : "@id" ,
364
397
},
@@ -402,8 +435,8 @@ class Complex:
402
435
metadata = config (field_name = "@context" ),
403
436
default_factory = lambda : {
404
437
"enzml" : "http://www.enzymeml.org/v2/" ,
405
- "OBO" : "http://purl.obolibrary.org/obo/" ,
406
438
"schema" : "https://schema.org/" ,
439
+ "OBO" : "http://purl.obolibrary.org/obo/" ,
407
440
"id" : {
408
441
"@id" : "schema:identifier" ,
409
442
"@type" : "@id" ,
@@ -450,8 +483,8 @@ class SmallMolecule:
450
483
metadata = config (field_name = "@context" ),
451
484
default_factory = lambda : {
452
485
"enzml" : "http://www.enzymeml.org/v2/" ,
453
- "OBO" : "http://purl.obolibrary.org/obo/" ,
454
486
"schema" : "https://schema.org/" ,
487
+ "OBO" : "http://purl.obolibrary.org/obo/" ,
455
488
"id" : {
456
489
"@id" : "schema:identifier" ,
457
490
"@type" : "@id" ,
@@ -495,8 +528,8 @@ class Reaction:
495
528
metadata = config (field_name = "@context" ),
496
529
default_factory = lambda : {
497
530
"enzml" : "http://www.enzymeml.org/v2/" ,
498
- "OBO" : "http://purl.obolibrary.org/obo/" ,
499
531
"schema" : "https://schema.org/" ,
532
+ "OBO" : "http://purl.obolibrary.org/obo/" ,
500
533
"id" : {
501
534
"@id" : "schema:identifier" ,
502
535
"@type" : "@id" ,
@@ -544,8 +577,8 @@ class ReactionElement:
544
577
metadata = config (field_name = "@context" ),
545
578
default_factory = lambda : {
546
579
"enzml" : "http://www.enzymeml.org/v2/" ,
547
- "OBO" : "http://purl.obolibrary.org/obo/" ,
548
580
"schema" : "https://schema.org/" ,
581
+ "OBO" : "http://purl.obolibrary.org/obo/" ,
549
582
"species_id" : {
550
583
"@type" : "@id" ,
551
584
},
@@ -562,7 +595,6 @@ class Equation:
562
595
default = None , metadata = config (exclude = lambda x : x is None )
563
596
)
564
597
variables : List [Variable ] = field (default_factory = list )
565
- parameters : List [Parameter ] = field (default_factory = list )
566
598
567
599
# JSON-LD fields
568
600
id : str = field (
@@ -579,8 +611,8 @@ class Equation:
579
611
metadata = config (field_name = "@context" ),
580
612
default_factory = lambda : {
581
613
"enzml" : "http://www.enzymeml.org/v2/" ,
582
- "OBO" : "http://purl.obolibrary.org/obo/" ,
583
614
"schema" : "https://schema.org/" ,
615
+ "OBO" : "http://purl.obolibrary.org/obo/" ,
584
616
"species_id" : {
585
617
"@type" : "@id" ,
586
618
},
@@ -603,40 +635,6 @@ def add_to_variables(
603
635
604
636
return self .variables [- 1 ]
605
637
606
- def add_to_parameters (
607
- self ,
608
- id : str ,
609
- name : str ,
610
- symbol : str ,
611
- value : Optional [float ] = None ,
612
- unit : Optional [UnitDefinition ] = None ,
613
- initial_value : Optional [float ] = None ,
614
- upper : Optional [float ] = None ,
615
- lower : Optional [float ] = None ,
616
- stderr : Optional [float ] = None ,
617
- constant : Optional [bool ] = True ,
618
- ** kwargs ,
619
- ):
620
- params = {
621
- "id" : id ,
622
- "name" : name ,
623
- "symbol" : symbol ,
624
- "value" : value ,
625
- "unit" : unit ,
626
- "initial_value" : initial_value ,
627
- "upper" : upper ,
628
- "lower" : lower ,
629
- "stderr" : stderr ,
630
- "constant" : constant ,
631
- }
632
-
633
- if "id" in kwargs :
634
- params ["id" ] = kwargs ["id" ]
635
-
636
- self .parameters .append (Parameter (** params ))
637
-
638
- return self .parameters [- 1 ]
639
-
640
638
641
639
@dataclass_json
642
640
@dataclass
@@ -659,8 +657,8 @@ class Variable:
659
657
metadata = config (field_name = "@context" ),
660
658
default_factory = lambda : {
661
659
"enzml" : "http://www.enzymeml.org/v2/" ,
662
- "OBO" : "http://purl.obolibrary.org/obo/" ,
663
660
"schema" : "https://schema.org/" ,
661
+ "OBO" : "http://purl.obolibrary.org/obo/" ,
664
662
"id" : "schema:identifier" ,
665
663
},
666
664
)
@@ -706,8 +704,8 @@ class Parameter:
706
704
metadata = config (field_name = "@context" ),
707
705
default_factory = lambda : {
708
706
"enzml" : "http://www.enzymeml.org/v2/" ,
709
- "OBO" : "http://purl.obolibrary.org/obo/" ,
710
707
"schema" : "https://schema.org/" ,
708
+ "OBO" : "http://purl.obolibrary.org/obo/" ,
711
709
"id" : {
712
710
"@id" : "schema:identifier" ,
713
711
"@type" : "@id" ,
@@ -749,8 +747,8 @@ class Measurement:
749
747
metadata = config (field_name = "@context" ),
750
748
default_factory = lambda : {
751
749
"enzml" : "http://www.enzymeml.org/v2/" ,
752
- "OBO" : "http://purl.obolibrary.org/obo/" ,
753
750
"schema" : "https://schema.org/" ,
751
+ "OBO" : "http://purl.obolibrary.org/obo/" ,
754
752
"id" : {
755
753
"@id" : "schema:identifier" ,
756
754
"@type" : "@id" ,
@@ -824,8 +822,8 @@ class MeasurementData:
824
822
metadata = config (field_name = "@context" ),
825
823
default_factory = lambda : {
826
824
"enzml" : "http://www.enzymeml.org/v2/" ,
827
- "OBO" : "http://purl.obolibrary.org/obo/" ,
828
825
"schema" : "https://schema.org/" ,
826
+ "OBO" : "http://purl.obolibrary.org/obo/" ,
829
827
"species_id" : {
830
828
"@type" : "@id" ,
831
829
},
@@ -856,8 +854,8 @@ class UnitDefinition:
856
854
metadata = config (field_name = "@context" ),
857
855
default_factory = lambda : {
858
856
"enzml" : "http://www.enzymeml.org/v2/" ,
859
- "OBO" : "http://purl.obolibrary.org/obo/" ,
860
857
"schema" : "https://schema.org/" ,
858
+ "OBO" : "http://purl.obolibrary.org/obo/" ,
861
859
},
862
860
)
863
861
@@ -911,8 +909,8 @@ class BaseUnit:
911
909
metadata = config (field_name = "@context" ),
912
910
default_factory = lambda : {
913
911
"enzml" : "http://www.enzymeml.org/v2/" ,
914
- "OBO" : "http://purl.obolibrary.org/obo/" ,
915
912
"schema" : "https://schema.org/" ,
913
+ "OBO" : "http://purl.obolibrary.org/obo/" ,
916
914
},
917
915
)
918
916
0 commit comments