{"id":28174232,"url":"https://github.com/blakeaw/galibrate","last_synced_at":"2025-05-15T22:15:57.884Z","repository":{"id":57432949,"uuid":"197295657","full_name":"blakeaw/GAlibrate","owner":"blakeaw","description":"Parameter estimation and model calibration using Genetic Algorithm optimization in Python.","archived":false,"fork":false,"pushed_at":"2024-08-16T18:31:08.000Z","size":405,"stargazers_count":12,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-11T18:16:02.445Z","etag":null,"topics":["genetic-algorithm","model-calibration","optimization","optimizer","parameter-estimation","pysb","python3","systems-biology"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blakeaw.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"ko_fi":"blakeaw"}},"created_at":"2019-07-17T01:55:31.000Z","updated_at":"2024-11-24T09:43:26.000Z","dependencies_parsed_at":"2024-08-16T19:59:17.659Z","dependency_job_id":null,"html_url":"https://github.com/blakeaw/GAlibrate","commit_stats":{"total_commits":63,"total_committers":2,"mean_commits":31.5,"dds":"0.015873015873015928","last_synced_commit":"3ecfd29245cebaaa12083a378e0834ee3a495c23"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blakeaw%2FGAlibrate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blakeaw%2FGAlibrate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blakeaw%2FGAlibrate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blakeaw%2FGAlibrate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blakeaw","download_url":"https://codeload.github.com/blakeaw/GAlibrate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254430317,"owners_count":22069909,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["genetic-algorithm","model-calibration","optimization","optimizer","parameter-estimation","pysb","python3","systems-biology"],"created_at":"2025-05-15T22:15:36.093Z","updated_at":"2025-05-15T22:15:57.874Z","avatar_url":"https://github.com/blakeaw.png","language":"Jupyter Notebook","readme":"# GAlibrate\n\n![Python version badge](https://img.shields.io/badge/python-3.10.11-blue.svg)\n[![license](https://img.shields.io/github/license/blakeaw/GAlibrate.svg)](LICENSE)\n![version](https://img.shields.io/badge/version-0.7.2-orange.svg)\n[![release](https://img.shields.io/github/release-pre/blakeaw/GAlibrate.svg)](https://github.com/blakeaw/GAlibrate/releases/tag/v0.7.2)\n[![anaconda cloud](https://anaconda.org/blakeaw/galibrate/badges/version.svg)](https://anaconda.org/blakeaw/galibrate)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/6cdd91c06b11458384becb85db9adb15)](https://app.codacy.com/gh/blakeaw/GAlibrate/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n![Static Badge](https://img.shields.io/badge/coverage-63%25-yellow)\n[![DOI](https://zenodo.org/badge/197295657.svg)](https://zenodo.org/badge/latestdoi/197295657)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"200\" height=\"200\" src=\"./images/GAlibrate_logo.png\"\u003e\n\u003c/p\u003e\n\n**GAlibrate** is a python toolkit that provides an easy to use interface for model calibration/parameter estimation using an implementation of continuous genetic algorithm-based optimization. Its functionality and API were designed to be familiar to users of the [PyDREAM](https://github.com/LoLab-VU/PyDREAM), [simplePSO](https://github.com/LoLab-VU/ParticleSwarmOptimization), and [Gleipnir](https://github.com/LoLab-VU/Gleipnir) packages.\n\nAlthough **GAlibrate** provides a general framework for running continuous\ngenetic algorithm-based optimizations, it was created with systems biology models in mind. It therefore supplies additional tools for working with biological models in the [PySB](http://pysb.org/) format.\n\n### What's new in\n\n#### version 0.7.0\n * Julia integration - New version of core GA that ports some key funtions to Julia using the PyJulia package.\n * New `benchmarks` module defining a set of functions used to benchmark and test single objective optimazation routines.  \n * Test suite using pytest with 63% overall coverage.\n * Updated profiling and performance benchmarking Jupyter [notebooks](./notebooks/).\n * Function to resume/continue GAO runs for additional generations: `GAO.resume`.\n * Several new example cases under [examples](./examples/)\n\n#### version 0.6.0\n * core GA now returns an array with fitness value of the fittest individual from each generation which can be accessed from the GAO property `GAO.best_fitness_per_generation`.\n * Bug fix in core GA for sorting the population before selection and mating.\n\n#### version 0.5.0\n * Optional progress bar to monitor passage of generations during GAO run that is only displayed if [tqdm](https://github.com/tqdm/tqdm) is installed  \n * Optional [multiprocessing](https://docs.python.org/2/library/multiprocessing.html) based parallelism when evaluating the fitness function over the population during a GAO run.  \n\n## Table of Contents\n\n 1. [Install](#install)\n     1. [pip install](#pip-install)\n     2. [conda install](#conda-install)\n     3. [Recomended additional software](#recomended-additional-software)\n 2. [License](#license)\n 3. [Change Log](#change-log)\n 4. [Documentation and Usage](#documentation-and-usage)\n     1. [Quick Overview](#quick-overview)\n     2. [Examples](#examples)\n 5. [Contact](#contact)  \n\n------\n\n# Install\n\n| **! Note** |\n| :--- |\n|  GAlibrate is still in version zero development so new versions may not be backwards compatible. |\n\n**GAlibrate** installs as the `galibrate` package. It is compatible (i.e., tested) with Python 3.10.11.\n\nNote that `galibrate` has the following core dependencies:\n   * [NumPy](http://www.numpy.org/)\n   * [SciPy](https://www.scipy.org/)\n\n### pip install\nYou can install the latest release of the `galibrate` package using `pip` sourced from the GitHub repo - \n\n**Fresh install:**\n```\npip install https://github.com/blakeaw/GAlibrate/archive/refs/tags/v0.7.2.zip\n```\n**Or to upgrade from an older version:**\n```\npip install --upgrade https://github.com/blakeaw/GAlibrate/archive/refs/tags/v0.7.2.zip\n```\n\n### PyPI\n\n`galibrate` can also be `pip` installed from PyPI,\n```\npip install galibrate\n```\nbut this version currently doesn't include the Cython accelerated version of the core GA algorithm.\n\n### conda\n\nYou can install the `galibrate` package from the `blakeaw` channel:\n```\nconda install -c blakeaw galibrate\n```\nNumPy and SciPy dependencies will be automatically installed with this version.\n\n### Recommended additional software\n\nThe following software is not required for the basic operation of **GAlibrate**, but provides extra capabilities and features when installed.\n\n#### Cython\n**GAlibrate** includes an implementation of the core genetic algorithm that is written in   [Cython](https://cython.org/), which takes advantage of Cython-based optimizations and compilation to accelerate the algorithm. This version of genetic algorithm is used if Cython is installed.\n\n#### Numba\n**GAlibrate** also includes an implementation of the core genetic algorithm that takes advantage of [Numba](https://numba.pydata.org/)-based JIT compilation and optimization to accelerate the algorithm. This version of genetic algorithm is used if Numba is installed.\n\n#### Julia\n**GAlibrate** also includes an implementation of the core genetic algorithm that takes advantage of porting some key functions to [Julia](https://julialang.org/) for JIT compilation and optimization to accelerate the algorithm. This version of genetic algorithm requires [Julia](https://julialang.org/) and [PyJulia](https://pyjulia.readthedocs.io/en/latest/); note that the Python-based CLI tool [jill](https://pypi.org/project/jill/) is also an option for automating the process of downloading and installing Julia.\n\n#### tqdm\nGAO runs will display a progress bar that tracks the passage of generations when the [tqdm](https://github.com/tqdm/tqdm) package installed.  \n\n#### PySB\n[PySB](http://pysb.org/) is needed to run PySB models, and it is therfore needed if you want to use tools from the `galibrate.pysb`` package.\n\n------\n\n### Testing\n\nTests and coverage analysis use \n  \n  * [pytest](https://docs.pytest.org/en/stable/) (`pytest=7.4.0`)\n  * [Coverage.py](https://coverage.readthedocs.io/en/7.6.0/) (`coverage=7.2.2`)\n\nRunning locally from the GAlibrate repo folder:\n```\ncoverage run -m pytest\n```\nthen to see coverage report:\n```\ncoverage report -m\n```\n\n# License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n\n------\n\n# Change Log\n\nSee: [CHANGELOG](CHANGELOG.md)\n\n------\n\n# Documentation and Usage\n\n### Quick Overview\nPrincipally, **GAlibrate** defines the **GAO** (continuous **G**enetic **A**lgorithm-based **O**ptimizer ) class,\n```python\nfrom galibrate import GAO\n```\nwhich defines an object that can be used setup and run a continuous genetic algorithm-based optimization (i.e., a maximization) of a user-defined fitness function over the search space of a given set of (model) parameters.\n\n#### multiprocessing-based parallelism\nThe multiprocessing-based parallelism (single node) can be invoked by passing the keyword argument `nprocs` with a value greater than one when calling the `GAO.run` function; for example, `gao.run(nprocs=2)` will use two processes. A full example is provided in [this script](./examples/pysb_dimerization_model/galibrate_dimerization_model_parallel.py).\n\nParallelism is used when evaluating the fitness function across the population (whole population during initialization and half the population during subsequent generations). You can expect the most parallel speedup when the fitness function is expensive to evaluate, such as when evaluating a PySB model. You may also get speedup when the population is very large, depending on how expensive the fitness function is to evaluate. Note however, that if the fitness function is fast to evaluate then the parallel overhead may actually slow down the run.\n\n#### PySB models\n\nAdditionally, **GAlibrate** has a `pysb` sub-package that provides the\n`galibrate_it` module, which defines the GaoIt and GAlibrateIt classes (importable from the `galibrate.pysb` package level),\n```python\nfrom galibrate.pysb import GaoIt, GAlibrateIt\n```  \nwhich create objects that abstract away some of the effort to setup and generate GAO instances for PySB models; [examples/pysb_dimerization_model](./examples/pysb_dimerization_model) provides some\nexamples for using GaoIt and GAlibrateIt objects. The `galibrate_it` module can also be called from the command line to generate a template run script for a PySB model,\n\n```python\npython -m galibrate.pysb_utils.galibrate_it pysb_model.py output_path\n```\n\nwhich users can then modify to fit their needs.\n\n### Examples\n\nAdditional example scripts that show how to setup and launch Genetic Algorithm runs using **GAlibrate** can be found under [examples](./examples).   \n\n------\n\n# Contact\n\n### For Support\n\nEmail support inquiries to [blakeaw1102@gmail.com](mailto:blakeaw1102@gmail.com)\n\n### Interested in contributing\n\nSee [CONTRIBUTING](./CONTRIBUTING.md)\n\n------\n","funding_links":["https://ko-fi.com/blakeaw"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblakeaw%2Fgalibrate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblakeaw%2Fgalibrate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblakeaw%2Fgalibrate/lists"}