Skip to content

Commit 4554040

Browse files
authored
Merge pull request #36 from AllenNeuralDynamics/refactor-change-package-name
Change package name to `contraqctor`
2 parents 56e6030 + f6a38c9 commit 4554040

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+218
-163
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
run: uv run codespell --check-filenames
4444

4545
- name: pytest
46-
run: uv run pytest --cov aind_behavior_core_analysis
46+
run: uv run pytest --cov contraqctor
4747

4848
- name: Build
4949
run: uv build

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
# aind-behavior-core-analysis
2-
[![Documentation](https://tinyurl.com/bdd8prh7)](https://allenneuraldynamics.github.io/Aind.Behavior.CoreAnalysis/)
1+
[![contraqctor](./assets/logo-letter.svg)](https://allenneuraldynamics.github.io/contraqctor/)
2+
3+
[![Documentation](https://tinyurl.com/zf46ufwa)](https://allenneuraldynamics.github.io/Aind.Behavior.CoreAnalysis/)
34
![CI](https://github.com/AllenNeuralDynamics/Aind.Behavior.CoreAnalysis/actions/workflows/ci.yml/badge.svg)
4-
[![PyPI - Version](https://img.shields.io/pypi/v/aind-behavior-core-analysis)](https://pypi.org/project/aind-behavior-core-analysis/)
5+
[![PyPI - Version](https://img.shields.io/pypi/v/contraqctor)](https://pypi.org/project/contraqctor/)
56
[![License](https://img.shields.io/badge/license-MIT-brightgreen)](LICENSE)
67
[![ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
78
[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
89

9-
A repository with core primitives for analysis shared across all `Aind.Behavior` tasks.
10+
# contraqctor
1011

11-
This repository is part of a bigger infrastructure that is summarized [here](https://github.com/AllenNeuralDynamics/Aind.Behavior.Services).
12+
A repository for managing data contracts and quality control in behavioral datasets.
1213

1314
> ⚠️ **Caution:**
1415
> This repository is currently under active development and is subject to frequent changes. Features and APIs may evolve without prior notice.
@@ -24,7 +25,7 @@ pip install .
2425
Otherwise, you can use pip:
2526

2627
```bash
27-
pip install aind-behavior-core-analysis
28+
pip install contraqctor
2829
```
2930

3031
## Getting started and API usage
@@ -37,9 +38,9 @@ Data contracts provide a standard way to access and load data from various sourc
3738

3839
```python
3940
from pathlib import Path
40-
from aind_behavior_core_analysis.contract import Dataset, DataStreamCollection
41-
from aind_behavior_core_analysis.contract.csv import Csv
42-
from aind_behavior_core_analysis.contract.text import Text
41+
from contraqctor.contract import Dataset, DataStreamCollection
42+
from contraqctor.contract.csv import Csv
43+
from contraqctor.contract.text import Text
4344

4445
# Define the dataset structure
4546
dataset_root = Path("path/to/dataset")
@@ -84,7 +85,7 @@ my_dataset.load_all()
8485
The QC module helps validate your data to ensure it meets specific requirements:
8586

8687
```python
87-
import aind_behavior_core_analysis.qc as qc
88+
import contraqctor.qc as qc
8889

8990
# Using the dataset created above
9091
data_stream = my_dataset["Behavior"]["Position"]
@@ -114,7 +115,7 @@ runner.add_suite(MyCustomTestSuite(data_stream))
114115
results = runner.run_all_with_progress()
115116
```
116117

117-
For more detailed examples, please check the [Examples](./examples/) folder.
118+
For more detailed examples, please check the [Examples](examples) folder.
118119

119120
---
120121

assets/logo-letter.svg

Lines changed: 40 additions & 0 deletions
Loading

docs/_regenerate_api.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
"""
66

77
import logging
8+
import shutil
89
from pathlib import Path
910

1011
import yaml
1112

1213
# Constants
1314
ROOT_DIR = Path(__file__).parent.parent
14-
PACKAGE_NAME = "aind_behavior_core_analysis"
15+
PACKAGE_NAME = "contraqctor"
1516
SRC_DIR = ROOT_DIR / "src" / f"{PACKAGE_NAME}"
1617
DOCS_DIR = ROOT_DIR / "docs"
1718
API_DIR = DOCS_DIR / "api"
@@ -20,12 +21,29 @@
2021

2122
# Leaving this manual for now.
2223
DOCUMENTED_MODULES = ["contract", "qc"]
23-
24+
TO_COPY = ["assets", "examples", "LICENSE"]
2425
log = logging.getLogger("mkdocs")
2526

2627

2728
def on_pre_build(config):
2829
"""Mkdocs pre-build hook."""
30+
for file_or_dir in TO_COPY:
31+
src = ROOT_DIR / file_or_dir
32+
dest = DOCS_DIR / file_or_dir
33+
if src.exists():
34+
log.info(f"Copying {file_or_dir} to docs...")
35+
36+
if src.is_file():
37+
print(f"Copying file {src} to {dest}")
38+
shutil.copy(src, dest)
39+
else:
40+
if dest.exists():
41+
shutil.rmtree(dest)
42+
shutil.copytree(src, dest)
43+
log.info(f"{file_or_dir} copied successfully.")
44+
else:
45+
log.warning(f"Source: {file_or_dir} not found, skipping.")
46+
2947
main()
3048

3149

docs/api/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# API Reference
22

3-
The `aind-behavior-core-analysis` package provides core primitives and utilities for behavioral data analysis.
3+
The `contraqctor` package provides core primitives and utilities for behavioral data analysis.
44

55
## Modules
66

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contract Examples
22

3-
This page demonstrates how to use the Contract module in AIND Behavior Core Analysis.
3+
This page demonstrates how to use the Contract module.
44

55
## Example Code
66

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Quality Control Examples
22

3-
This page demonstrates how to use the Quality Control (QC) module in AIND Behavior Core Analysis.
3+
This page demonstrates how to use the Quality Control (qc) module.
44

55
## Example Code
66

docs/favicon.ico

-250 KB
Binary file not shown.

docs/logo.svg

Lines changed: 9 additions & 9 deletions
Loading

examples/contract.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
from aind_behavior_services.session import AindBehaviorSessionModel
55
from aind_behavior_services.task_logic import AindBehaviorTaskLogicModel
66

7-
from aind_behavior_core_analysis.contract import Dataset, DataStreamCollection
8-
from aind_behavior_core_analysis.contract.camera import Camera
9-
from aind_behavior_core_analysis.contract.csv import Csv
10-
from aind_behavior_core_analysis.contract.harp import (
7+
from contraqctor.contract import Dataset, DataStreamCollection
8+
from contraqctor.contract.camera import Camera
9+
from contraqctor.contract.csv import Csv
10+
from contraqctor.contract.harp import (
1111
DeviceYmlByFile,
1212
HarpDevice,
1313
)
14-
from aind_behavior_core_analysis.contract.json import PydanticModel, SoftwareEvents
15-
from aind_behavior_core_analysis.contract.mux import MapFromPaths
16-
from aind_behavior_core_analysis.contract.text import Text
17-
from aind_behavior_core_analysis.contract.utils import print_data_stream_tree
14+
from contraqctor.contract.json import PydanticModel, SoftwareEvents
15+
from contraqctor.contract.mux import MapFromPaths
16+
from contraqctor.contract.text import Text
17+
from contraqctor.contract.utils import print_data_stream_tree
1818

1919
dataset_root = Path(r"path_to_data")
2020
my_dataset = Dataset(

0 commit comments

Comments
 (0)