@@ -470,16 +470,16 @@ end
470
470
"""
471
471
has_noise_scaling(reaction::Reaction)
472
472
473
- Checks whether a specific reaction has the metadata field `noise_scaing`. If so, returns `true`, else
474
- returns `false`.
473
+ Returns `true` if the input reaction has the `noise_scaing` metadata field assigned, else `false`.
475
474
476
475
Arguments:
477
- - `reaction`: The reaction for which we wish to check.
476
+ - `reaction`: The reaction we wish to check for the `noise_scaing` metadata field .
478
477
479
478
Example:
480
479
```julia
481
480
reaction = @reaction k, 0 --> X, [noise_scaling=0.0]
482
481
has_noise_scaling(reaction)
482
+ ```
483
483
"""
484
484
function has_noise_scaling (reaction:: Reaction )
485
485
return hasmetadata (reaction, :noise_scaling )
@@ -488,15 +488,16 @@ end
488
488
"""
489
489
get_noise_scaling(reaction::Reaction)
490
490
491
- Returns the noise_scaling metadata from a specific reaction.
491
+ Returns `noise_scaing` metadata field for the input reaction.
492
492
493
493
Arguments:
494
- - `reaction`: The reaction for which we wish to retrive all metadata.
494
+ - `reaction`: The reaction we wish to retrieve the `noise_scaing` metadata field .
495
495
496
496
Example:
497
497
```julia
498
498
reaction = @reaction k, 0 --> X, [noise_scaling=0.0]
499
499
get_noise_scaling(reaction)
500
+ ```
500
501
"""
501
502
function get_noise_scaling (reaction:: Reaction )
502
503
if has_noise_scaling (reaction)
@@ -506,6 +507,88 @@ function get_noise_scaling(reaction::Reaction)
506
507
end
507
508
end
508
509
510
+ # Description.
511
+ """
512
+ has_description(reaction::Reaction)
513
+
514
+ Returns `true` if the input reaction has the `description` metadata field assigned, else `false`.
515
+
516
+ Arguments:
517
+ - `reaction`: The reaction we wish to check for the `description` metadata field.
518
+
519
+ Example:
520
+ ```julia
521
+ reaction = @reaction k, 0 --> X, [description="A reaction"]
522
+ has_description(reaction)
523
+ ```
524
+ """
525
+ function has_description (reaction:: Reaction )
526
+ return hasmetadata (reaction, :description )
527
+ end
528
+
529
+ """
530
+ get_description(reaction::Reaction)
531
+
532
+ Returns `description` metadata field for the input reaction.
533
+
534
+ Arguments:
535
+ - `reaction`: The reaction we wish to retrieve the `description` metadata field.
536
+
537
+ Example:
538
+ ```julia
539
+ reaction = @reaction k, 0 --> X, [description="A reaction"]
540
+ get_description(reaction)
541
+ ```
542
+ """
543
+ function get_description (reaction:: Reaction )
544
+ if has_description (reaction)
545
+ return getmetadata (reaction, :description )
546
+ else
547
+ error (" Attempts to access `description` metadata field for a reaction which does not have a value assigned for this metadata." )
548
+ end
549
+ end
550
+
551
+ # Misc.
552
+ """
553
+ has_misc(reaction::Reaction)
554
+
555
+ Returns `true` if the input reaction has the `misc` metadata field assigned, else `false`.
556
+
557
+ Arguments:
558
+ - `reaction`: The reaction we wish to check for the `misc` metadata field.
559
+
560
+ Example:
561
+ ```julia
562
+ reaction = @reaction k, 0 --> X, [misc="A reaction"]
563
+ misc(reaction)
564
+ ```
565
+ """
566
+ function has_misc (reaction:: Reaction )
567
+ return hasmetadata (reaction, :misc )
568
+ end
569
+
570
+ """
571
+ get_misc(reaction::Reaction)
572
+
573
+ Returns `misc` metadata field for the input reaction.
574
+
575
+ Arguments:
576
+ - `reaction`: The reaction we wish to retrieve the `misc` metadata field.
577
+
578
+ Example:
579
+ ```julia
580
+ reaction = @reaction k, 0 --> X, [misc="A reaction"]
581
+ get_misc(reaction)
582
+ ```
583
+ """
584
+ function get_misc (reaction:: Reaction )
585
+ if has_description (reaction)
586
+ return getmetadata (reaction, :misc )
587
+ else
588
+ error (" Attempts to access `misc` metadata field for a reaction which does not have a value assigned for this metadata." )
589
+ end
590
+ end
591
+
509
592
510
593
# ## Units Handling ###
511
594
0 commit comments