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

Add pytest #185

Merged
merged 6 commits into from
Mar 22, 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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and
[Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention.

## [0.3.4] - 2024-03-22

+ Add - pytest
+ Update - Ephys schema changed from `ephys_acute` to `ephys_no_curation` in `tutorial.ipynb`


## [0.3.3] - 2024-01-24
+ Update - remove PyPi release from `release.yml` since it will fail after the new `setup.py`

Expand Down
20 changes: 12 additions & 8 deletions element_array_ephys/ephys_acute.py
Original file line number Diff line number Diff line change
Expand Up @@ -1044,9 +1044,11 @@ def make(self, key):
spike_time_key = (
"spike_times_sec_adj"
if "spike_times_sec_adj" in kilosort_dataset.data
else "spike_times_sec"
if "spike_times_sec" in kilosort_dataset.data
else "spike_times"
else (
"spike_times_sec"
if "spike_times_sec" in kilosort_dataset.data
else "spike_times"
)
)
spike_times = kilosort_dataset.data[spike_time_key]
kilosort_dataset.extract_spike_depths()
Expand Down Expand Up @@ -1081,11 +1083,13 @@ def make(self, key):
"spike_sites": spike_sites[
kilosort_dataset.data["spike_clusters"] == unit
],
"spike_depths": spike_depths[
kilosort_dataset.data["spike_clusters"] == unit
]
if spike_depths is not None
else None,
"spike_depths": (
spike_depths[
kilosort_dataset.data["spike_clusters"] == unit
]
if spike_depths is not None
else None
),
}
)

Expand Down
20 changes: 12 additions & 8 deletions element_array_ephys/ephys_chronic.py
Original file line number Diff line number Diff line change
Expand Up @@ -973,9 +973,11 @@ def make(self, key):
spike_time_key = (
"spike_times_sec_adj"
if "spike_times_sec_adj" in kilosort_dataset.data
else "spike_times_sec"
if "spike_times_sec" in kilosort_dataset.data
else "spike_times"
else (
"spike_times_sec"
if "spike_times_sec" in kilosort_dataset.data
else "spike_times"
)
)
spike_times = kilosort_dataset.data[spike_time_key]
kilosort_dataset.extract_spike_depths()
Expand Down Expand Up @@ -1010,11 +1012,13 @@ def make(self, key):
"spike_sites": spike_sites[
kilosort_dataset.data["spike_clusters"] == unit
],
"spike_depths": spike_depths[
kilosort_dataset.data["spike_clusters"] == unit
]
if spike_depths is not None
else None,
"spike_depths": (
spike_depths[
kilosort_dataset.data["spike_clusters"] == unit
]
if spike_depths is not None
else None
),
}
)

Expand Down
8 changes: 5 additions & 3 deletions element_array_ephys/ephys_no_curation.py
Original file line number Diff line number Diff line change
Expand Up @@ -988,9 +988,11 @@ def make(self, key):
spike_time_key = (
"spike_times_sec_adj"
if "spike_times_sec_adj" in kilosort_dataset.data
else "spike_times_sec"
if "spike_times_sec" in kilosort_dataset.data
else "spike_times"
else (
"spike_times_sec"
if "spike_times_sec" in kilosort_dataset.data
else "spike_times"
)
)
spike_times = kilosort_dataset.data[spike_time_key]
kilosort_dataset.extract_spike_depths()
Expand Down
20 changes: 12 additions & 8 deletions element_array_ephys/ephys_precluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -962,9 +962,11 @@ def make(self, key):
spike_time_key = (
"spike_times_sec_adj"
if "spike_times_sec_adj" in kilosort_dataset.data
else "spike_times_sec"
if "spike_times_sec" in kilosort_dataset.data
else "spike_times"
else (
"spike_times_sec"
if "spike_times_sec" in kilosort_dataset.data
else "spike_times"
)
)
spike_times = kilosort_dataset.data[spike_time_key]
kilosort_dataset.extract_spike_depths()
Expand Down Expand Up @@ -999,11 +1001,13 @@ def make(self, key):
"spike_sites": spike_sites[
kilosort_dataset.data["spike_clusters"] == unit
],
"spike_depths": spike_depths[
kilosort_dataset.data["spike_clusters"] == unit
]
if spike_depths is not None
else None,
"spike_depths": (
spike_depths[
kilosort_dataset.data["spike_clusters"] == unit
]
if spike_depths is not None
else None
),
}
)

Expand Down
8 changes: 5 additions & 3 deletions element_array_ephys/ephys_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ def make(self, key):
fig_prefix = (
"-".join(
[
v.strftime("%Y%m%d%H%M%S")
if isinstance(v, datetime.datetime)
else str(v)
(
v.strftime("%Y%m%d%H%M%S")
if isinstance(v, datetime.datetime)
else str(v)
)
for v in key.values()
]
)
Expand Down
1 change: 1 addition & 0 deletions element_array_ephys/probe.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Neuropixels Probes
"""

import datajoint as dj

from .readers import probe_geometry
Expand Down
3 changes: 2 additions & 1 deletion element_array_ephys/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""Package metadata."""
__version__ = "0.3.3"

__version__ = "0.3.4"
Loading
Loading