======
Silvio
======
.. image:: https://img.shields.io/pypi/v/silvio.svg
:target: https://pypi.python.org/pypi/silvio
.. image:: https://readthedocs.org/projects/silvio/badge/?version=latest
:target: https://silvio.readthedocs.io/en/latest/?version=latest
:alt: Documentation Status
silvio is an environment to combine microbiological models to simulate virtual cells.
* Authors: Ulf Liebal, Lars Blank
* Contact: ulf.liebal@rwth-aachen.de
* Licence: MIT Licence
* Free software: MIT license
* Documentation: https://silvio.readthedocs.io
Features
--------
* Simulate different components of a biological host using event-driven messaging.
* Produce data on procedures performed on the host at the given state.
Writing a Module
----------------
Prefer the use of [standardized code style](https://pep8.org/).
Make use of [python type hints](https://docs.python.org/3/library/typing.html) whenever possible.
When specifying types for variables and methods, your IDE will help you with organizing the inputs,
outputs and arguments that you may use.
.. code-block:: python
# Initial definition of a variable to store a probability
some_probability: float = 0
some_probability = 0.4 # Will work. The variable may receive fractional numbers.
some_probability = 0 # Will work. Integers are also numbers.
some_probability = "a lot" # Error! The IDE will notify us about this bad assignment.
some_probability = "0.3" # Error! This is still a string. No more conversion problems.
some_probability = -1.4 # Unfortunately this still works. Typing only defines simple types.
When writing classes, keep all properties (variables inside a class) at the top of the class definition,
outside of the constructor. The constructor should only perform the initial assignment.
.. code-block:: python
class BayesianNetworkNode :
"""
Each class should document what it does. Ideally, it should have a single purpose.
"""
# Probability that this node is true.
true_prob: float
# Probability that the node is false. Should be inverse of true probability.
false_prob: float
def __init__ ( self, true_prob: float ) :
# Notice that constructor arguments may have the same name as properties.
self.true_prob = true_prob
# The constructor only uses necessary arguments to initialize all properties.
self.false_prob = 1 - true_prob
How to name things is a very debated topic in many languages. When in doubt, follow the conventions
that have been laid by the [python standard](https://www.python.org/dev/peps/pep-0008/#naming-conventions).
Some common examples are.
.. code-block:: python
# Use lower_case with underscores. Prefer distinct names to single letters.
num_strands = 2
# Constants are values embedded into the code. Use UPPER_CASE with underscores.
GOLDEN_RATIO = 1.6180
# Module names use lower_case and avoids underscore when possible.
import biolabsim.sequencing.evaluation
# Custom types use PascalCase.
from typing import Tuple, Literal
GeneBase = Literal['A','T','C','G']
# Functions use lower_case and typically start with a verb.
def complement_base ( base:GeneBase ) -> GeneBase : # (input) -> output
# Include most initilization on top of the method.
orig_bases: List[GeneBase] = ['A','T','C','G'] # Common words may be shortened. orig = original
comp_bases: List[GeneBase] = ['T','A','G','C'] # But spell it out in comments. comp = complementary
# Split your code into blocks of related operations. Provide a small summary of each block.
# Comments should help outsiders to skim through the code and to explain programming decisions.
found_orig_index = orig_bases.index(base) # Avoid one-liners. Variable names provide context.
return comp_bases[found_orig_index]
# Use simple types to construct more complex ones.
Codon = Tuple[ GeneBase, GeneBase, GeneBase ]
# Classes use PascalCase as well.
class AminoAcid :
# Class properties use lower_case as well.
gene_triplet : Codon
# Constructors initialize the properties.
def __init__ ( self, base1:GeneBase, base2:GeneBase, base3:GeneBase ) :
self.gene_triplet = ( base1, base2, base3 )
# Leave enough space between method definitions.
def complement_triplet (self) -> Codon :
return ( # Use multiple lines and more spacing if the
complement_base( self.gene_triplet[0] ), # code becomes too bulky.
complement_base( self.gene_triplet[1] ),
complement_base( self.gene_triplet[2] ),
)
Generate Sphinx documentation.
------------------------------
Sphinx is not very automatic on how documentation is extracted from the code. We use
[sphinx-apidoc](https://www.sphinx-doc.org/en/master/man/sphinx-apidoc.html) to periodically generate the documentation `.rst` files.
.. code-block:: bash
# Assuming you start at the project root directory.
# Enter the documentation directory.
cd docs
# Remove the old API documentation.
rm -ri ./api
# Generate the new reStructuredText files for the API documentation.
sphinx-apidoc --module-first -d 4 -o api ../biolabsim
# Generate the HTML from all documentation files.
make html
Credits
-------
Extensive credits can be found in the author notes.
=======
History
=======
0.1.0 (2021-10-17)
------------------
* First release on PyPI.
0.1.4 (2022-04-07)
------------------
* add catalog with RecExpSim functions in src
0.1.5 (2022-04-07)
------------------
* add __init__.py to catalog folder
0.1.6 (2022-04-07)
------------------
* in RecExperiment: round print failure rate to two decimals
* in RecExperiment.simulate_growth: separate argument progress bar waiting
0.1.7 (2022-05-03)
------------------
* remove requirement cobra
0.1.8 (2022-05-03)
------------------
* remove cobra code dependencies
0.1.8 (2022-05-03)
------------------
* add cobra code dependencies
* remove undelete_gene
0.2.0 (2023-03-29)
------------------
* add GroExpSim, a class to simulate growth experiments
0.2.1 (2023-08-20)
------------------
* add storage of simulated data to Data folder
0.2.2 (2023-09-02)
------------------
* GroExpSim with:
* measure_DryWeight: measure the OD to DW conversion factor
* measure_TemperatureGrowth: measure the growth curve at different temperatures
* measure_BiomassSubstrateExp: measure the growth curve and substrate concentrations
* check_Results: check the results of the parameters
0.2.2 (2023-09-02)
------------------
* GroExpSim, nightshift must be within 15h of experiment
0.2.5 (2024-02-22)
------------------
* GroExpSim, export single growth experiments to existing reference excel sheet
0.2.6 (2024-04-23)
------------------
* RecExpSim, add umax argument to 'make' in 'RecHost' for new argument demands of function 'Make_TempGrowthExp' in 'extesions/modules/growth_behaviour.py'
0.2.7 (2025-02-12)
------------------
* add FermProSimFun to silvio/src
0.2.8 (2025-02-12)
------------------
* update versions scipy, scikit-learn
0.2.9 (2025-02-12)
------------------
* corrected matplotlib version error in FermProSimFun
Raw data
{
"_id": null,
"home_page": "https://git.rwth-aachen.de/ulf.liebal/silvio.git",
"name": "silvio",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "biotechnology, microbiology, virtual cell, systems biology",
"author": "Ulf Liebal",
"author_email": "ulf.liebal@rwth-aachen.de",
"download_url": "https://files.pythonhosted.org/packages/41/59/9ff1f6c79d25a22e838ce623f68332d8e40c77a5c05bbfc6aac10945167f/silvio-0.2.9.tar.gz",
"platform": null,
"description": "======\nSilvio\n======\n\n\n.. image:: https://img.shields.io/pypi/v/silvio.svg\n :target: https://pypi.python.org/pypi/silvio\n\n.. image:: https://readthedocs.org/projects/silvio/badge/?version=latest\n :target: https://silvio.readthedocs.io/en/latest/?version=latest\n :alt: Documentation Status\n\n\n\n\nsilvio is an environment to combine microbiological models to simulate virtual cells.\n\n* Authors: Ulf Liebal, Lars Blank\n* Contact: ulf.liebal@rwth-aachen.de\n* Licence: MIT Licence\n* Free software: MIT license\n* Documentation: https://silvio.readthedocs.io\n\nFeatures\n--------\n\n* Simulate different components of a biological host using event-driven messaging.\n* Produce data on procedures performed on the host at the given state.\n\nWriting a Module\n----------------\n\nPrefer the use of [standardized code style](https://pep8.org/).\n\nMake use of [python type hints](https://docs.python.org/3/library/typing.html) whenever possible.\nWhen specifying types for variables and methods, your IDE will help you with organizing the inputs,\noutputs and arguments that you may use.\n\n.. code-block:: python\n\n # Initial definition of a variable to store a probability\n some_probability: float = 0\n\n some_probability = 0.4 # Will work. The variable may receive fractional numbers.\n some_probability = 0 # Will work. Integers are also numbers.\n\n some_probability = \"a lot\" # Error! The IDE will notify us about this bad assignment.\n some_probability = \"0.3\" # Error! This is still a string. No more conversion problems.\n\n some_probability = -1.4 # Unfortunately this still works. Typing only defines simple types.\n\n\nWhen writing classes, keep all properties (variables inside a class) at the top of the class definition,\noutside of the constructor. The constructor should only perform the initial assignment.\n\n.. code-block:: python\n\n class BayesianNetworkNode :\n \"\"\"\n Each class should document what it does. Ideally, it should have a single purpose.\n \"\"\"\n\n # Probability that this node is true.\n true_prob: float\n\n # Probability that the node is false. Should be inverse of true probability.\n false_prob: float\n\n\n def __init__ ( self, true_prob: float ) :\n\n # Notice that constructor arguments may have the same name as properties.\n self.true_prob = true_prob\n\n # The constructor only uses necessary arguments to initialize all properties.\n self.false_prob = 1 - true_prob\n\nHow to name things is a very debated topic in many languages. When in doubt, follow the conventions\nthat have been laid by the [python standard](https://www.python.org/dev/peps/pep-0008/#naming-conventions).\nSome common examples are.\n\n.. code-block:: python\n \n # Use lower_case with underscores. Prefer distinct names to single letters.\n num_strands = 2\n\n # Constants are values embedded into the code. Use UPPER_CASE with underscores.\n GOLDEN_RATIO = 1.6180\n\n\n # Module names use lower_case and avoids underscore when possible.\n import biolabsim.sequencing.evaluation\n\n\n # Custom types use PascalCase.\n from typing import Tuple, Literal\n GeneBase = Literal['A','T','C','G']\n\n\n # Functions use lower_case and typically start with a verb.\n def complement_base ( base:GeneBase ) -> GeneBase : # (input) -> output\n\n # Include most initilization on top of the method.\n orig_bases: List[GeneBase] = ['A','T','C','G'] # Common words may be shortened. orig = original\n comp_bases: List[GeneBase] = ['T','A','G','C'] # But spell it out in comments. comp = complementary\n\n # Split your code into blocks of related operations. Provide a small summary of each block.\n # Comments should help outsiders to skim through the code and to explain programming decisions.\n found_orig_index = orig_bases.index(base) # Avoid one-liners. Variable names provide context.\n return comp_bases[found_orig_index]\n\n\n # Use simple types to construct more complex ones.\n Codon = Tuple[ GeneBase, GeneBase, GeneBase ]\n\n\n # Classes use PascalCase as well.\n class AminoAcid :\n\n # Class properties use lower_case as well.\n gene_triplet : Codon\n\n\n # Constructors initialize the properties.\n def __init__ ( self, base1:GeneBase, base2:GeneBase, base3:GeneBase ) :\n self.gene_triplet = ( base1, base2, base3 )\n\n\n # Leave enough space between method definitions.\n def complement_triplet (self) -> Codon :\n return ( # Use multiple lines and more spacing if the\n complement_base( self.gene_triplet[0] ), # code becomes too bulky.\n complement_base( self.gene_triplet[1] ),\n complement_base( self.gene_triplet[2] ),\n )\n\nGenerate Sphinx documentation.\n------------------------------\n\nSphinx is not very automatic on how documentation is extracted from the code. We use\n[sphinx-apidoc](https://www.sphinx-doc.org/en/master/man/sphinx-apidoc.html) to periodically generate the documentation `.rst` files.\n\n.. code-block:: bash\n\n # Assuming you start at the project root directory.\n\n # Enter the documentation directory.\n cd docs\n\n # Remove the old API documentation.\n rm -ri ./api\n\n # Generate the new reStructuredText files for the API documentation.\n sphinx-apidoc --module-first -d 4 -o api ../biolabsim\n\n # Generate the HTML from all documentation files.\n make html\n\n\nCredits\n-------\n\nExtensive credits can be found in the author notes.\n\n\n=======\nHistory\n=======\n\n0.1.0 (2021-10-17)\n------------------\n\n* First release on PyPI.\n\n0.1.4 (2022-04-07)\n------------------\n\n* add catalog with RecExpSim functions in src\n\n0.1.5 (2022-04-07)\n------------------\n\n* add __init__.py to catalog folder\n\n0.1.6 (2022-04-07)\n------------------\n\n* in RecExperiment: round print failure rate to two decimals\n* in RecExperiment.simulate_growth: separate argument progress bar waiting\n\n0.1.7 (2022-05-03)\n------------------\n\n* remove requirement cobra\n\n0.1.8 (2022-05-03)\n------------------\n\n* remove cobra code dependencies\n\n0.1.8 (2022-05-03)\n------------------\n\n* add cobra code dependencies\n* remove undelete_gene\n\n0.2.0 (2023-03-29)\n------------------\n\n* add GroExpSim, a class to simulate growth experiments\n\n0.2.1 (2023-08-20)\n------------------\n\n* add storage of simulated data to Data folder\n\n0.2.2 (2023-09-02)\n------------------\n\n* GroExpSim with: \n * measure_DryWeight: measure the OD to DW conversion factor\n * measure_TemperatureGrowth: measure the growth curve at different temperatures\n * measure_BiomassSubstrateExp: measure the growth curve and substrate concentrations\n * check_Results: check the results of the parameters\n\n0.2.2 (2023-09-02)\n------------------\n\n* GroExpSim, nightshift must be within 15h of experiment\n\n0.2.5 (2024-02-22)\n------------------\n\n* GroExpSim, export single growth experiments to existing reference excel sheet\n\n0.2.6 (2024-04-23)\n------------------\n\n* RecExpSim, add umax argument to 'make' in 'RecHost' for new argument demands of function 'Make_TempGrowthExp' in 'extesions/modules/growth_behaviour.py'\n\n0.2.7 (2025-02-12)\n------------------\n\n* add FermProSimFun to silvio/src\n\n0.2.8 (2025-02-12)\n------------------\n\n* update versions scipy, scikit-learn\n\n0.2.9 (2025-02-12)\n------------------\n\n* corrected matplotlib version error in FermProSimFun\n\n",
"bugtrack_url": null,
"license": "MIT license",
"summary": "silvio is an environment for Simulation of Virtual Organisms. silvio contains several linked microbial models.",
"version": "0.2.9",
"project_urls": {
"Homepage": "https://git.rwth-aachen.de/ulf.liebal/silvio.git"
},
"split_keywords": [
"biotechnology",
" microbiology",
" virtual cell",
" systems biology"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ad7ad6fa0dd94b1a7e156b958c38663a4006f6f6ff9e72b5e2027936153cf9f9",
"md5": "eead74f87823de66c805e9d044a3e78e",
"sha256": "5d236bc75ed3332d4d086ddd0c515e7cbdf33bebafbb34366c7c4fa60e5da6ff"
},
"downloads": -1,
"filename": "silvio-0.2.9-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "eead74f87823de66c805e9d044a3e78e",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.9",
"size": 545498,
"upload_time": "2025-02-12T10:14:45",
"upload_time_iso_8601": "2025-02-12T10:14:45.778270Z",
"url": "https://files.pythonhosted.org/packages/ad/7a/d6fa0dd94b1a7e156b958c38663a4006f6f6ff9e72b5e2027936153cf9f9/silvio-0.2.9-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "41599ff1f6c79d25a22e838ce623f68332d8e40c77a5c05bbfc6aac10945167f",
"md5": "ef932eb0924aa74650d41a74a84e36c7",
"sha256": "9267520a27bca795be55fdae2596844603a52719a8b7e200829bf3a00fcb7c34"
},
"downloads": -1,
"filename": "silvio-0.2.9.tar.gz",
"has_sig": false,
"md5_digest": "ef932eb0924aa74650d41a74a84e36c7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 508951,
"upload_time": "2025-02-12T10:14:47",
"upload_time_iso_8601": "2025-02-12T10:14:47.912672Z",
"url": "https://files.pythonhosted.org/packages/41/59/9ff1f6c79d25a22e838ce623f68332d8e40c77a5c05bbfc6aac10945167f/silvio-0.2.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-12 10:14:47",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "silvio"
}