semvec/pypi-packages huggingface dataset:
GeKiM 0.5.8
Generalized Kinetic Modeler: A Python package for modeling arbitrary kinetic schemes.
Requires Python: >=3.9

# GeKiM (Generalized Kinetic Modeler)

## Description
GeKiM (Generalized Kinetic Modeler) is a Python package designed for creating, interpreting, and modeling arbitrary kinetic schemes. Schemes are defined by the user in a dictionary of species and transitions, which is used to initialize an instance of the NState class. Choose (or make) and initialize a simulator for the instance and run it. Field-specific practices are found in gekim/fields.

## Installation
With pip:
```bash
pip install gekim
```

Or directly from the source code (recommended):
```bash
git clone https://github.com/kghaby/GeKiM.git
cd GeKiM
pip install .
```

## Usage
Here is a basic example of how to use GeKiM to create and simulate a kinetic system:
```python
import gekim as gk
from gekim.fields.bio.enzyme.inhib import irrev as ii 

# Define your kinetic scheme in a configuration dictionary
concI0,concE0 = 100,1
scheme = {
    'species': {
        "I": {"y0": concI0, "label": "I"},
        "E": {"y0": concE0, "label": "E"},
        "EI": {"y0": 0, "label": "EI"},
    },    
    'transitions': {
        "kon": {"k": 0.01, "source": ["2E","I"], "target": ["EI"]},
        "koff": {"k": 0.1, "source": ["EI"], "target": ["2E","I"]},
    }
}

# Initialize a system with your schematic dictionary
system = gk.schemes.NState(scheme,quiet=False)

# Choose a simulator and go. In this example we're doing a deterministic 
# simulation of the concentrations of each species over time.
# Note that `system.simulator() = gk.simulators.ODESolver(system)` may be more doc-hint friendly
system.set_simulator(gk.simulators.ODESolver)
system.simulator.simulate() 

# Fit the data to experimental models to extract mock-experimental measurements
final_state = system.species["EI"].simout["y"]
all_bound = system.sum_species_simout(blacklist=["E","I"])

fit_output = ii.kobs_uplim_fit_to_occ_final_wrt_t(
    t,final_state,nondefault_params={"Etot":{"value":concE0,"vary":False}})

```
For more detailed examples, please refer to the examples directory.

## Documentation
Documentation and example notebook(s) are pending.

## Contributing
If you have suggestions or want to contribute code, please feel free to open an issue or a pull request.

## License
GeKiM is licensed under the GPL-3.0.

## Contact
kyleghaby@gmail.com
puffpastry 0.0.3
puffpastry - lightweight dependency injection for Python
Requires Python: >=3.8

[![CircleCI](https://dl.circleci.com/status-badge/img/gh/adamhadani/puffpastry/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/adamhadani/puffpastry/tree/main)

# :bread: puffpastry

A lightweight, intuitive, Pythonic dependency injection framework.

Highlights:

* :mushroom: Micro framework with very little overhead - single file implementation and handful of public API methods, minimal third-party package requirements.
* :full_moon: Unit-tests cover all core functionality, [ruff](https://docs.astral.sh/ruff/) and [pre-commit](https://pre-commit.com/) used to ensure codebase health.
* :snake: Compliant with latest Python 3.x version

## Getting Started

To install from PyPI, use pip:

    pip install puffpastry

The following example shows bootstrapping a webapp using fastapi with configuration read from environment (or from `.env` file, as we use [python-dotenv](https://github.com/theskumar/python-dotenv) under the hood). Of course, for such a minimal one-file implementation, dependency injection seems superfluous; but for larger codebases spread across multiple files this is a great way to manage dependencies and configuration.

```python
from fastapi import FastAPI
from puffpastry import create, provides
from requests import get


class IpifyClient:
    def __init__(self, base_url):
        self.base_url = base_url

    def ipv4(self):
        return get(self.base_url).content.decode("utf8")


@provides("fastapi")
def fastapi_provider(app):
    return FastAPI()


@provides("ipify_client")
def ipify_client(app):
    # The base url will be read from IPIFY_BASE_URL env variable or .env file.
    # To run this example set this value to 'https://api.ipify.org'
    return IpifyClient(base_url=app.config.ipify_base_url)


@provides("home_route")
def home_route_provider(app):
    @app.fastapi.get("/")
    def home():
        public_ip = app.ipify_client.ipv4()

        return {"message": f"your public IP is {public_ip}"}


def create_app():
    return create("my_app").load("fastapi", "ipify_client", "home_route")


app = create_app().fastapi
```

you can run this example with the fastapi CLI, assuming you saved the file as `app.py`:

    fastapi dev app.py

See examples/ for more usage examples.