pyRBM


NamepyRBM JSON
Version 0.0.3 PyPI version JSON
download
home_pageNone
SummaryA Python framework to build and simulate stochastic rules-based models
upload_time2024-09-03 22:39:32
maintainerNone
docs_urlNone
authorNone
requires_python>=3.4
licenseGNU General Public License v3 (GPLv3)
keywords gillespie algorithm mathematical modelling rules based ssa spatial modelling stochastic modelling sympy
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
What does this project do?
Why is this project useful?
How do I get started?
Where can I get more help, if I need it?


The framework is in pre-alpha development and components are lightly tested, if at all - use of the framework is at the users risk. Any feedback or suggestions for improvement is welcome (either create an issue or start a discussion.

# Implemented Features
### Core:
- Model created and validated from a list of user defined classes, a function that returns a list of Build.Locations and a function that returns a list of Build.Rules.
- Validation that rules can be triggered, locations are matched to rules have the constants and the user defined classes that are required by the rule (i.e. used in either the propensity function), the propensity function evaluates to a number when the  
- Save the model locations, classes, rules and matched rules to json file.
- Load the model locations, classes and matched rules from the created json file for simulation.
- Simulate upto a time point subject to a maximum iteration threshold.

### Rules: 
- "Metarule" definition allows the creation of multiple matched rules - as long as the target in the rule matches the type of the location. At the moment a location can match in different target slots across different matchings but only one slot in a matching.
- Rules allow for multiple locations and the propensities and stoichiometry supports multi-location rules
- Sympy propensity functions using user defined compartments, user defined constants attached to a location (prefixed with loc_) and model state values (currently just time based, prefixed with model_).
- Stoichiometry allowing user defined compartments to change (currently just by a constant value).
- Note: the rules may not precisely satisfy the Gillespie algorithm, it is upto the user to ensure it does at the moment (or just hope).

### RuleTemplates:
- SingleLocationRule: Provides a wrapper to simplify the creation of a rule based on a single location.
- SingleLocationProductionRule: Provides a wrapper to simplify the creation of a rule at a single location where any number of reactants form any number of products (i.e. a production rule).
- TransportRule: Provides a wrapper to simplify the creation of a rule where a single compartment moves from a single location to another.
- ExitEntranceRule: Provides a wrapper to simplify the creation of a rule where an amount of a single compartment leaves or enters (depending on the positive or negative transport_amount) the system, at a given location.

### Locations:
- Define per location constants and per location initial values.

### Classes:
- Define the name, unit and an optional (unused) description of the class.

### RuleChain:
- Compute the compartment values that will change given a rule and the locations (index set from rule matching) that trigger it - used to work out which propensities to update.

### Solvers:
- Generic solver interface - extend from this to create own solvers.
- Classic Gillespie algorithm with propensity caching (only update the value of the propensity when the underlying symbol value changes.
- A default behaviour to execute when no rules have any propensity (either step or exit). Step is useful for seasonal models.

### Trajectory:
- Store the values of all user defined compartments, partitioned by location - stores a data point before and after a change in value only.
- Basic matplotlib plot of values at a location.

# Known issues:
- Model state variables don't trigger a recomputation of propensities when propensity_caching = True.
- Executing simulate twice leads to an error, reinitialising the solver before second execution fixes it for now!

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyRBM",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.4",
    "maintainer_email": null,
    "keywords": "Gillespie Algorithm, Mathematical Modelling, Rules Based, SSA, Spatial Modelling, Stochastic Modelling, SymPy",
    "author": null,
    "author_email": "James Flynn <jameswflynn@hotmail.co.uk>",
    "download_url": "https://files.pythonhosted.org/packages/05/69/7a4b5ed7e0f5966d768a1104a64c07fda9ce375d4b80667595a4075a367f/pyrbm-0.0.3.tar.gz",
    "platform": null,
    "description": "\nWhat does this project do?\nWhy is this project useful?\nHow do I get started?\nWhere can I get more help, if I need it?\n\n\nThe framework is in pre-alpha development and components are lightly tested, if at all - use of the framework is at the users risk. Any feedback or suggestions for improvement is welcome (either create an issue or start a discussion.\n\n# Implemented Features\n### Core:\n- Model created and validated from a list of user defined classes, a function that returns a list of Build.Locations and a function that returns a list of Build.Rules.\n- Validation that rules can be triggered, locations are matched to rules have the constants and the user defined classes that are required by the rule (i.e. used in either the propensity function), the propensity function evaluates to a number when the  \n- Save the model locations, classes, rules and matched rules to json file.\n- Load the model locations, classes and matched rules from the created json file for simulation.\n- Simulate upto a time point subject to a maximum iteration threshold.\n\n### Rules: \n- \"Metarule\" definition allows the creation of multiple matched rules - as long as the target in the rule matches the type of the location. At the moment a location can match in different target slots across different matchings but only one slot in a matching.\n- Rules allow for multiple locations and the propensities and stoichiometry supports multi-location rules\n- Sympy propensity functions using user defined compartments, user defined constants attached to a location (prefixed with loc_) and model state values (currently just time based, prefixed with model_).\n- Stoichiometry allowing user defined compartments to change (currently just by a constant value).\n- Note: the rules may not precisely satisfy the Gillespie algorithm, it is upto the user to ensure it does at the moment (or just hope).\n\n### RuleTemplates:\n- SingleLocationRule: Provides a wrapper to simplify the creation of a rule based on a single location.\n- SingleLocationProductionRule: Provides a wrapper to simplify the creation of a rule at a single location where any number of reactants form any number of products (i.e. a production rule).\n- TransportRule: Provides a wrapper to simplify the creation of a rule where a single compartment moves from a single location to another.\n- ExitEntranceRule: Provides a wrapper to simplify the creation of a rule where an amount of a single compartment leaves or enters (depending on the positive or negative transport_amount) the system, at a given location.\n\n### Locations:\n- Define per location constants and per location initial values.\n\n### Classes:\n- Define the name, unit and an optional (unused) description of the class.\n\n### RuleChain:\n- Compute the compartment values that will change given a rule and the locations (index set from rule matching) that trigger it - used to work out which propensities to update.\n\n### Solvers:\n- Generic solver interface - extend from this to create own solvers.\n- Classic Gillespie algorithm with propensity caching (only update the value of the propensity when the underlying symbol value changes.\n- A default behaviour to execute when no rules have any propensity (either step or exit). Step is useful for seasonal models.\n\n### Trajectory:\n- Store the values of all user defined compartments, partitioned by location - stores a data point before and after a change in value only.\n- Basic matplotlib plot of values at a location.\n\n# Known issues:\n- Model state variables don't trigger a recomputation of propensities when propensity_caching = True.\n- Executing simulate twice leads to an error, reinitialising the solver before second execution fixes it for now!\n",
    "bugtrack_url": null,
    "license": "GNU General Public License v3 (GPLv3)",
    "summary": "A Python framework to build and simulate stochastic rules-based models",
    "version": "0.0.3",
    "project_urls": {
        "Changelog": "https://github.com/Jamesflynn1/pyRBM/releases",
        "Documentation": "https://pyrbm.readthedocs.io/en/latest/index.html",
        "Homepage": "https://github.com/Jamesflynn1/pyRBM/",
        "Issues": "https://github.com/Jamesflynn1/pyRBM/issues",
        "Repository": "https://github.com/Jamesflynn1/pyRBM/"
    },
    "split_keywords": [
        "gillespie algorithm",
        " mathematical modelling",
        " rules based",
        " ssa",
        " spatial modelling",
        " stochastic modelling",
        " sympy"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0f5edaa862575c5d2ddb733dae8415b6492f8e16bf4eebe9fdd2ffab34c0fe6c",
                "md5": "e262d04720b70a2b29b24a956a670b79",
                "sha256": "85f7c8bfa1f0f7202506fba5dffceae5897a9bc8abf061b5441d1b827ba9cea5"
            },
            "downloads": -1,
            "filename": "pyrbm-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e262d04720b70a2b29b24a956a670b79",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.4",
            "size": 40304,
            "upload_time": "2024-09-03T22:39:31",
            "upload_time_iso_8601": "2024-09-03T22:39:31.198549Z",
            "url": "https://files.pythonhosted.org/packages/0f/5e/daa862575c5d2ddb733dae8415b6492f8e16bf4eebe9fdd2ffab34c0fe6c/pyrbm-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "05697a4b5ed7e0f5966d768a1104a64c07fda9ce375d4b80667595a4075a367f",
                "md5": "2e4504c7a303ac2da6a57b2a4dc117f3",
                "sha256": "dca9ab8aef58849165d902f6d6960e5489e921f5316b304310eae58dac99e6dc"
            },
            "downloads": -1,
            "filename": "pyrbm-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "2e4504c7a303ac2da6a57b2a4dc117f3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.4",
            "size": 42816,
            "upload_time": "2024-09-03T22:39:32",
            "upload_time_iso_8601": "2024-09-03T22:39:32.803977Z",
            "url": "https://files.pythonhosted.org/packages/05/69/7a4b5ed7e0f5966d768a1104a64c07fda9ce375d4b80667595a4075a367f/pyrbm-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-03 22:39:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Jamesflynn1",
    "github_project": "pyRBM",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pyrbm"
}
        
Elapsed time: 1.32327s