Skip to content

Commit c66621f

Browse files
authored
Merge pull request #364 from alejoe91/update-get-probe
Improve interaction with probeinterface-library
2 parents b43450b + 792a7e6 commit c66621f

File tree

7 files changed

+367
-41
lines changed

7 files changed

+367
-41
lines changed

.github/workflows/full_tests.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,8 @@ jobs:
3131
pip install .[test]
3232
- name: Pytest
3333
run: |
34-
pytest -v
34+
pytest -m "not library" -v
35+
- name: Pytest library tests
36+
if: ${{ matrix.os == 'ubuntu-latest' }}
37+
run: |
38+
pytest -m library -v

doc/library.rst

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,58 @@
11
Probeinterface public library
22
=============================
33

4-
Probeinterface also handles a collection of probe descriptions on the
5-
`GitHub platform <https://github.com/SpikeInterface/probeinterface_library>`_
4+
Probeinterface also handles a collection of probe descriptions in the
5+
`ProbeInterface library <https://github.com/SpikeInterface/probeinterface_library>`_
66

7-
The python module has a simple function to download and cache locally by using `get_probe(...)` ::
7+
The python module has a simple function to download and cache locally by using ``get_probe(...)``:
8+
9+
10+
.. code-block:: python
811
912
from probeinterface import get_probe
10-
probe = get_probe(manufacturer='neuronexus',
11-
probe_name='A1x32-Poly3-10mm-50-177')
13+
probe = get_probe(
14+
manufacturer='neuronexus',
15+
probe_name='A1x32-Poly3-10mm-50-177'
16+
)
17+
18+
19+
Once a probe is downloaded, it is cached locally for future use.
20+
21+
There are several helper functions to explore the library:
22+
23+
.. code-block:: python
24+
25+
from probeinterface.library import (
26+
list_manufacturers,
27+
list_probes_by_manufacturer,
28+
list_all_probes
29+
)
30+
31+
# List all manufacturers
32+
manufacturers = list_manufacturers()
33+
34+
# List all probes for a given manufacturer
35+
probes = list_probes_by_manufacturer('neuronexus')
36+
37+
# List all probes in the library
38+
all_probes = list_all_probes()
39+
40+
# Cache all probes locally
41+
cache_full_library()
42+
1243
44+
Each function has an optional ``tag`` argument to specify a git tag/branch/commit to get a specific version of the library.
1345

14-
We expect to build rapidly commonly used probes in this public repository.
1546

16-
How to contribute
17-
-----------------
47+
How to contribute to the library
48+
--------------------------------
1849

19-
TODO: explain with more details
50+
Each probe in the library is represented by a JSON file and an image.
51+
To contribute a new probe to the library, follow these steps:
2052

21-
1. Generate the JSON file with probeinterface (or directly
22-
with another language)
53+
1. Generate the JSON file with probeinterface (or directly with another language)
2354
2. Generate an image of the probe with the `plot_probe` function in probeinterface
2455
3. Clone the `probeinterface_library repo <https://github.com/SpikeInterface/probeinterface_library>`_
25-
4. Put the JSON file and image into the correct folder or make a new folder (following the format of the repo)
56+
4. Put the JSON file and image into the correct folder: ``probeinterface_library/<manufacturer>/<model_name>/```
2657
5. Push to one of your branches with a git client
2758
6. Make a pull request to the main repo

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ classifiers = [
1818
dependencies = [
1919
"numpy",
2020
"packaging",
21+
"requests"
2122
]
2223

2324
[project.urls]
@@ -57,6 +58,11 @@ docs = [
5758
"pandas",
5859
]
5960

61+
[tool.pytest.ini_options]
62+
markers = [
63+
"library",
64+
]
65+
6066
[tool.coverage.run]
6167
omit = [
6268
"tests/*",

src/probeinterface/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,13 @@
3939
generate_multi_columns_probe,
4040
generate_multi_shank,
4141
)
42-
from .library import get_probe
42+
from .library import (
43+
get_probe,
44+
list_manufacturers,
45+
list_probes_by_manufacturer,
46+
list_all_probes,
47+
get_tags_in_library,
48+
cache_full_library,
49+
clear_cache,
50+
)
4351
from .wiring import get_available_pathways

0 commit comments

Comments
 (0)