======
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
Raw data
{
"_id": null,
"home_page": "https://git.rwth-aachen.de/ulf.liebal/silvio.git",
"name": "silvio",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "",
"keywords": "biotechnology,microbiology,virtual cell,systems biology",
"author": "Ulf Liebal",
"author_email": "ulf.liebal@rwth-aachen.de",
"download_url": "https://files.pythonhosted.org/packages/65/90/118427c3600897cc03c48792ec885317961766520c672b401dd65155378c/silvio-0.2.5.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\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.5",
"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": "2f20a615418ef08ccbeebbd262467b1674f8dd552709825ef39c7b446614877e",
"md5": "f32bebb2cd48716b8f10812f6150041e",
"sha256": "f7b93bee885762755746d3d13679c629af01b4e70a0c43377fef4124b91d5b6c"
},
"downloads": -1,
"filename": "silvio-0.2.5-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "f32bebb2cd48716b8f10812f6150041e",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.9",
"size": 540385,
"upload_time": "2024-02-23T11:05:56",
"upload_time_iso_8601": "2024-02-23T11:05:56.892892Z",
"url": "https://files.pythonhosted.org/packages/2f/20/a615418ef08ccbeebbd262467b1674f8dd552709825ef39c7b446614877e/silvio-0.2.5-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6590118427c3600897cc03c48792ec885317961766520c672b401dd65155378c",
"md5": "0aeb0c4123dc7d37b71bf01365ddb045",
"sha256": "144e1846b51932d8cda32e79a3074215a8bc102204e2d93c0f96f0bb0244b51a"
},
"downloads": -1,
"filename": "silvio-0.2.5.tar.gz",
"has_sig": false,
"md5_digest": "0aeb0c4123dc7d37b71bf01365ddb045",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 503610,
"upload_time": "2024-02-23T11:05:58",
"upload_time_iso_8601": "2024-02-23T11:05:58.963042Z",
"url": "https://files.pythonhosted.org/packages/65/90/118427c3600897cc03c48792ec885317961766520c672b401dd65155378c/silvio-0.2.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-23 11:05:58",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "silvio"
}