Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…n_mecha into dev
  • Loading branch information
JaerongA committed Nov 28, 2023
2 parents 18812e8 + d3588d3 commit 03184c0
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 55 deletions.
8 changes: 8 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cff-version: 1.0.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Sainsbury Wellcome Centre Foraging Behaviour Working Group"
title: "Aeon: An open-source platform to study the neural basis of ethological behaviours over naturalistic timescales"
doi: 10.5281/zenodo.8413142
date-released: 2023-10-05
url: https://github.com/SainsburyWellcomeCentre/aeon_docs
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,12 @@ Ensure you stay in the `~/ProjectAeon/aeon_mecha` directory for the rest of the
- `docs/using_online_dashboard.md` : Instructions for connecting to Aeon's online dashboard
- `env_config/` : Configuration files for the Aeon Python environment
- `tests/` : Unit and integration tests
- `tests/data` : Data used by tests
- `tests/data` : Data used by tests

## Citation Policy

If you use this software, please cite it as below:

Sainsbury Wellcome Centre Foraging Behaviour Working Group. (2023). Aeon: An open-source platform to study the neural basis of ethological behaviours over naturalistic timescales, https://doi.org/10.5281/zenodo.8413142

[![DOI](https://zenodo.org/badge/485512362.svg)](https://zenodo.org/badge/latestdoi/485512362)
2 changes: 1 addition & 1 deletion aeon/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from importlib_metadata import PackageNotFoundError, version
from importlib.metadata import PackageNotFoundError, version

try:
# Change here if project is renamed and does not equal the package name
Expand Down
19 changes: 1 addition & 18 deletions aeon/schema/social.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,9 @@ def read(
"""Reads data from the Harp-binarized tracking file."""
# Get config file from `file`, then bodyparts from config file.
model_dir = Path(file.stem.replace("_", "/")).parent
<<<<<<< HEAD
config_file_dir = ceph_proc_dir / model_dir
if not config_file_dir.exists():
raise FileNotFoundError(f"Cannot find model dir {config_file_dir}")
=======
# `ceph_proc_dir` typically
config_file_dir = Path(ceph_proc_dir) / model_dir
assert config_file_dir.exists(), f"Cannot find model dir {config_file_dir}"
>>>>>>> b9a1e3f... Blackened and ruffed
config_file = get_config_file(config_file_dir)
parts = self.get_bodyparts(config_file)

Expand All @@ -52,7 +46,6 @@ def read(
self.columns = columns
data = super().read(file)

<<<<<<< HEAD
# Drop any repeat parts.
unique_parts, unique_idxs = np.unique(parts, return_index=True)
repeat_idxs = np.setdiff1d(np.arange(len(parts)), unique_idxs)
Expand All @@ -63,8 +56,6 @@ def read(
data = data.iloc[:, keep_part_col_idxs]
parts = unique_parts

=======
>>>>>>> b9a1e3f... Blackened and ruffed
# Set new columns, and reformat `data`.
n_parts = len(parts)
part_data_list = [pd.DataFrame()] * n_parts
Expand Down Expand Up @@ -102,21 +93,13 @@ def get_config_file(
"""Returns the config file from a model's config directory."""
if config_file_names is None:
config_file_names = ["confmap_config.json"] # SLEAP (add for other trackers to this list)
<<<<<<< HEAD
config_file = None
=======
config_file = Path()
>>>>>>> b9a1e3f... Blackened and ruffed
for f in config_file_names:
if (config_file_dir / f).exists():
config_file = config_file_dir / f
break
<<<<<<< HEAD
if config_file is None:
raise FileNotFoundError(f"Cannot find config file in {config_file_dir}")
=======
assert config_file.is_file(), f"Cannot find config file in {config_file_dir}"
>>>>>>> b9a1e3f... Blackened and ruffed
raise FileNotFoundError(f"Cannot find config file in {config_file_dir}")
return config_file


Expand Down
2 changes: 1 addition & 1 deletion docs/env_setup/remote/miniconda_conda_remote_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ conda env update -f env_config/env_dev.yml
- `conda activate aeon`: activates the virtual environment; any commands now run within this terminal will take place within the virtual environment.
- `conda deactivate aeon`: deactivates the virtual environment.
4. (Optional) Add commands to the `.profile` file to add miniconda as an environment module and Bonsai and its dependencies to your system path on startup (this will be initialized each time you SSH into the HPC).
- Copy the commands in the `.profile_example` file in this folder to your HPC home directory `.profile` file.
- Copy the commands in the `.profile_example` file in this folder to your HPC home directory `.profile` file (you will have to create this file if it doesn't already exist).
5. For instructions on developing within the `aeon` environment, see [`developing_on_hpc.md`](./developing_on_hpc.md)
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ dependencies = [
"dotmap",
"fastparquet",
"graphviz",
"importlib_metadata",
"ipykernel",
"jupyter",
"jupyterlab",
Expand Down
33 changes: 0 additions & 33 deletions tests/io/test_api.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
<<<<<<< HEAD
from pathlib import Path

=======
>>>>>>> b9a1e3f... Blackened and ruffed
import pandas as pd
import pytest
from pytest import mark

<<<<<<< HEAD
import aeon
from aeon.schema.dataset import exp02

Expand All @@ -18,63 +14,34 @@
@mark.api
def test_load_start_only():
data = aeon.load(nonmonotonic_path, exp02.Patch2.Encoder, start=pd.Timestamp("2022-06-06T13:00:49"))
=======
import aeon.io.api as aeon
from aeon.schema.dataset import exp02


@mark.api
def test_load_start_only():
data = aeon.load(
"./tests/data/nonmonotonic", exp02.Patch2.Encoder, start=pd.Timestamp("2022-06-06T13:00:49")
)
>>>>>>> b9a1e3f... Blackened and ruffed
assert len(data) > 0


@mark.api
def test_load_end_only():
data = aeon.load(
<<<<<<< HEAD
nonmonotonic_path, exp02.Patch2.Encoder, end=pd.Timestamp("2022-06-06T13:00:49")
=======
"./tests/data/nonmonotonic", exp02.Patch2.Encoder, end=pd.Timestamp("2022-06-06T13:00:49")
>>>>>>> b9a1e3f... Blackened and ruffed
)
assert len(data) > 0


@mark.api
def test_load_filter_nonchunked():
<<<<<<< HEAD
data = aeon.load(
nonmonotonic_path, exp02.Metadata, start=pd.Timestamp("2022-06-06T09:00:00")
)
=======
data = aeon.load("./tests/data/nonmonotonic", exp02.Metadata, start=pd.Timestamp("2022-06-06T09:00:00"))
>>>>>>> b9a1e3f... Blackened and ruffed
assert len(data) > 0


@mark.api
def test_load_monotonic():
<<<<<<< HEAD
data = aeon.load(monotonic_path, exp02.Patch2.Encoder)
assert len(data) > 0 and data.index.is_monotonic_increasing

=======
data = aeon.load("./tests/data/monotonic", exp02.Patch2.Encoder)
assert data.index.is_monotonic_increasing
>>>>>>> b9a1e3f... Blackened and ruffed


@mark.api
def test_load_nonmonotonic():
<<<<<<< HEAD
data = aeon.load(nonmonotonic_path, exp02.Patch2.Encoder)
=======
data = aeon.load("./tests/data/nonmonotonic", exp02.Patch2.Encoder)
>>>>>>> b9a1e3f... Blackened and ruffed
assert not data.index.is_monotonic_increasing


Expand Down

0 comments on commit 03184c0

Please sign in to comment.