Modules¶
libvcell¶
VCellExpressionError
¶
Bases: Exception
Raised when a VCell expression cannot be evaluated.
Attributes:
| Name | Type | Description |
|---|---|---|
error_type |
the originating Java exception's simple class name (e.g. |
|
message |
the error message, or |
Source code in libvcell/model_utils.py
6 7 8 9 10 11 12 13 14 15 16 17 18 | |
evaluate_expression(expression_infix, symbol_table)
¶
Evaluate a native-syntax VCell infix expression against a table of symbol values.
Any symbol referenced by the expression must be present in symbol_table; extra
(unreferenced) symbols are permitted and ignored.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
expression_infix
|
str
|
native VCell infix expression string (e.g. |
required |
symbol_table
|
dict[str, float]
|
mapping of symbol name to 64-bit float value |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
the evaluated value |
Raises:
| Type | Description |
|---|---|
VCellExpressionError
|
if the expression fails to parse, references an unsupplied symbol, fails to evaluate (e.g. division by zero, math domain error), or evaluates to a non-finite value. |
Source code in libvcell/model_utils.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
sbml_to_finite_volume_input(sbml_content, output_dir_path)
¶
Convert SBML content to finite volume input files
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sbml_content
|
str
|
SBML content |
required |
output_dir_path
|
Path
|
output directory path |
required |
Returns:
| Type | Description |
|---|---|
tuple[bool, str]
|
tuple[bool, str]: A tuple containing the success status and a message |
Source code in libvcell/solver_utils.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
sbml_to_vcml(sbml_content, vcml_file_path)
¶
Convert SBML content to finite volume input files
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sbml_content
|
str
|
SBML content |
required |
vcml_file_path
|
Path
|
path to resulting VCML file |
required |
Returns:
| Type | Description |
|---|---|
tuple[bool, str]
|
tuple[bool, str]: A tuple containing the success status and a message |
Source code in libvcell/model_utils.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 | |
vcell_infix_to_num_expr_infix(vcell_infix)
¶
Converts an infix string version of a VCell Native Expression, and converts it to a NumExpr compatible version
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vcell_infix
|
str
|
the infix to convert |
required |
Returns:
| Type | Description |
|---|---|
tuple[bool, str, str]
|
tuple[bool, str, str]: A tuple containing the success status, a message, and the converted infix |
Source code in libvcell/model_utils.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 | |
vcell_infix_to_python_infix(vcell_infix)
¶
Converts an infix string version of a VCell Native Expression, and converts it to a Python compatible version
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vcell_infix
|
str
|
the infix to convert |
required |
Returns:
| Type | Description |
|---|---|
tuple[bool, str, str]
|
tuple[bool, str, str]: A tuple containing the success status, a message, and the converted infix |
Source code in libvcell/model_utils.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |
vcml_to_finite_volume_input(vcml_content, simulation_name, output_dir_path)
¶
Convert VCML content to finite volume input files
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vcml_content
|
str
|
VCML content |
required |
simulation_name
|
str
|
simulation name |
required |
output_dir_path
|
Path
|
output directory path |
required |
Returns:
| Type | Description |
|---|---|
tuple[bool, str]
|
tuple[bool, str]: A tuple containing the success status and a message |
Source code in libvcell/solver_utils.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |
vcml_to_moving_boundary_input(vcml_content, simulation_name, output_dir_path)
¶
Convert VCML content to Moving Boundary solver input (a MovingBoundarySetup XML file)
The named simulation must be configured for the Moving Boundary solver. The generated
MovingBoundarySetup XML can be consumed by the vcell-mbsolver package (MovingBoundarySolver.from_xml).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vcml_content
|
str
|
VCML content |
required |
simulation_name
|
str
|
simulation name (must use the Moving Boundary solver) |
required |
output_dir_path
|
Path
|
output directory path |
required |
Returns:
| Type | Description |
|---|---|
tuple[bool, str]
|
tuple[bool, str]: A tuple containing the success status and a message |
Source code in libvcell/solver_utils.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
vcml_to_sbml(vcml_content, application_name, sbml_file_path, round_trip_validation)
¶
Convert VCML content to SBML file
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vcml_content
|
str
|
VCML content |
required |
application_name
|
str
|
VCell Biomodel application name |
required |
sbml_file_path
|
Path
|
path to resulting SBML file |
required |
Returns:
| Type | Description |
|---|---|
tuple[bool, str]
|
tuple[bool, str]: A tuple containing the success status and a message |
Source code in libvcell/model_utils.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
vcml_to_vcml(vcml_content, vcml_file_path)
¶
Process VCML content to regenerated VCML file
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vcml_content
|
str
|
VCML content |
required |
vcml_file_path
|
Path
|
path to resulting VCML file |
required |
Returns:
| Type | Description |
|---|---|
tuple[bool, str]
|
tuple[bool, str]: A tuple containing the success status and a message |
Source code in libvcell/model_utils.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 | |
Modules¶
libvcell¶
VCellExpressionError
¶
Bases: Exception
Raised when a VCell expression cannot be evaluated.
Attributes:
| Name | Type | Description |
|---|---|---|
error_type |
the originating Java exception's simple class name (e.g. |
|
message |
the error message, or |
Source code in libvcell/model_utils.py
6 7 8 9 10 11 12 13 14 15 16 17 18 | |
evaluate_expression(expression_infix, symbol_table)
¶
Evaluate a native-syntax VCell infix expression against a table of symbol values.
Any symbol referenced by the expression must be present in symbol_table; extra
(unreferenced) symbols are permitted and ignored.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
expression_infix
|
str
|
native VCell infix expression string (e.g. |
required |
symbol_table
|
dict[str, float]
|
mapping of symbol name to 64-bit float value |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
the evaluated value |
Raises:
| Type | Description |
|---|---|
VCellExpressionError
|
if the expression fails to parse, references an unsupplied symbol, fails to evaluate (e.g. division by zero, math domain error), or evaluates to a non-finite value. |
Source code in libvcell/model_utils.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
sbml_to_finite_volume_input(sbml_content, output_dir_path)
¶
Convert SBML content to finite volume input files
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sbml_content
|
str
|
SBML content |
required |
output_dir_path
|
Path
|
output directory path |
required |
Returns:
| Type | Description |
|---|---|
tuple[bool, str]
|
tuple[bool, str]: A tuple containing the success status and a message |
Source code in libvcell/solver_utils.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
sbml_to_vcml(sbml_content, vcml_file_path)
¶
Convert SBML content to finite volume input files
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sbml_content
|
str
|
SBML content |
required |
vcml_file_path
|
Path
|
path to resulting VCML file |
required |
Returns:
| Type | Description |
|---|---|
tuple[bool, str]
|
tuple[bool, str]: A tuple containing the success status and a message |
Source code in libvcell/model_utils.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 | |
vcell_infix_to_num_expr_infix(vcell_infix)
¶
Converts an infix string version of a VCell Native Expression, and converts it to a NumExpr compatible version
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vcell_infix
|
str
|
the infix to convert |
required |
Returns:
| Type | Description |
|---|---|
tuple[bool, str, str]
|
tuple[bool, str, str]: A tuple containing the success status, a message, and the converted infix |
Source code in libvcell/model_utils.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 | |
vcell_infix_to_python_infix(vcell_infix)
¶
Converts an infix string version of a VCell Native Expression, and converts it to a Python compatible version
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vcell_infix
|
str
|
the infix to convert |
required |
Returns:
| Type | Description |
|---|---|
tuple[bool, str, str]
|
tuple[bool, str, str]: A tuple containing the success status, a message, and the converted infix |
Source code in libvcell/model_utils.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |
vcml_to_finite_volume_input(vcml_content, simulation_name, output_dir_path)
¶
Convert VCML content to finite volume input files
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vcml_content
|
str
|
VCML content |
required |
simulation_name
|
str
|
simulation name |
required |
output_dir_path
|
Path
|
output directory path |
required |
Returns:
| Type | Description |
|---|---|
tuple[bool, str]
|
tuple[bool, str]: A tuple containing the success status and a message |
Source code in libvcell/solver_utils.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |
vcml_to_moving_boundary_input(vcml_content, simulation_name, output_dir_path)
¶
Convert VCML content to Moving Boundary solver input (a MovingBoundarySetup XML file)
The named simulation must be configured for the Moving Boundary solver. The generated
MovingBoundarySetup XML can be consumed by the vcell-mbsolver package (MovingBoundarySolver.from_xml).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vcml_content
|
str
|
VCML content |
required |
simulation_name
|
str
|
simulation name (must use the Moving Boundary solver) |
required |
output_dir_path
|
Path
|
output directory path |
required |
Returns:
| Type | Description |
|---|---|
tuple[bool, str]
|
tuple[bool, str]: A tuple containing the success status and a message |
Source code in libvcell/solver_utils.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
vcml_to_sbml(vcml_content, application_name, sbml_file_path, round_trip_validation)
¶
Convert VCML content to SBML file
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vcml_content
|
str
|
VCML content |
required |
application_name
|
str
|
VCell Biomodel application name |
required |
sbml_file_path
|
Path
|
path to resulting SBML file |
required |
Returns:
| Type | Description |
|---|---|
tuple[bool, str]
|
tuple[bool, str]: A tuple containing the success status and a message |
Source code in libvcell/model_utils.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
vcml_to_vcml(vcml_content, vcml_file_path)
¶
Process VCML content to regenerated VCML file
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vcml_content
|
str
|
VCML content |
required |
vcml_file_path
|
Path
|
path to resulting VCML file |
required |
Returns:
| Type | Description |
|---|---|
tuple[bool, str]
|
tuple[bool, str]: A tuple containing the success status and a message |
Source code in libvcell/model_utils.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 | |
Functions¶
sbml_to_finite_volume_input¶
Convert SBML content to finite volume input files
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sbml_content
|
str
|
SBML content |
required |
output_dir_path
|
Path
|
output directory path |
required |
Returns:
| Type | Description |
|---|---|
tuple[bool, str]
|
tuple[bool, str]: A tuple containing the success status and a message |
Source code in libvcell/solver_utils.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
vcml_to_finite_volume_input¶
Convert VCML content to finite volume input files
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vcml_content
|
str
|
VCML content |
required |
simulation_name
|
str
|
simulation name |
required |
output_dir_path
|
Path
|
output directory path |
required |
Returns:
| Type | Description |
|---|---|
tuple[bool, str]
|
tuple[bool, str]: A tuple containing the success status and a message |
Source code in libvcell/solver_utils.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |
evaluate_expression¶
Evaluate a native-syntax VCell infix expression against a table of symbol values.
Any symbol referenced by the expression must be present in symbol_table; extra
(unreferenced) symbols are permitted and ignored.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
expression_infix
|
str
|
native VCell infix expression string (e.g. |
required |
symbol_table
|
dict[str, float]
|
mapping of symbol name to 64-bit float value |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
the evaluated value |
Raises:
| Type | Description |
|---|---|
VCellExpressionError
|
if the expression fails to parse, references an unsupplied symbol, fails to evaluate (e.g. division by zero, math domain error), or evaluates to a non-finite value. |
Source code in libvcell/model_utils.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
VCellExpressionError¶
Bases: Exception
Raised when a VCell expression cannot be evaluated.
Attributes:
| Name | Type | Description |
|---|---|---|
error_type |
the originating Java exception's simple class name (e.g. |
|
message |
the error message, or |
Source code in libvcell/model_utils.py
6 7 8 9 10 11 12 13 14 15 16 17 18 | |