Skip to content

Commit

Permalink
Re-organize gin test by modality (#1049)
Browse files Browse the repository at this point in the history
  • Loading branch information
h-mayorquin authored Sep 2, 2024
1 parent 905dc73 commit 925f183
Show file tree
Hide file tree
Showing 37 changed files with 20 additions and 204 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

### Improvements
* Using ruff to enforce existence of public classes' docstrings [PR #1034](https://github.com/catalystneuro/neuroconv/pull/1034)
* Separated tests that use external data by modality [PR #1049](https://github.com/catalystneuro/neuroconv/pull/1049)

## v0.6.1 (August 30, 2024)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ Convert TDT Fiber Photometry data to NWB using
>>> folder_path = OPHYS_DATA_PATH / "fiber_photometry_datasets" / "TDT" / "Photo_249_391-200721-120136_stubbed"
>>> LOCAL_PATH = Path(".") # Path to neuroconv
>>> editable_metadata_path = LOCAL_PATH / "tests" / "test_on_data" / "fiber_photometry_metadata.yaml"
>>> editable_metadata_path = LOCAL_PATH / "tests" / "test_on_data" / "ophys" / "fiber_photometry_metadata.yaml"
>>> interface = TDTFiberPhotometryInterface(folder_path=folder_path, verbose=True)
>>> metadata = interface.get_metadata()
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from neuroconv.utils import DeepDict

try:
from .setup_paths import BEHAVIOR_DATA_PATH, OPHYS_DATA_PATH, OUTPUT_PATH
from ..setup_paths import BEHAVIOR_DATA_PATH, OPHYS_DATA_PATH, OUTPUT_PATH
except ImportError:
from setup_paths import BEHAVIOR_DATA_PATH, OUTPUT_PATH

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
from ..setup_paths import ECEPHY_DATA_PATH as DATA_PATH
from ..setup_paths import OUTPUT_PATH
except ImportError:
from setup_paths import ECEPHY_DATA_PATH as DATA_PATH
from setup_paths import OUTPUT_PATH
from ..setup_paths import ECEPHY_DATA_PATH as DATA_PATH
from ..setup_paths import OUTPUT_PATH

if not DATA_PATH.exists():
pytest.fail(f"No folder found in location: {DATA_PATH}!")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
)

try:
from .setup_paths import ECEPHY_DATA_PATH, OUTPUT_PATH
from ..setup_paths import ECEPHY_DATA_PATH, OUTPUT_PATH
except ImportError:
from setup_paths import ECEPHY_DATA_PATH, OUTPUT_PATH
from ..setup_paths import ECEPHY_DATA_PATH, OUTPUT_PATH


this_python_version = version.parse(python_version())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
)

try:
from .setup_paths import ECEPHY_DATA_PATH as DATA_PATH
from .setup_paths import OUTPUT_PATH
from ..setup_paths import ECEPHY_DATA_PATH as DATA_PATH
from ..setup_paths import OUTPUT_PATH
except ImportError:
from setup_paths import ECEPHY_DATA_PATH as DATA_PATH
from setup_paths import OUTPUT_PATH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
except ImportError:
HAVE_PARAMETERIZED = False
# Load the configuration for the data tests
test_config_dict = load_dict_from_file(Path(__file__).parent / "gin_test_config.json")
test_config_dict = load_dict_from_file(Path(__file__).parent.parent / "gin_test_config.json")

# GIN dataset: https://gin.g-node.org/NeuralEnsemble/ephy_testing_data
if os.getenv("CI"):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from neuroconv.utils import dict_deep_update, load_dict_from_file

try:
from .setup_paths import OPHYS_DATA_PATH, OUTPUT_PATH
from ..setup_paths import OPHYS_DATA_PATH, OUTPUT_PATH
except ImportError:
from setup_paths import OUTPUT_PATH

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
)

try:
from .setup_paths import OPHYS_DATA_PATH, OUTPUT_PATH
from ..setup_paths import OPHYS_DATA_PATH, OUTPUT_PATH
except ImportError:
from setup_paths import OPHYS_DATA_PATH, OUTPUT_PATH

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from neuroconv import NWBConverter
from neuroconv.datainterfaces import Suite2pSegmentationInterface, TiffImagingInterface

from .setup_paths import OPHYS_DATA_PATH
from ..setup_paths import OPHYS_DATA_PATH

TiffImagingInterface_source_data = dict(
file_path=str(OPHYS_DATA_PATH / "imaging_datasets" / "Tif" / "demoMovie.tif"), sampling_frequency=15.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
)

try:
from .setup_paths import OPHYS_DATA_PATH, OUTPUT_PATH
from ..setup_paths import OPHYS_DATA_PATH, OUTPUT_PATH
except ImportError:
from setup_paths import OPHYS_DATA_PATH, OUTPUT_PATH
from ..setup_paths import OPHYS_DATA_PATH, OUTPUT_PATH


class TestCaimanSegmentationInterface(SegmentationExtractorInterfaceTestMixin):
Expand Down
55 changes: 0 additions & 55 deletions tests/test_on_data/test_metadata/test_maxwell_metadata.py

This file was deleted.

130 changes: 0 additions & 130 deletions tests/test_on_data/test_metadata/test_neuroscope.py

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from neuroconv import run_conversion_from_yaml
from neuroconv.utils import load_dict_from_file

from .setup_paths import BEHAVIOR_DATA_PATH, OUTPUT_PATH
from .setup_paths import ECEPHY_DATA_PATH as DATA_PATH
from ..setup_paths import BEHAVIOR_DATA_PATH, OUTPUT_PATH
from ..setup_paths import ECEPHY_DATA_PATH as DATA_PATH


@pytest.mark.parametrize(
Expand All @@ -26,7 +26,7 @@
)
def test_validate_example_specifications(fname):
path_to_test_yml_files = Path(__file__).parent / "conversion_specifications"
schema_folder = path_to_test_yml_files.parent.parent.parent / "src" / "neuroconv" / "schemas"
schema_folder = path_to_test_yml_files.parent.parent.parent.parent / "src" / "neuroconv" / "schemas"
specification_schema = load_dict_from_file(file_path=schema_folder / "yaml_conversion_specification_schema.json")
sys_uri_base = "file://"
if sys.platform.startswith("win32"):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

from neuroconv.tools import deploy_process

from .setup_paths import ECEPHY_DATA_PATH as DATA_PATH
from .setup_paths import OUTPUT_PATH
from ..setup_paths import ECEPHY_DATA_PATH as DATA_PATH
from ..setup_paths import OUTPUT_PATH


class TestYAMLConversionSpecification(TestCase):
Expand Down

0 comments on commit 925f183

Please sign in to comment.