Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/danielvartan/entrainment

☀️⏳ Rule-based model of the 24h light/dark cycle entrainment phenomenon
https://github.com/danielvartan/entrainment

chronobiology chronotype complex-systems entrainment model python

Last synced: about 1 month ago
JSON representation

☀️⏳ Rule-based model of the 24h light/dark cycle entrainment phenomenon

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r}
#| label = "setup",
#| include = FALSE

knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "docs/source/_static/readme_",
out.width = "100%"
)
```

# entrainment

[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
[![Documentation Status](https://readthedocs.org/projects/entrainment/badge/?version=latest)](https://entrainment.readthedocs.io/en/latest/?badge=latest)
[![License: MIT](https://img.shields.io/badge/license-MIT-green)](https://choosealicense.com/licenses/mit/)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](https://www.contributor-covenant.org/version/2/1/code_of_conduct/)

## Overview

`entrainment` is a rule-based model created on Python to test and to demonstrate the 24h light/dark cycle [entrainment phenomenon](https://en.wikipedia.org/wiki/Entrainment_(chronobiology)).

## Prerequisites

You need to have some familiarity with the [Python programming language](https://www.python.org/) to use `entrainment` main functions.

In case you don't feel comfortable with Python, we strongly recommend checking Jake VanderPlas free and online book [Python Data Science Handbook](https://jakevdp.github.io/PythonDataScienceHandbook/) and the Coursera course from Google [Crash Course on Python](https://www.coursera.org/learn/python-crash-course) (free for audit students).

## Installation

You can install `entrainment` from GitHub with:

```bash
pip install git+https://github.com/giperbio/entrainment.git#egg=entrainment
```

We don't intend to publish this package on [PyPI](https://pypi.org/).

## Usage

The following example illustrates how to run the model.

Please note that in this example all of the model arguments are assigned. You don't need to assign values to all arguments, you can just use the default values. Check [`run_model()`](https://entrainment.readthedocs.io/en/latest/reference.html#entrainment.run_model) documentation to learn more.

```{python}
#| label = "setup-python",
#| include = FALSE

import numpy as np

np.random.seed(1000)
```

```{python}
#| label = "usage-example",
#| results = FALSE,
#| fig.alt = "24h light/dark cycle entrainment of a population located at the south of Brazil by season"

import entrainment

model = entrainment.run_model(
n = 10**3, # Number of subjects/turtles to create
tau_range = (23.5, 24.6), # Limits for assigning 'Tau' values
tau_mean = 24.15, # Mean value for the 'Tau' distribution
tau_sd = 0.2, # Standard deviation value for the 'Tau' distribution
k_range = (0.001, 0.01), # Limits for assigning the 'k' values
k_mean = 0.001, # Mean value for the 'k' distribution
k_sd = 0.005, # Standard deviation value for the 'k' distribution
lam_c = 3750, # Critical 'lambda' value
labren_id = 1, # LABREN id of the global horizontal irradiation means
by = "season", # Series resolution (choices: "month", "season", "year")
n_cycles = 3, # Number of cycles to run
start_at = 0, # Index number indicating the start of the series
repetitions = 10**2, # Number of repetitions
plot = True, # Activate or deactivate the plot output
show_progress = True # Activate or deactivate verbose mode
)
```

You can learn more about the available functions going to the [package documentation website](https://entrainment.readthedocs.io).

## Citation

If you use `entrainment` in your research, please consider citing it. We put a lot of work to build and maintain a free and open-source Python package. You can find the citation below.

```
Vartanian, D. (2023). {entrainment}: rule-based model of the 24h light/dark cycle entrainment phenomenon. Python package version 0.0.0.9000. https://github.com/giperbio/entrainment
```

A BibTeX entry for LaTeX users is

```
@Unpublished{,
title = {{entrainment}: rule-based model of the 24h light/dark cycle entrainment phenomenon},
author = {Daniel Vartanian},
year = {2023},
url = {https://github.com/giperbio/entrainment},
note = {Python package version 0.0.0.9000},
}
```

## Contributing

We welcome contributions, including bug reports.

Take a moment to review our [Guidelines for Contributing](https://entrainment.readthedocs.io/en/latest/contributing.html).

## Acknowledgments

The initial development of `entrainment` was supported by a scholarship provided by the [University of Sao Paulo (USP)](http://usp.br/) (❤️).

This model was initially created for the [SCX5002 - Complex System I](https://uspdigital.usp.br/janus/Disciplina?tipo=D&sgldis=SCX5002&nomdis=&origem=C) class of the [Graduate Program in Modeling Complex Systems (PPG-SCX)](https://www.prpg.usp.br/pt-br/faca-pos-na-usp/programas-de-pos-graduacao/621-modelagem-de-sistemas-complexos) of the [University of Sao Paulo (USP)](https://www5.usp.br/), under the guidance of [Prof. Dr. Camilo Rodrigues Neto](https://orcid.org/0000-0001-6783-6695).


Become an `entrainment` supporter!

Click [here](https://github.com/sponsors/danielvartan) to make a donation. Please indicate the `entrainment` package in your donation message.