Skip to content

Commit

Permalink
Bump [skip actions]
Browse files Browse the repository at this point in the history
  • Loading branch information
bjhardcastle committed Jul 9, 2024
1 parent 09df200 commit 797cbf0
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 24 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.226"
version = "0.0.227"
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
36 changes: 18 additions & 18 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,45 +23,45 @@ crc32c==2.4
cryptography==42.0.5
cycler==0.12.1
dictdiffer==0.9.0
DynamicRoutingTask==0.1.102
DynamicRoutingTask==0.1.104
et-xmlfile==1.1.0
fasteners==0.19; sys_platform != "emscripten"
fonttools==4.50.0
frozenlist==1.4.1
fsspec==2024.3.0
h5py==3.11.0
hdmf==3.14.0
hdmf-zarr==0.7.0
hdmf==3.14.2
hdmf-zarr==0.8.0
idna==3.6
importlib-resources==6.4.0; python_version < "3.10"
inflection==0.5.1
jmespath==1.0.1
jsonschema==4.21.1
jsonschema-specifications==2023.12.1
kiwisolver==1.4.5
llvmlite==0.42.0
llvmlite==0.43.0
markdown-it-py==3.0.0
matplotlib==3.9.0
matplotlib==3.9.1
mdurl==0.1.2
msgpack==1.0.8
multidict==6.0.5
ndindex==1.8
ndx-events==0.2.0
ndx-pose==0.1.1
neo==0.13.0
npc-ephys==0.1.15
npc-ephys==0.1.16
npc-io==0.1.26
npc-lims==0.1.154
npc-lims==0.1.161
npc-mvr==0.1.6
npc-samstim==0.1.4
npc-session==0.1.34
npc-session==0.1.36
npc-stim==0.1.8
npc-sync==0.1.14
numba==0.59.1
npc-sync==0.1.15
numba==0.60.0
numcodecs==0.12.1
numexpr==2.9.0
numpy==1.26.4
opencv-python-headless==4.9.0.80
opencv-python-headless==4.10.0.84
openpyxl==3.1.2
packaging==24.0
pandas==2.2.2
Expand All @@ -71,12 +71,12 @@ probeinterface==0.2.21
py-cpuinfo==9.0.0
pyarrow==16.1.0
pycparser==2.21; platform_python_implementation != "PyPy"
pydantic==2.7.1
pydantic-core==2.18.2
pydantic==2.8.2
pydantic-core==2.20.1
pydantic-settings==2.2.1
pydbhub-bjh==0.0.9
pygments==2.17.2
pynwb==2.7.0
pynwb==2.8.1
pyopenssl==24.1.0
pyparsing==3.1.2
python-dateutil==2.9.0.post0
Expand All @@ -93,22 +93,22 @@ ruamel-yaml==0.18.6
ruamel-yaml-clib==0.2.8; platform_python_implementation == "CPython" and python_version < "3.13"
s3fs==2024.3.0
s3transfer==0.6.2
scipy==1.13.0
scipy==1.13.1
semver==3.0.2
six==1.16.0
spikeinterface==0.100.6
spikeinterface==0.100.8
tables==3.9.2
threadpoolctl==3.4.0
tqdm==4.66.2
types-pyYAML==6.0.12.20240311
types-requests==2.31.0.6
types-urllib3==1.26.25.14
typing-extensions==4.10.0
typing-extensions==4.12.2
tzdata==2024.1
universal-pathlib==0.1.4
urllib3==1.26.18
wavpack-numcodecs==0.1.5
wrapt==1.16.0
yarl==1.9.4
zarr==2.18.0
zarr==2.17.2
zipp==3.18.1; python_version < "3.10"
22 changes: 17 additions & 5 deletions src/npc_sessions/utils/videos.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

FACEMAP_CAMERA_NAMES: tuple[npc_mvr.CameraName, ...] = ("behavior", "face")


def get_dlc_session_paf_graph(session: str, model_name: str) -> list:
"""
https://github.com/DeepLabCut/DLC2NWB/blob/main/dlc2nwb/utils.py#L139
Expand Down Expand Up @@ -59,22 +60,33 @@ def h5_to_dataframe(h5_path: upath.UPath, key_name: str | None = None) -> pd.Dat
return df_h5


def get_LPFaceParts_predictions_dataframe(session: str, camera: Literal['side', 'face']) -> pd.DataFrame:
def get_LPFaceParts_predictions_dataframe(
session: str, camera: Literal["side", "face"]
) -> pd.DataFrame:
"""
Gets the result dataframe with the lightning pose prediction for the facial features for the given camera
>>> df_predictions = get_LPFaceParts_predictions_dataframe('702136_2024-03-07', 'side')
>>> len(df_predictions.columns)
34
"""
session_LP_predictions_s3_paths = npc_lims.get_lpfaceparts_camera_predictions_s3_paths(session, camera)
session_LP_prediction_csv_s3_path = tuple(path for path in session_LP_predictions_s3_paths if '_predictions.csv' in str(path))
session_LP_predictions_s3_paths = (
npc_lims.get_lpfaceparts_camera_predictions_s3_paths(session, camera)
)
session_LP_prediction_csv_s3_path = tuple(
path
for path in session_LP_predictions_s3_paths
if "_predictions.csv" in str(path)
)
if not session_LP_predictions_s3_paths:
raise FileNotFoundError(f'{session} has no lightning pose prediction csv in result. Check codeocean')

raise FileNotFoundError(
f"{session} has no lightning pose prediction csv in result. Check codeocean"
)

df_predictions = pd.read_csv(session_LP_prediction_csv_s3_path[0], low_memory=False)
data_array = df_predictions.to_numpy()
return pd.DataFrame(data_array[1:], columns=data_array[0])


def get_ellipse_session_dataframe_from_h5(session: str) -> pd.DataFrame:
"""
>>> df_ellipse = get_ellipse_session_dataframe_from_h5('676909_2023-12-12')
Expand Down

0 comments on commit 797cbf0

Please sign in to comment.