Skip to content

Commit

Permalink
Merge pull request #256 from SainsburyWellcomeCentre/update_docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jkbhagatio committed Oct 4, 2023
1 parent 6ff8a09 commit fd58b73
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 51 deletions.
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)
32 changes: 0 additions & 32 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,28 +14,13 @@
@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

Expand All @@ -50,31 +31,18 @@ def test_load_filter_nonchunked():
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 fd58b73

Please sign in to comment.