Skip to content

Commit 8b6dbf2

Browse files
v2024.11.27
- fixed plotting the delays for features that were turned off - removed backward compatibility for features_off property of Config - add info that features_off must be a list
1 parent 9e75445 commit 8b6dbf2

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

configs/openfield.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
modality : openfield
1212
features : speed, head angle, body angle, x, y
1313
author : Guillaume Le Goc (g.legoc@posteo.org), Rémi Proville (Acquineuro)
14-
version : 2024.11.22
14+
version : 2024.11.27
1515
1616
"""
1717

@@ -75,8 +75,8 @@
7575
}
7676
# Preset y axes limits
7777
FEATURES_YLIM = {} # must be [ymin, ymax], empty {} for automatic
78-
# Features to NOT plot
79-
FEATURES_OFF = ("xbody", "ybody")
78+
# Features to NOT plot (must be a list [])
79+
FEATURES_OFF = ["xbody", "ybody"]
8080

8181

8282
# --- Configuration class

features_from_dlc/features_from_dlc.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,9 +1598,8 @@ def plot_all_figures(
15981598
figs_features = []
15991599
pbar = tqdm(cfg.features.keys())
16001600
for feature in pbar:
1601-
if hasattr(cfg, "features_off"): # for backward compatibility
1602-
if feature in cfg.features_off:
1603-
continue
1601+
if feature in cfg.features_off:
1602+
continue
16041603

16051604
pbar.set_description(f"Plotting {feature}")
16061605

@@ -1682,9 +1681,12 @@ def plot_all_figures(
16821681
fig_delay, axd = plt.subplots(figsize=kwargs_plot["figsize"])
16831682
df_response_plt = df_response[
16841683
df_response["condition"].isin(plot_options["plot_delay_list"])
1684+
& ~df_response["feature"].isin(cfg.features_off)
16851685
]
1686+
16861687
if df_response_plt.empty:
16871688
print("[Warning] Delays are empty, check 'plot_delay_list' in 'plot_options'.")
1689+
16881690
nice_plot_bars(
16891691
df_response_plt,
16901692
x="feature",

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "features-from-dlc"
3-
version = "2024.11.22"
3+
version = "2024.11.27"
44
authors = [{ name = "Guillaume Le Goc", email = "g.legoc@posteo.org" }]
55
description = "Behavioral quantification from DeepLabCut tracking"
66
readme = "README.md"

scripts/ffd_quantify.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Specify each entry, reading carefully what they do, then run the script with the 'ffd'
55
conda environment activated.
66
7-
Works with features_from_dlc v2024.11.22
7+
Works with features_from_dlc v2024.11.27
88
99
"""
1010

0 commit comments

Comments
 (0)