Skip to content

Commit 3af928a

Browse files
Update README with Git LFS, fix local relative paths (#112)
* fix: Using a relative path via UV results in an error finding files * doc: Add explicit Git LFS instruction * fix: Fix CLI getsubject directories test
1 parent f716fec commit 3af928a

3 files changed

Lines changed: 15 additions & 9 deletions

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ Replace `/local/path/to/data` with the path to your input data directory (i.e.,
3131

3232
All the steps below will consider that you cloned this GitHub repository inside your Documents folder.
3333
There is an examplar raw data under `paper/data/raw` and a processed version using GGIR 3.2-6 under `paper/data/ggir_outputs`.
34+
If you wish to use this data, be aware that it's stored via Git LFS, so you'll have to run the following commands to download it.
35+
36+
```bash
37+
git clone https://github.com/childmindresearch/actisleep-tracker.git
38+
cd actisleep-tracker
39+
git lfs install
40+
git lfs pull
41+
```
3442

3543
After cloning this repository or processing your actigraphy data with GGIR, you should have a folder structure similar to:
3644

src/actigraphy/core/cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ def get_subject_folders(args: argparse.Namespace) -> list[str]:
5050
Returns:
5151
list[str]: A list of subject folders sorted by name.
5252
"""
53-
input_datapath = args.input_folder
53+
input_datapath = pathlib.Path(args.input_folder)
54+
if not input_datapath.is_absolute():
55+
input_datapath = pathlib.Path.cwd() / input_datapath
5456
return [
5557
str(directory)
5658
for directory in sorted(input_datapath.glob("output_*"))

tests/unit/test_cli.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,14 @@ def test_parse_args(mocker: plugin.MockerFixture) -> None:
2626
assert args.verbosity == logging.INFO
2727

2828

29-
def test_get_subject_folders(mocker: plugin.MockerFixture) -> None:
29+
def test_get_subject_folders(tmp_path: pathlib.Path) -> None:
3030
"""Test that get_subject_folders finds all output_ directories."""
31-
mocked_path = mocker.MagicMock()
32-
mocked_subfolder = mocker.MagicMock()
33-
mocked_subfolder.is_dir.return_value = True
34-
mocked_subfolder.__str__.return_value = "output_test"
35-
mocked_path.glob.return_value = [mocked_subfolder]
36-
args = argparse.Namespace(input_folder=mocked_path)
31+
(tmp_path / "output_test").mkdir()
32+
args = argparse.Namespace(input_folder=str(tmp_path))
3733

3834
result = cli.get_subject_folders(args)
3935

40-
assert result == ["output_test"]
36+
assert result[0] == str(tmp_path / "output_test")
4137

4238

4339
def test__add_string_quotation_string() -> None:

0 commit comments

Comments
 (0)