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.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-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: circapy-0.1.6.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.tar.gz
Algorithm Hash digest
SHA256 ac9e51b1f45aed40f4917c3f5cf5f08432058fad34b44d7a08748f7e5781fbf6
MD5 f5f486f21988f8560cddca77c042ed8a
BLAKE2b-256 2a4db4c12b877feae1bac4fbf0403d50d9034ef218eb49745bb936666c80e934

See more details on using hashes here.

File details

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

File metadata

  • Download URL: circapy-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 36.0 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-py3-none-any.whl
Algorithm Hash digest
SHA256 b9b417a14ed0e94eab8e3350c6dc41de3ed121300d51e00874033bf9d52dd915
MD5 de31b6e260cbe1ec29d0dcd2dc37d654
BLAKE2b-256 ce3f87b81b881338109e5b4225f47d5bafa991715ed45ef63cfdac3dd2cdc3f2

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