Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix paths #1070

Merged
merged 2 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Upcoming

## Bug Fixes
Fixed a setup bug introduced in `v0.6.2` where installation process created a directory instead of a file for test configuration file [PR #1070](https://github.com/catalystneuro/neuroconv/pull/1070)

## Deprecations

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def read_requirements(file):
gin_config_file_base = root / "base_gin_test_config.json"
gin_config_file_local = root / "tests/test_on_data/gin_test_config.json"
if not gin_config_file_local.exists():
gin_config_file_local.mkdir(parents=True, exist_ok=True)
gin_config_file_local.parent.mkdir(parents=True, exist_ok=True)
copy(src=gin_config_file_base, dst=gin_config_file_local)

# Bug related to sonpy on M1 Mac being installed but not running properly
Expand Down
26 changes: 14 additions & 12 deletions tests/test_on_data/setup_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,31 @@

from neuroconv.utils import load_dict_from_file

# Output by default to a temporary directory
OUTPUT_PATH = Path(tempfile.mkdtemp())


# Load the configuration for the data tests
file_path = Path(__file__).parent.parent.parent / "tests" / "test_on_data" / "gin_test_config.json"
test_config_dict = load_dict_from_file(file_path)

# GIN dataset: https://gin.g-node.org/CatalystNeuro/behavior_testing_data

if os.getenv("CI"):
LOCAL_PATH = Path(".") # Must be set to "." for CI
print("Running GIN tests on Github CI!")
else:
# Override LOCAL_PATH in the `gin_test_config.json` file to a point on your system that contains the dataset folder
# Use DANDIHub at hub.dandiarchive.org for open, free use of data found in the /shared/catalystneuro/ directory
file_path = Path(__file__).parent / "gin_test_config.json"
assert file_path.exists(), f"File not found: {file_path}"
test_config_dict = load_dict_from_file(file_path)
LOCAL_PATH = Path(test_config_dict["LOCAL_PATH"])
print("Running GIN tests locally!")

if test_config_dict["SAVE_OUTPUTS"]:
OUTPUT_PATH = LOCAL_PATH / "neuroconv_test_outputs"
OUTPUT_PATH.mkdir(exist_ok=True, parents=True)


BEHAVIOR_DATA_PATH = LOCAL_PATH / "behavior_testing_data"
ECEPHY_DATA_PATH = LOCAL_PATH / "ephy_testing_data"
OPHYS_DATA_PATH = LOCAL_PATH / "ophys_testing_data"

TEXT_DATA_PATH = file_path = Path(__file__).parent.parent.parent / "tests" / "test_text"


if test_config_dict["SAVE_OUTPUTS"]:
OUTPUT_PATH = LOCAL_PATH / "example_nwb_output"
OUTPUT_PATH.mkdir(exist_ok=True)
else:
OUTPUT_PATH = Path(tempfile.mkdtemp())
TEXT_DATA_PATH = Path(__file__).parent.parent.parent / "tests" / "test_text"
Loading