Skip to main content

For analysing circadian activity data

Project description

Main build

Development build

CircaPy

CircaPy is a python module for circadian analysis of activity data. It was developed using laboratory rodents data but is applicable across species and monitoring devices.

A limited version is available as an interactive website

Getting Started

Install circapy from pip

pip install circapy

This will install circaPy in your current python environment. Package dependencies are listed in the pyproject.toml file

Using circaPy

circaPy provides a set of functions to analyse and plot the most common methods of circadian analysis.

Create some test data

import pandas as pd
import numpy as np
import circaPy.activity as act

# Create a sample dataset with time-series activity data
index = pd.date_range(start='2024-01-01', periods=86400, freq="10s")
values = np.random.randint(0, 100, size=(len(index),2))

df = pd.DataFrame(values, index=index)

Calculate IV

# Use circaPy's calculate_IV function to compute Interdaily Variability
iv = act.calculate_IV(df)

# Print the result
print(f"Interdaily Variability (IV). Col 0: {iv[0]:.4f}")

Plot actogram

# Use circaPy plot_actogram
import circaPy.plots as cpp

cpp.plot_actogram(df, showfig=True)

Contributing

  1. Fork this repository
  2. Create branch git checkout -b <branch-name>
  3. Create uv environment uv sync
  4. Use uv to run test suite with make test
  5. Make your changes and commit them git commit -m <commit-message>
  6. PR back to the development branch
    • ensure tests are passing, will be required to merge into development branch.

Authors

Licence

  • Available under GNU general public licence

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

circapy-0.1.6.dev1.tar.gz (124.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

circapy-0.1.6.dev1-py3-none-any.whl (36.1 kB view details)

Uploaded Python 3

File details

Details for the file circapy-0.1.6.dev1.tar.gz.

File metadata

  • Download URL: circapy-0.1.6.dev1.tar.gz
  • Upload date:
  • Size: 124.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for circapy-0.1.6.dev1.tar.gz
Algorithm Hash digest
SHA256 1f73d8b87ffa809e381c6cf22db151dbee9d3832c592891edce55c17021a74cf
MD5 1fb9e99879c93e7618b37c33f56efb20
BLAKE2b-256 927947efb91c88cb8d8d7eb84c265e92564d109c2f5eb256008aa7fd433a269f

See more details on using hashes here.

File details

Details for the file circapy-0.1.6.dev1-py3-none-any.whl.

File metadata

  • Download URL: circapy-0.1.6.dev1-py3-none-any.whl
  • Upload date:
  • Size: 36.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for circapy-0.1.6.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 4fe16348867cbc894ed495ab37135b8d7509d917f4f17f68f2286eca6d9e2cc4
MD5 ac17165c31ea0d39755a5c2c0c71e361
BLAKE2b-256 bda0197c024071a6008931f678eaa3c1229d9c5ba53bf5eb79dd4323a289a6a5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page