Skip to content

Commit

Permalink
Bump [skip actions]
Browse files Browse the repository at this point in the history
  • Loading branch information
bjhardcastle committed Sep 19, 2024
1 parent 65d5126 commit 9ad2732
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 21 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "npc_sessions"
version = "0.0.237"
version = "0.0.238"
description = "NWB-conversion for behavior and epyhys sessions from the Mindscope Neuropixels team, in the cloud."
authors = [
{ name = "Ben Hardcastle", email = "[email protected]" },
Expand Down
18 changes: 8 additions & 10 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ fonttools==4.53.1
frozenlist==1.4.1
fsspec==2024.6.0
h5py==3.11.0
hdmf==3.14.3
hdmf==3.14.4
hdmf-zarr-bjh==0.8.1.post1
idna==3.7
importlib-resources==6.4.2; python_version < "3.10"
inflection==0.5.1
jmespath==1.0.1
jsonschema==4.23.0
Expand All @@ -54,12 +53,12 @@ mypy-extensions==1.0.0
ndindex==1.8
ndx-events==0.2.0
ndx-pose==0.1.1
npc-ephys==0.1.24
npc-io==0.1.29
npc-ephys==0.1.25
npc-io==0.1.30
npc-lims==0.1.175
npc-mvr==0.1.7
npc-samstim==0.1.4
npc-session==0.1.38
npc-session==0.1.39
npc-stim==0.1.8
npc-sync==0.1.18
numba==0.60.0
Expand All @@ -75,11 +74,11 @@ polars==1.7.1
py-cpuinfo==9.0.0
pyarrow==17.0.0
pycparser==2.22; platform_python_implementation != "PyPy"
pydantic==2.8.2
pydantic-core==2.20.1
pydantic==2.9.2
pydantic-core==2.23.4
pydbhub-bjh==0.0.9
pygments==2.18.0
pynwb==2.8.1
pynwb==2.8.2
pyopenssl==24.2.1
pyparsing==3.1.2
python-dateutil==2.9.0.post0
Expand All @@ -90,7 +89,7 @@ redis==5.0.8
referencing==0.35.1
requests==2.32.3
requests-toolbelt==1.0.0
rich==13.7.1
rich==13.8.1
rpds-py==0.20.0
ruamel-yaml==0.18.6
ruamel-yaml-clib==0.2.8; platform_python_implementation == "CPython" and python_version < "3.13"
Expand All @@ -114,4 +113,3 @@ wavpack-numcodecs==0.1.5
wrapt==1.16.0
yarl==1.9.4
zarr==2.17.2
zipp==3.20.0; python_version < "3.10"
29 changes: 19 additions & 10 deletions src/npc_sessions/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1691,24 +1691,33 @@ def _raw_lfp(self) -> pynwb.ecephys.LFP:
# units=microvolts, # doesn't work - electrical series must be in volts
)
return lfp

@npc_io.cached_property
def _subsampled_LFP(self) -> pynwb.ecephys.LFP:
LFP = pynwb.ecephys.LFP()
band: str = "0.5-500 Hz"

try: # only run on one session so far: '674562_2023-10-03'
subsampled_LFP_results = npc_ephys.get_LFP_subsampled_results(self.id, self.ephys_timing_data)
try: # only run on one session so far: '674562_2023-10-03'
subsampled_LFP_results = npc_ephys.get_LFP_subsampled_results(
self.id, self.ephys_timing_data
)
except FileNotFoundError:
logger.warning(f'{self.id} has no LFP subsampled results. Session either has not been processed or failed in codeocean')
logger.warning(
f"{self.id} has no LFP subsampled results. Session either has not been processed or failed in codeocean"
)
return LFP

for probe in self.electrode_groups.values():
probe_subsampled_LFP_result = tuple(subsampled_LFP for subsampled_LFP in subsampled_LFP_results
if subsampled_LFP.probe.lower() == probe.name.lower())

probe_subsampled_LFP_result = tuple(
subsampled_LFP
for subsampled_LFP in subsampled_LFP_results
if subsampled_LFP.probe.lower() == probe.name.lower()
)

if not probe_subsampled_LFP_result:
logger.warning(f'{probe.name} has no subsampled LFP result. Possibly no surface channel for {probe.name}. Check codeocean. Skipping')
logger.warning(
f"{probe.name} has no subsampled LFP result. Possibly no surface channel for {probe.name}. Check codeocean. Skipping"
)
continue

probe_subsampled_LFP = probe_subsampled_LFP_result[0]
Expand All @@ -1732,7 +1741,7 @@ def _subsampled_LFP(self) -> pynwb.ecephys.LFP:
description=f"temporal and spatial subsampled local field potential-band voltage timeseries ({band}) from electrodes on {probe.name} with sampling rate {probe_subsampled_LFP.sampling_rate} across {len(probe_subsampled_LFP.channel_ids)} channels",
# units=microvolts, # doesn't work - electrical series must be in volts
)

return LFP

# images -------------------------------------------------------------------- #
Expand Down

0 comments on commit 9ad2732

Please sign in to comment.