Metadata-Version: 2.4
Name: nskinetics
Version: 0.9.2
Summary: Simulation of Non-Steady state enzyme Kinetics and inhibitory phenomena
Home-page: https://github.com/sarangbhagwat/nskinetics
Download-URL: https://github.com/sarangbhagwat/nskinetics.git
Author: Sarang S. Bhagwat
Author-email: sarangbhagwat.developer@gmail.com
License: MIT
Keywords: reaction kinetics,biocatalysis,biomanufacturing,bioprocess engineering,mass and energy balance,process simulation,biorefinery,biofuel,bioproducts
Platform: Windows
Platform: Mac
Platform: Linux
Classifier: License :: OSI Approved :: MIT License
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Manufacturing
Classifier: Intended Audience :: Science/Research
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Operating System :: POSIX :: BSD
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Education
Requires-Python: >=3.12
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: IPython>=7.9.0
Requires-Dist: numpy<3.0.0,>=2.3.5
Requires-Dist: numba<1.0.0,>=0.62.1
Requires-Dist: scipy<2.0.0,>=1.15.2
Requires-Dist: matplotlib<4.0.0,>=3.10.1
Requires-Dist: xlsxwriter<4.0.0,>=3.2.5
Requires-Dist: scikit-learn
Requires-Dist: pandas<4.0.0,>=2.2.2
Requires-Dist: tellurium
Requires-Dist: six<2.0.0,>=1.16.0
Requires-Dist: biosteam<2.55.0,>=2.53.11
Provides-Extra: isobutanol
Requires-Dist: biorefineries; extra == "isobutanol"
Requires-Dist: hensmith; extra == "isobutanol"
Requires-Dist: contourplots>=0.4.0; extra == "isobutanol"
Requires-Dist: optuna>=4.9; extra == "isobutanol"
Requires-Dist: SALib>=1.5; extra == "isobutanol"
Requires-Dist: openpyxl; extra == "isobutanol"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: download-url
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: platform
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

.. image:: docs/source/_static/images/logo/logo_nskinetics_light_white-circle.png
  :width: 250

===============================================================
The (Non-)Steady state Kinetics simulation package (NSKinetics)
===============================================================

.. image:: http://img.shields.io/pypi/v/nskinetics.svg?style=flat
   :target: https://pypi.python.org/pypi/nskinetics
   :alt: Version_status
.. image:: http://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat
   :target: https://nskinetics.readthedocs.io/en/latest/
   :alt: Documentation
.. image:: http://img.shields.io/badge/license-MIT-blue.svg?style=flat
   :target: https://github.com/sarangbhagwat/nskinetics/blob/main/LICENSE
   :alt: license
.. image:: https://img.shields.io/pypi/pyversions/nskinetics.svg
   :target: https://pypi.python.org/pypi/nskinetics
   :alt: Supported_versions
.. image:: https://coveralls.io/repos/github/sarangbhagwat/nskinetics/badge.svg?cachebuster=202507072
   :target: https://coveralls.io/github/sarangbhagwat/nskinetics?branch=main

**Contents**

.. contents::
   :local:

What is NSKinetics?
-------------------

NSKinetics is a fast, flexible, and convenient package in Python for simulating steady- and non-steady-state reaction kinetics — including microbial fermentation and enzyme kinetics — and connecting them to techno-economic analysis (TEA) and life-cycle assessment (LCA) under uncertainty. Kinetic models are declared as SBML — most easily authored as `Antimony <https://tellurium.readthedocs.io/en/latest/antimony.html>`__ text, or imported from an existing SBML file — and wrapped in a ``KineticModel``, which adds unit-aware value access and a Python event API on top of a Tellurium RoadRunner engine that performs the actual ODE integration. ``Event`` covers a single trigger/assignment pair (a parameter switch, a control action); the higher-level ``FeedSpike`` builds on it for fed-batch feeding, topping a species back up to a target concentration whenever it drops below a threshold. The same kinetic model can then drive a `BioSTEAM <https://biosteam.readthedocs.io/en/latest/>`__ process unit through the ``NSKBatchReactor`` bridge, coupling kinetics directly to TEA.

Installation
------------

Get the latest version of NSKinetics from `PyPI <https://pypi.org/project/nskinetics/>`__. If you have an installation of Python with pip, simply install it with:

.. code-block:: bash

    $ pip install nskinetics

To get the git version, run:

.. code-block:: bash

    $ git clone https://github.com/sarangbhagwat/nskinetics

For help on common installation issues, please visit the `documentation <https://nskinetics.readthedocs.io/en/latest/>`__.

Documentation
-------------

NSKinetic's `full documentation <https://nskinetics.readthedocs.io/en/latest/>`__ includes a staged tutorial, starting from a minimal model and building up to a full process/TEA-coupled fed-batch fermentation. The interactive quickstart demo below runs that full picture end to end.

One factory call builds a complete, industrially configured process around a real kinetic model: ``nskinetics.processes.create_sugar_prep_and_fermentation_system`` assembles the sugar-solution preparation and fed-batch fermentation section of an actual biorefinery model — a splitter feeding parallel initial-feed and spike-feed conditioning trains (multi-effect evaporator, pumps, dilution-water mixer, heat exchanger), a ``FermentationSaccharomycesEthanolIsobutanol`` fermentor driven by the shipped *S. cerevisiae* kinetic model, and a compressed-air aeration loop. The complete biorefinery built around this section ships with NSKinetics as the `isobutanol biorefinery demonstration <https://nskinetics.readthedocs.io/en/latest/case_studies/isobutanol/index.html>`__. This example runs the section end to end: build, simulate, change the fed-batch strategy, and inspect the reactor. Total simulation time is a few seconds once the imports are loaded; the ~1-minute interactive demo below plays through the whole thing, showing real output at every step:

.. figure:: docs/source/_static/images/examples/quickstart_demo_poster.png
   :width: 700
   :align: center
   :target: https://nskinetics.readthedocs.io/en/latest/_static/quickstart_demo.html
   :alt: Watch the NSKinetics quickstart run — a ~1-minute interactive demo

   ▶ `Watch the quickstart run end to end <https://nskinetics.readthedocs.io/en/latest/_static/quickstart_demo.html>`__ — a ~1-minute interactive demo (build, simulate, re-tune, inspect).

See the `full tutorial <https://nskinetics.readthedocs.io/en/latest/tutorial/index.html>`__ for the full walkthrough — writing and simulating a kinetic model from scratch, the ``Event``/``FeedSpike`` API used inside the fermentor, a tour of the shipped *S. cerevisiae* kinetic model, and the kinetics-to-biosteam bridge behind ``V406``.


Demonstration: isobutanol biorefinery
-------------------------------------

NSKinetics ships a complete corn dry-grind biorefinery as a demonstration, ``nskinetics.biorefineries.isobutanol``: a `BioSTEAM <https://biosteam.readthedocs.io/en/latest/>`__ flowsheet whose fermentor runs the shipped *S. cerevisiae* fed-batch model with an engineered isobutanol pathway, so titer, rate and yield are outputs of the strain kinetics and the feeding policy rather than inputs to the techno-economic analysis. It comes with ten scenarios (the wild-type ethanol plant, an engineered ethanol + isobutanol co-producer and eight strain-design optima), its TEA, and the scripts behind its feeding-strategy and kinetic sweeps, Bayesian strain-design optimization, objective-landscape, enzyme-burden (proteome allocation), global sensitivity and uncertainty analyses.

The demonstration needs NSKinetics 0.9.2 or later, the first release that ships ``nskinetics.biorefineries``; earlier releases do not include it. Until 0.9.2 is on PyPI, install it from source, with its optional ``isobutanol`` dependencies, and check the installation with a pinned smoke case (a few minutes):

.. code-block:: bash

    $ git clone https://github.com/sarangbhagwat/nskinetics
    $ cd nskinetics
    $ git checkout dev
    $ pip install -e ".[isobutanol]"
    $ python -m nskinetics.biorefineries.isobutanol.smoke 1

Once 0.9.2 is on PyPI, ``pip install "nskinetics[isobutanol]>=0.9.2"`` installs the same package and dependencies. `Running the analyses <https://nskinetics.readthedocs.io/en/latest/case_studies/isobutanol/running_analyses.html>`__ has the full installation instructions (including the validated dependency versions) and lists every analysis script, its runtime and its outputs; the `demonstration documentation <https://nskinetics.readthedocs.io/en/latest/case_studies/isobutanol/index.html>`__ presents the findings.

Figure code and data
~~~~~~~~~~~~~~~~~~~~

The code and data behind the figures of Bhagwat et al., 2026 are in two folders:

- `analyses/results/publication/ <https://github.com/sarangbhagwat/nskinetics/tree/main/nskinetics/biorefineries/isobutanol/analyses/results/publication>`__: one folder per figure (``Fig1``–``Fig6``, ``EDFig1``–``EDFig9``). Each holds the figure's plotting code (``code/``), a snapshot of its data (``data/``; the diagrams in ``Fig1``–``Fig3`` need none) and ``make_figure.py``, which redraws the figure from that snapshot without running any simulation.
- `analyses/ <https://github.com/sarangbhagwat/nskinetics/tree/main/nskinetics/biorefineries/isobutanol/analyses>`__: the scripts that simulate the biorefinery and generate those data, one subfolder per analysis:

  - ``feeding_strategies/``: sweep of the fed-batch glucose-feeding strategy.
  - ``kinetic_sweeps/``: 2-D sweeps of kinetic parameters (e.g. glycolysis capacity × ethanol inhibition) and a one-at-a-time sweep of every kinetic parameter.
  - ``kinetic_optimization/``: the Bayesian-optimization strain-design campaigns.
  - ``objective_landscape/``: 1-D sweeps of each decision variable through the best co-production design.
  - ``sensitivity/``: the Sobol'/Shapley global sensitivity analysis.
  - ``uncertainty/``: the Monte Carlo uncertainty analysis.
  - ``tea_breakdowns/``: per-unit-group equipment-cost, utility and operating-cost breakdowns of the optimized designs.
  - ``opt_scenarios/``: turns campaign optima into the reusable ``opt_*`` scenarios.


Bug reports
-----------

To report bugs, please use NSKinetics's Bug Tracker at:

    https://github.com/sarangbhagwat/nskinetics

Contributing
------------
For guidelines on how to contribute, visit:

    [link to be added]


License information
-------------------

See ``LICENSE.txt`` for information on the terms & conditions for usage
of this software, and a DISCLAIMER OF ALL WARRANTIES.

Although not required by the NSKinetics license, if it is convenient for you,
please cite NSKinetics if used in your work. Please also consider contributing
any changes you make back, and benefit the community.


About the authors
-----------------

NSKinetics was created and developed by `Sarang S. Bhagwat <https://github.com/sarangbhagwat>`__ as part of the `Scown Group <https://cscown.com/>`__ and the `Energy & Biosciences Institute <https://energybiosciencesinstitute.org/>`__ at the `University of California, Berkeley (UC Berkeley) <https://www.berkeley.edu/>`__. 


References
----------
.. [1] ` To be added <link to be added>`__.


