Skip to content

Commit

Permalink
Merge pull request #1 from catalystneuro/run_tests
Browse files Browse the repository at this point in the history
[Testing]: Running tests after rename
  • Loading branch information
CodyCBakerPhD authored Jul 21, 2022
2 parents 9a9fb75 + afc0453 commit 0794584
Show file tree
Hide file tree
Showing 139 changed files with 87 additions and 109 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Minimal and Full Tests
on:
schedule:
- cron: "0 16 * * *" # Daily at Noon EST
- cron: "0 16 * * *" # Daily at noon EST
pull_request:

env:
Expand Down Expand Up @@ -74,6 +74,9 @@ jobs:
uses: crazy-max/[email protected]
with:
args: install git-annex --ignore-checksums
- if: ${{ (steps.cache-ecephys-datasets.outputs.cache-hit == false || steps.cache-ophys-datasets.outputs.cache-hit == false || steps.cache-behavior-datasets.outputs.cache-hit == false) && matrix.os == 'windows-latest' }}
name: Get datalad - Windows
run: pip install datalad==0.16.3

- if: steps.cache-ecephys-datasets.outputs.cache-hit == false && (matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest')
name: "Force GIN: ecephys download"
Expand Down
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
[![documentation](https://readthedocs.org/projects/nwb-conversion-tools/badge/?version=main)](https://nwb-conversion-tools.readthedocs.io/en/main/)
[![License](https://img.shields.io/pypi/l/pynwb.svg)](https://github.com/catalystneuro/nwb-conversion-tools/license.txt)

# NWB conversion tools
# NeuroConv

NWB Conversion Tools is a package for creating NWB files by converting and
NeuroConv is a package for creating NWB files by converting and
combining neural data in proprietary formats and adding essential metadata.

**Under heavy construction. API is changing rapidly.**


Features:
* Command line interface
Expand All @@ -27,16 +25,16 @@ pip install nwb-conversion-tools
For more flexibility we recommend installing the latest version directly from GitHub. The following commands create an environment with all the required dependencies and the latest updates:

```shell
git clone https://github.com/catalystneuro/nwb-conversion-tools
cd nwb-conversion-tools
conda env create -f make_env.yml
conda activate nwb_conversion_env
git clone https://github.com/catalystneuro/neuroconv
cd neuroconv
conda env create -f make_environment.yml
conda activate neuroconv_environment
```
Note that this will install the package in [editable mode](https://pip.pypa.io/en/stable/cli/pip_install/#editable-installs).

Finally, if you prefer to avoid `conda` altogether, the following commands provide a clean installation within the current environment:
```shell
pip install git+https://github.com/catalystneuro/nwb-conversion-tools.git@master
pip install git+https://github.com/catalystneuro/neuroconv.git@master
```

## Dependencies
Expand Down Expand Up @@ -142,8 +140,8 @@ The output of these tests is, by default, stored in a temporary directory that i
For building the documentation locally, the following procedure can be followed. Create a clean environment and type
the following commands in your terminal:
```shell
git clone https://github.com/catalystneuro/nwb-conversion-tools
cd nwb-conversion-tools
git clone https://github.com/catalystneuro/neuroconv
cd neuroconv
pip install -e .[docs]
```
These commands install both the latest version of the repo and the dependencies necessary to build the documentation.
Expand Down
2 changes: 1 addition & 1 deletion docs/conversion_examples_gallery/imaging/hdf5imaging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Convert HDF5 imaging data to NWB using :py:class:`~nwb_conversion_tools.datainte
>>> from datetime import datetime
>>> from dateutil import tz
>>> from pathlib import Path
>>> from nwb_conversion_tools import Hdf5ImagingInterface
>>> from neuroconv import Hdf5ImagingInterface
>>>
>>> file_path = OPHYS_DATA_PATH / "imaging_datasets" / "hdf5" / "demoMovie.hdf5"
>>> interface = Hdf5ImagingInterface(file_path=file_path, verbose=False)
Expand Down
2 changes: 1 addition & 1 deletion docs/conversion_examples_gallery/imaging/scanbox.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Convert Scanbox imaging data to NWB using :py:class:`~nwb_conversion_tools.datai
>>> from datetime import datetime
>>> from dateutil import tz
>>> from pathlib import Path
>>> from nwb_conversion_tools import SbxImagingInterface
>>> from neuroconv import SbxImagingInterface
>>>
>>> file_path = OPHYS_DATA_PATH / "imaging_datasets" / "Scanbox" / "sample.sbx"
>>> interface = SbxImagingInterface(file_path=file_path, verbose=False)
Expand Down
2 changes: 1 addition & 1 deletion docs/conversion_examples_gallery/imaging/scanimage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Convert ScanImage imaging data to NWB using :py:class:`~nwb_conversion_tools.dat
>>> from datetime import datetime
>>> from dateutil import tz
>>> from pathlib import Path
>>> from nwb_conversion_tools import ScanImageImagingInterface
>>> from neuroconv import ScanImageImagingInterface
>>>
>>> file_path = OPHYS_DATA_PATH / "imaging_datasets" / "Tif" / "sample_scanimage.tiff"
>>> interface = ScanImageImagingInterface(file_path=file_path, verbose=False)
Expand Down
2 changes: 1 addition & 1 deletion docs/conversion_examples_gallery/imaging/tiff.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Convert Tiff imaging data to NWB using :py:class:`~nwb_conversion_tools.datainte
>>> from datetime import datetime
>>> from dateutil import tz
>>> from pathlib import Path
>>> from nwb_conversion_tools import TiffImagingInterface
>>> from neuroconv import TiffImagingInterface
>>>
>>> file_path = OPHYS_DATA_PATH / "imaging_datasets" / "Tif" / "demoMovie.tif"
>>> interface = TiffImagingInterface(file_path=file_path, sampling_frequency=15.0, verbose=False)
Expand Down
2 changes: 1 addition & 1 deletion docs/conversion_examples_gallery/recording/axona.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Convert axona data to NWB using :py:class:`~nwb_conversion_tools.datainterfaces.
>>> from datetime import datetime
>>> from dateutil import tz
>>> from pathlib import Path
>>> from nwb_conversion_tools import AxonaRecordingExtractorInterface
>>> from neuroconv import AxonaRecordingExtractorInterface
>>>
>>> # For this interface we need to pass the location of the ``.bin`` file
>>> file_path = f"{ECEPHY_DATA_PATH}/axona/axona_raw.bin"
Expand Down
2 changes: 1 addition & 1 deletion docs/conversion_examples_gallery/recording/blackrock.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Convert Blackrock data to NWB using :py:class:`~nwb_conversion_tools.datainterfa
>>> from datetime import datetime
>>> from dateutil import tz
>>> from pathlib import Path
>>> from nwb_conversion_tools import BlackrockRecordingExtractorInterface
>>> from neuroconv import BlackrockRecordingExtractorInterface
>>>
>>> # For this interface we need to pass the location of the ``.ns5`` file
>>> file_path = f"{ECEPHY_DATA_PATH}/blackrock/FileSpec2.3001.ns5"
Expand Down
2 changes: 1 addition & 1 deletion docs/conversion_examples_gallery/recording/intan.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Convert Intan data to NWB using :py:class:`~nwb_conversion_tools.datainterfaces.
>>> from datetime import datetime
>>> from dateutil import tz
>>> from pathlib import Path
>>> from nwb_conversion_tools import IntanRecordingInterface
>>> from neuroconv import IntanRecordingInterface
>>>
>>> # For this data interface we need to pass the location of the `.rhd` file
>>> suffix = "rhd" # This can also be rhs
Expand Down
2 changes: 1 addition & 1 deletion docs/conversion_examples_gallery/recording/neuralynx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Convert Neuralynx data to NWB using :py:class:`~.nwb_conversion_tools.datainterf
>>> from datetime import datetime
>>> from dateutil import tz
>>> from pathlib import Path
>>> from nwb_conversion_tools import NeuralynxRecordingInterface
>>> from neuroconv import NeuralynxRecordingInterface
>>>
>>> # For this data interface we need to pass the folder where the data is
>>> folder_path = f"{ECEPHY_DATA_PATH}/neuralynx/Cheetah_v5.7.4/original_data"
Expand Down
2 changes: 1 addition & 1 deletion docs/conversion_examples_gallery/recording/neuroscope.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Convert Neuroscope data to NWB using :py:class:`~nwb_conversion_tools.datainterf
>>> from datetime import datetime
>>> from dateutil import tz
>>> from pathlib import Path
>>> from nwb_conversion_tools import NeuroscopeRecordingInterface
>>> from neuroconv import NeuroscopeRecordingInterface
>>>
>>> # For Neuroscope we need to pass the location of the `.dat` file
>>> file_path = f"{ECEPHY_DATA_PATH}/neuroscope/test1/test1.dat"
Expand Down
2 changes: 1 addition & 1 deletion docs/conversion_examples_gallery/recording/openephys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Convert OpenEphys data to NWB using :py:class:`~nwb_conversion_tools.datainterfa
>>> from dateutil import tz
>>> from pathlib import Path
>>>
>>> from nwb_conversion_tools import OpenEphysRecordingExtractorInterface
>>> from neuroconv import OpenEphysRecordingExtractorInterface
>>>
>>> folder_path = f"{ECEPHY_DATA_PATH}/openephysbinary/v0.4.4.1_with_video_tracking"
>>> # Change the folder_path to the appropiate location in your system
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Convert spikegadgets data to NWB using :py:class:`~nwb_conversion_tools.datainte
from datetime import datetime
from dateutil import tz
from pathlib import Path
from nwb_conversion_tools import SpikeGadgetsRecordingInterface
from neuroconv import SpikeGadgetsRecordingInterface
# For this interface we need to pass the specific path to the files.
file_path = f"{ECEPHY_DATA_PATH}/spikegadgets/20210225_em8_minirec2_ac.rec"
Expand Down
2 changes: 1 addition & 1 deletion docs/conversion_examples_gallery/recording/spikeglx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Convert spikeglx data to NWB using :py:class:`~nwb_conversion_tools.datainterfac
>>> from datetime import datetime
>>> from dateutil import tz
>>> from pathlib import Path
>>> from nwb_conversion_tools import SpikeGLXRecordingInterface
>>> from neuroconv import SpikeGLXRecordingInterface
>>>
>>> # For this interface we need to pass the location of the ``.bin`` file
>>> file_path = f"{ECEPHY_DATA_PATH}/spikeglx/Noise4Sam_g0/Noise4Sam_g0_imec0/Noise4Sam_g0_t0.imec0.ap.bin"
Expand Down
2 changes: 1 addition & 1 deletion docs/conversion_examples_gallery/sorting/cellexplorer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Convert cell explorer sorting data to NWB using :py:class:`~nwb_conversion_tools
>>> from datetime import datetime
>>> from dateutil import tz
>>> from pathlib import Path
>>> from nwb_conversion_tools import CellExplorerSortingInterface
>>> from neuroconv import CellExplorerSortingInterface
>>>
>>> # For this interface we need to pass the location of the ``cellinfo.mat`` file
>>> file_path = f"{ECEPHY_DATA_PATH}/cellexplorer/dataset_1/20170311_684um_2088um_170311_134350.spikes.cellinfo.mat"
Expand Down
2 changes: 1 addition & 1 deletion docs/conversion_examples_gallery/sorting/kilosort.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Convert Kilosort data to NWB using :py:class:`~nwb_conversion_tools.datainterfac
>>> from dateutil import tz
>>> from pathlib import Path
>>>
>>> from nwb_conversion_tools import KilosortSortingInterface
>>> from neuroconv import KilosortSortingInterface
>>>
>>> folder_path = f"{ECEPHY_DATA_PATH}/phy/phy_example_0"
>>> # Change the file_path to the location of the data in your system
Expand Down
2 changes: 1 addition & 1 deletion docs/conversion_examples_gallery/sorting/neuroscope.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Convert Neuroscope sorting data to NWB using :py:class:`~nwb_conversion_tools.da
>>> from datetime import datetime
>>> from dateutil import tz
>>> from pathlib import Path
>>> from nwb_conversion_tools import NeuroscopeSortingInterface
>>> from neuroconv import NeuroscopeSortingInterface
>>>
>>> folder_path = f"{ECEPHY_DATA_PATH}/neuroscope/dataset_1"
>>> xml_file_path = folder_path + "/YutaMouse42-151117.xml"
Expand Down
2 changes: 1 addition & 1 deletion docs/conversion_examples_gallery/sorting/phy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Convert Phy data to NWB using :py:class:`~.nwb_conversion_tools.datainterfaces.e
>>> from dateutil import tz
>>> from pathlib import Path
>>>
>>> from nwb_conversion_tools import PhySortingInterface
>>> from neuroconv import PhySortingInterface
>>>
>>> folder_path = f"{ECEPHY_DATA_PATH}/phy/phy_example_0"
>>> # Change the file_path to the location of the data in your system
Expand Down
9 changes: 0 additions & 9 deletions make_env_testing.yml

This file was deleted.

2 changes: 1 addition & 1 deletion make_env.yml → make_environment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: nwb_conversion_env
name: neuroconv_environment
channels:
- defaults
- anaconda
Expand Down
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
copy(src=gin_config_file_base, dst=gin_config_file_local)

setup(
name="nwb-conversion-tools",
version="0.11.38",
name="neuroconv",
version="0.1.0",
description="Convert data from proprietary formats to NWB format.",
long_description=long_description,
long_description_content_type="text/markdown",
author="Ben Dichter, Cody Baker, and Luiz Tauffer",
author="Cody Baker, Szonja Weigl, Heberto Mayorquin, Luiz Tauffer, and Ben Dichter.",
author_email="[email protected]",
url="https://github.com/catalystneuro/nwb-conversion-tools",
url="https://github.com/catalystneuro/neuroconv",
keywords="nwb",
packages=find_packages(where="src"),
package_dir={"": "src"},
Expand All @@ -43,7 +43,7 @@
extras_require=extras_require,
entry_points={
"console_scripts": [
"nwbct-run-conversion = nwb_conversion_tools.tools.yaml_conversion_specification.yaml_conversion_specification:run_conversion_from_yaml_cli",
"neuroconv = neuroconv.tools.yaml_conversion_specification.yaml_conversion_specification:run_conversion_from_yaml_cli",
],
},
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@
from pynwb import NWBFile
from pynwb.image import ImageSeries
from tqdm import tqdm
from nwb_conversion_tools.utils import calculate_regular_series_rate

from .movie_utils import VideoCaptureContext
from ....basedatainterface import BaseDataInterface
from ....tools.nwb_helpers import get_module
from ....utils import get_schema_from_hdmf_class, get_base_schema
from ....utils import get_schema_from_hdmf_class, get_base_schema, calculate_regular_series_rate


def _check_duplicates(movies_metadata, file_paths):
Expand All @@ -37,7 +36,6 @@ def _check_duplicates(movies_metadata, file_paths):
file_paths_list: List[List[str]]
len(file_paths_list)==len(movies_metadata_unique)
"""

keys_set = []
movies_metadata_unique = []
file_paths_list = []
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from hdmf.backends.hdf5.h5_utils import H5DataIO

from ..nwb_helpers import get_default_nwbfile_metadata, make_nwbfile_from_metadata, make_or_load_nwbfile
from nwb_conversion_tools.utils import (
from ...utils import (
FilePathType,
OptionalFilePathType,
dict_deep_update,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def run_conversion_from_yaml(
global_data_interfaces = specification.get("data_interfaces")
nwb_conversion_tools = import_module(
name=".",
package="nwb_conversion_tools", # relative import, but named and referenced as if it were absolute
package="neuroconv", # relative import, but named and referenced as if it were absolute
)
file_counter = 0
for experiment in specification["experiments"].values():
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 0 additions & 12 deletions src/nwb_conversion_tools/schemas/source_example.json

This file was deleted.

5 changes: 3 additions & 2 deletions tests/test_internals/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@

from pynwb import NWBFile

from neuroconv import NWBConverter
from neuroconv.basedatainterface import BaseDataInterface

try:
from ndx_events import LabeledEvents

HAVE_NDX_EVENTS = True
except ImportError:
HAVE_NDX_EVENTS = False
from nwb_conversion_tools import NWBConverter
from nwb_conversion_tools.basedatainterface import BaseDataInterface


def test_converter():
Expand Down
2 changes: 1 addition & 1 deletion tests/test_internals/test_globbing_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from hdmf.testing import TestCase

from nwb_conversion_tools.utils import decompose_f_string, parse_f_string
from neuroconv.utils import decompose_f_string, parse_f_string


class TestGlobbingAssertions(TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_internals/test_hdmf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
from hdmf.testing import TestCase

from nwb_conversion_tools.tools.hdmf import SliceableDataChunkIterator
from neuroconv.tools.hdmf import SliceableDataChunkIterator


class TestIteratorAssertions(TestCase):
Expand Down
6 changes: 4 additions & 2 deletions tests/test_internals/test_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,23 @@
from tempfile import mkdtemp
from pathlib import Path
from datetime import datetime

import numpy as np
import pytest
import spikeextractors as se
from spikeextractors.testing import check_recordings_equal, check_sortings_equal
from hdmf.testing import TestCase
from pynwb import NWBHDF5IO
from nwb_conversion_tools import (

from neuroconv import (
NWBConverter,
RecordingTutorialInterface,
SortingTutorialInterface,
SIPickleRecordingExtractorInterface,
SIPickleSortingExtractorInterface,
CEDRecordingInterface,
)
from nwb_conversion_tools.datainterfaces.ecephys.basesortingextractorinterface import BaseSortingExtractorInterface
from neuroconv.datainterfaces.ecephys.basesortingextractorinterface import BaseSortingExtractorInterface


class TestAssertions(TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_internals/test_json_schema_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import Union
from copy import deepcopy

from nwb_conversion_tools.utils import (
from neuroconv.utils import (
get_schema_from_method_signature,
dict_deep_update,
fill_defaults,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_internals/test_movie_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import numpy as np
from pynwb import NWBHDF5IO

from nwb_conversion_tools import NWBConverter, MovieInterface
from neuroconv import NWBConverter, MovieInterface

try:
import cv2
Expand Down
4 changes: 2 additions & 2 deletions tests/test_internals/test_movie_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from datetime import datetime
from hdmf.backends.hdf5.h5_utils import H5DataIO

from nwb_conversion_tools.datainterfaces.behavior.movie.movie_utils import VideoCaptureContext, MovieDataChunkIterator
from nwb_conversion_tools.tools.nwb_helpers import make_nwbfile_from_metadata
from neuroconv.datainterfaces.behavior.movie.movie_utils import VideoCaptureContext, MovieDataChunkIterator
from neuroconv.tools.nwb_helpers import make_nwbfile_from_metadata

try:
import cv2
Expand Down
Loading

0 comments on commit 0794584

Please sign in to comment.