xarray-behave 0.34.0__tar.gz → 0.34.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/PKG-INFO +1 -1
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/conda/xarray-behave/build.sh +3 -1
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/conda/xarray-behave/meta.yaml +1 -1
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/__init__.py +1 -1
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/event_utils.py +1 -1
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/gui/app.py +2 -2
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/gui/forms/das_train.yaml +24 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/gui/views.py +1 -1
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/io/annotations.py +6 -6
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/io/poses.py +2 -2
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/.github/workflows/publish.yaml +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/.gitignore +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/LICENSE +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/README.md +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/build_env.yml +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/conda/xarray-behave/bld.bat +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/conda/xarray-behave/conda_build_config.yaml +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/condarc.yml +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/doc/demo.ipynb +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/doc/demo_behavioral_features.ipynb +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/doc/demo_behavioral_features_large_group.ipynb +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/doc/ncb.mplstyle +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/pyproject.toml +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/setup.py +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/annot.py +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/gui/__init__.py +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/gui/audio_player.py +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/gui/das.py +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/gui/formbuilder.py +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/gui/forms/das_make.yaml +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/gui/forms/das_predict.yaml +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/gui/forms/envelope_computation.yaml +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/gui/forms/export_for_das.yaml +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/gui/forms/from_dir.yaml +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/gui/forms/from_file.yaml +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/gui/forms/from_zarr.yaml +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/gui/forms/spec_freq.yaml +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/gui/icon.png +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/gui/table.py +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/gui/utils.py +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/gui/view_dialog.py +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/gui/widgets.py +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/io/__init__.py +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/io/annotations_manual.py +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/io/audio.py +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/io/balltracks.py +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/io/movieparams.py +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/io/timestamps.py +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/io/tracks.py +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/loaders.py +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/metrics.py +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/xarray_behave.py +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/tests/test_annot.py +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/tests/test_assemble.py +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/tests/test_assemble_metrics.py +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/tests/test_imports.py +0 -0
- {xarray-behave-0.34.0 → xarray-behave-0.34.2}/tests/test_io.py +0 -0
|
@@ -4,6 +4,8 @@ export PIP_NO_INDEX=False
|
|
|
4
4
|
export PIP_NO_DEPENDENCIES=False
|
|
5
5
|
export PIP_IGNORE_INSTALLED=False
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
8
|
+
$PYTHON -m pip install simpleaudio -vv --no-dependencies
|
|
9
|
+
fi
|
|
8
10
|
$PYTHON -m pip install pkgutil_resolve_name -vv --no-dependencies
|
|
9
11
|
$PYTHON -m pip install xarray-behave[gui] -vv --no-dependencies
|
|
@@ -16,7 +16,6 @@ requirements:
|
|
|
16
16
|
host:
|
|
17
17
|
- python {{ python }}
|
|
18
18
|
- pip
|
|
19
|
-
- numpy>1.20 #<1.24
|
|
20
19
|
run:
|
|
21
20
|
- python {{ python }}
|
|
22
21
|
- defopt=6.3
|
|
@@ -32,6 +31,7 @@ requirements:
|
|
|
32
31
|
- scikit-learn
|
|
33
32
|
- zarr
|
|
34
33
|
- numba>=0.56
|
|
34
|
+
# - anaconda::_openmp_mutex>=5.1 # [linux and py>=3.11]
|
|
35
35
|
- xarray
|
|
36
36
|
- dask
|
|
37
37
|
- pyside2 # [not win]
|
|
@@ -16,7 +16,7 @@ def detect_events(ds):
|
|
|
16
16
|
dict: with event times or segment on/offsets.
|
|
17
17
|
"""
|
|
18
18
|
event_times = dict()
|
|
19
|
-
ds.song_events.data = ds.song_events.data.astype(
|
|
19
|
+
ds.song_events.data = ds.song_events.data.astype(float) # make sure this is non-bool so diff works
|
|
20
20
|
event_names = ds.song_events.event_types.data
|
|
21
21
|
event_categories = ds.song_events.event_categories.data
|
|
22
22
|
logger.info("Extracting event times from song_events:")
|
|
@@ -2000,7 +2000,7 @@ class PSV(MainWindow):
|
|
|
2000
2000
|
logger.info(f" Removed {old_len - new_len} duplicates in {self.current_event_name}.")
|
|
2001
2001
|
if self.event_times.categories[self.current_event_name] == "segment":
|
|
2002
2002
|
# get pos and neg crossings
|
|
2003
|
-
x = np.diff((self.envelope > self.slice_view.threshold).astype(
|
|
2003
|
+
x = np.diff((self.envelope > self.slice_view.threshold).astype(float))
|
|
2004
2004
|
onsets = np.where(x == 1)[0]
|
|
2005
2005
|
offsets = np.where(x == -1)[0]
|
|
2006
2006
|
# remove incomplete segments at bounds
|
|
@@ -2019,7 +2019,7 @@ class PSV(MainWindow):
|
|
|
2019
2019
|
std = self.thres_env_std * self.fs_song
|
|
2020
2020
|
win = scipy.signal.windows.gaussian(int(std * 6), std)
|
|
2021
2021
|
win /= np.sum(win)
|
|
2022
|
-
env = np.sqrt(np.convolve(self.y.astype(
|
|
2022
|
+
env = np.sqrt(np.convolve(self.y.astype(float) ** 2, win, mode="same"))
|
|
2023
2023
|
return env
|
|
2024
2024
|
|
|
2025
2025
|
def set_prev_channel(self, qt_keycode):
|
|
@@ -158,6 +158,30 @@ main:
|
|
|
158
158
|
help: Reduce learning rate if performance does not improve after patience epochs.
|
|
159
159
|
|
|
160
160
|
|
|
161
|
+
- name: morph
|
|
162
|
+
label: Postprocessing with trainable morphological kernels
|
|
163
|
+
type: stacked
|
|
164
|
+
default: "No"
|
|
165
|
+
options: "No,Yes"
|
|
166
|
+
|
|
167
|
+
"No":
|
|
168
|
+
|
|
169
|
+
"Yes":
|
|
170
|
+
- type: text
|
|
171
|
+
text: 'Clean up predictions using trainable kernels for opening and closing operations.'
|
|
172
|
+
|
|
173
|
+
- name: morph_nb_kernels
|
|
174
|
+
label: Number of morphological kernels
|
|
175
|
+
type: int
|
|
176
|
+
default: 1
|
|
177
|
+
range: 0, 100
|
|
178
|
+
- name: morph_kernel_duration
|
|
179
|
+
label: Duration of morphological kernels (samples)
|
|
180
|
+
type: int
|
|
181
|
+
default: 32
|
|
182
|
+
range: 1,1000
|
|
183
|
+
|
|
184
|
+
|
|
161
185
|
- name: postopt
|
|
162
186
|
label: Optimize postprocessing
|
|
163
187
|
type: stacked
|
|
@@ -256,7 +256,7 @@ class TraceView(pg.PlotWidget):
|
|
|
256
256
|
# plot active channel
|
|
257
257
|
x = self.m.x[:: self.m.step]
|
|
258
258
|
item = pg.PlotCurveItem(
|
|
259
|
-
x=x, y=np.array(self.m.y[:: self.m.step], dtype=
|
|
259
|
+
x=x, y=np.array(self.m.y[:: self.m.step], dtype=float), pen=pg.mkPen(color=[220, 220, 220], width=1)
|
|
260
260
|
)
|
|
261
261
|
self.addItem(item)
|
|
262
262
|
# self.autoRange(padding=0)
|
|
@@ -12,8 +12,8 @@ logger = logging.getLogger(__name__)
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
def fill_gaps(sine_pred, gap_dur=100):
|
|
15
|
-
onsets = np.where(np.diff(sine_pred.astype(
|
|
16
|
-
offsets = np.where(np.diff(sine_pred.astype(
|
|
15
|
+
onsets = np.where(np.diff(sine_pred.astype(int)) == 1)[0]
|
|
16
|
+
offsets = np.where(np.diff(sine_pred.astype(int)) == -1)[0]
|
|
17
17
|
if len(onsets) and len(offsets):
|
|
18
18
|
onsets = onsets[onsets < offsets[-1]]
|
|
19
19
|
offsets = offsets[offsets > onsets[0]]
|
|
@@ -26,8 +26,8 @@ def fill_gaps(sine_pred, gap_dur=100):
|
|
|
26
26
|
|
|
27
27
|
def remove_short(sine_pred, min_len=100):
|
|
28
28
|
# remove too short sine songs
|
|
29
|
-
onsets = np.where(np.diff(sine_pred.astype(
|
|
30
|
-
offsets = np.where(np.diff(sine_pred.astype(
|
|
29
|
+
onsets = np.where(np.diff(sine_pred.astype(int)) == 1)[0]
|
|
30
|
+
offsets = np.where(np.diff(sine_pred.astype(int)) == -1)[0]
|
|
31
31
|
if len(onsets) and len(offsets):
|
|
32
32
|
onsets = onsets[onsets < offsets[-1]]
|
|
33
33
|
offsets = offsets[offsets > onsets[0]]
|
|
@@ -73,8 +73,8 @@ class DAS(io.BaseProvider):
|
|
|
73
73
|
segment_labels = remove_short(segment_labels, min_len=0.02 * res["samplerate_Hz"])
|
|
74
74
|
|
|
75
75
|
# detect on and offset from binary labels
|
|
76
|
-
segment_onset_idx = np.where(np.diff(segment_labels.astype(
|
|
77
|
-
segment_offset_idx = np.where(np.diff(segment_labels.astype(
|
|
76
|
+
segment_onset_idx = np.where(np.diff(segment_labels.astype(float), prepend=0) == 1)[0].astype(float)
|
|
77
|
+
segment_offset_idx = np.where(np.diff(segment_labels.astype(float), append=0) == -1)[0].astype(float)
|
|
78
78
|
|
|
79
79
|
res["segment_onsets_seconds"] = np.append(
|
|
80
80
|
res["segment_onsets_seconds"], segment_onset_idx / res["samplerate_Hz"]
|
|
@@ -157,7 +157,7 @@ class Leap(Poses, io.BaseProvider):
|
|
|
157
157
|
|
|
158
158
|
with h5py.File(filename, "r") as f:
|
|
159
159
|
box_offset = f["box_centers"][:]
|
|
160
|
-
box_angle = f["fixed_angles"][:].astype(
|
|
160
|
+
box_angle = f["fixed_angles"][:].astype(float)
|
|
161
161
|
box_size = (f["box_size"].attrs["i0"], f["box_size"].attrs["i1"])
|
|
162
162
|
poses = f["positions"][:]
|
|
163
163
|
nb_flies = int(np.max(f["fly_id"]) + 1)
|
|
@@ -181,7 +181,7 @@ class Leap(Poses, io.BaseProvider):
|
|
|
181
181
|
box_offset = box_offset[first_pose_index:last_pose_index, ...]
|
|
182
182
|
box_angle = box_angle[first_pose_index:last_pose_index, ...]
|
|
183
183
|
poses = poses[first_pose_index:last_pose_index, ...]
|
|
184
|
-
poses = poses.astype(
|
|
184
|
+
poses = poses.astype(float)
|
|
185
185
|
|
|
186
186
|
# transform poses back to frame coordinates
|
|
187
187
|
origin = [b / 2 for b in box_size]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{xarray-behave-0.34.0 → xarray-behave-0.34.2}/doc/demo_behavioral_features_large_group.ipynb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/gui/forms/envelope_computation.yaml
RENAMED
|
File without changes
|
{xarray-behave-0.34.0 → xarray-behave-0.34.2}/src/xarray_behave/gui/forms/export_for_das.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|