xarray-behave 0.35.5__tar.gz → 0.35.7__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.35.5 → xarray-behave-0.35.7}/PKG-INFO +1 -1
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/__init__.py +1 -1
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/annot.py +16 -1
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/gui/app.py +12 -10
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/xarray_behave.py +17 -13
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/.github/workflows/publish.yaml +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/.gitignore +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/LICENSE +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/README.md +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/build_env.yml +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/conda/xarray-behave/bld.bat +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/conda/xarray-behave/build.sh +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/conda/xarray-behave/conda_build_config.yaml +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/conda/xarray-behave/meta.yaml +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/condarc.yml +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/doc/demo.ipynb +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/doc/demo_behavioral_features.ipynb +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/doc/demo_behavioral_features_large_group.ipynb +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/doc/ncb.mplstyle +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/pyproject.toml +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/setup.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/event_utils.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/gui/__init__.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/gui/audio_player.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/gui/das.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/gui/formbuilder.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/gui/forms/das_make.yaml +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/gui/forms/das_predict.yaml +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/gui/forms/das_train.yaml +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/gui/forms/envelope_computation.yaml +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/gui/forms/export_for_das.yaml +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/gui/forms/from_dir.yaml +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/gui/forms/from_file.yaml +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/gui/forms/from_zarr.yaml +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/gui/forms/spec_freq.yaml +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/gui/icon.png +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/gui/table.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/gui/utils.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/gui/view_dialog.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/gui/views.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/gui/widgets.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/io/__init__.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/io/annotations.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/io/annotations_manual.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/io/audio.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/io/balltracks.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/io/movieparams.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/io/poses.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/io/timestamps.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/io/tracks.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/loaders.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/metrics.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/tests/test_annot.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/tests/test_assemble.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/tests/test_assemble_metrics.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/tests/test_imports.py +0 -0
- {xarray-behave-0.35.5 → xarray-behave-0.35.7}/tests/test_io.py +0 -0
|
@@ -87,7 +87,7 @@ class Events(UserDict):
|
|
|
87
87
|
):
|
|
88
88
|
if possible_event_names is None:
|
|
89
89
|
possible_event_names = []
|
|
90
|
-
unique_names = list(
|
|
90
|
+
unique_names = list(np.unique(names)) # use `np.unique` instead of `set` to have reproducible order of names for now
|
|
91
91
|
unique_names.extend(possible_event_names)
|
|
92
92
|
dct = {name: [] for name in unique_names}
|
|
93
93
|
|
|
@@ -548,6 +548,18 @@ class Events(UserDict):
|
|
|
548
548
|
self[name] = np.delete(self[name], indices, axis=0)
|
|
549
549
|
return indices
|
|
550
550
|
|
|
551
|
+
def sort(self, names: Optional[List[str]] = None):
|
|
552
|
+
"""Sort annotations by start time.
|
|
553
|
+
|
|
554
|
+
Args:
|
|
555
|
+
names (Optional[List[str]], optional): _description_. Defaults to None.
|
|
556
|
+
"""
|
|
557
|
+
if names is None:
|
|
558
|
+
names = self.names
|
|
559
|
+
|
|
560
|
+
for name in names:
|
|
561
|
+
self[name] = self[name][np.argsort(self[name][:, 0]), :]
|
|
562
|
+
|
|
551
563
|
def find_next(self, t: float, names: Optional[List[str]] = None):
|
|
552
564
|
"""Find event starting after `t` of type in names.
|
|
553
565
|
|
|
@@ -564,7 +576,9 @@ class Events(UserDict):
|
|
|
564
576
|
names = self.names
|
|
565
577
|
|
|
566
578
|
nxt = []
|
|
579
|
+
|
|
567
580
|
for name in names:
|
|
581
|
+
self.sort([name])
|
|
568
582
|
cmp = self[name][:, 0] > t
|
|
569
583
|
if np.any(cmp):
|
|
570
584
|
nxt.append(self[name][np.argmax(cmp), 0])
|
|
@@ -588,6 +602,7 @@ class Events(UserDict):
|
|
|
588
602
|
|
|
589
603
|
nxt = []
|
|
590
604
|
for name in names:
|
|
605
|
+
self.sort([name])
|
|
591
606
|
cmp = self[name][:, 1] < t
|
|
592
607
|
if np.any(cmp):
|
|
593
608
|
nxt.append(self[name][np.argmin(cmp) - 1, 0])
|
|
@@ -2084,24 +2084,26 @@ class PSV(MainWindow):
|
|
|
2084
2084
|
self.update_frame()
|
|
2085
2085
|
|
|
2086
2086
|
def set_prev_cuepoint(self, qt_keycode):
|
|
2087
|
-
if self.edit_only_current_events: # of the currently active type
|
|
2088
|
-
|
|
2089
|
-
else: # of any type
|
|
2090
|
-
|
|
2091
|
-
|
|
2087
|
+
# if self.edit_only_current_events: # of the currently active type
|
|
2088
|
+
# names = [self.current_event_name]
|
|
2089
|
+
# else: # of any type
|
|
2090
|
+
# names = self.event_times.names
|
|
2091
|
+
names = [self.current_event_name]
|
|
2092
2092
|
t = (self.t0 - 1) / self.fs_song
|
|
2093
2093
|
nxt = self.event_times.find_prev(t, names)
|
|
2094
|
+
|
|
2094
2095
|
if nxt is not None:
|
|
2095
2096
|
self.t0 = nxt * self.fs_song
|
|
2096
2097
|
|
|
2097
2098
|
def set_next_cuepoint(self, qt_keycode):
|
|
2098
|
-
if self.edit_only_current_events: # of the currently active type
|
|
2099
|
-
|
|
2100
|
-
else: # of any type
|
|
2101
|
-
|
|
2102
|
-
|
|
2099
|
+
# if self.edit_only_current_events: # of the currently active type
|
|
2100
|
+
# names = [self.current_event_name]
|
|
2101
|
+
# else: # of any type
|
|
2102
|
+
# names = self.event_times.names
|
|
2103
|
+
names = [self.current_event_name]
|
|
2103
2104
|
t = (self.t0 + 1) / self.fs_song
|
|
2104
2105
|
nxt = self.event_times.find_next(t, names)
|
|
2106
|
+
|
|
2105
2107
|
if nxt is not None:
|
|
2106
2108
|
self.t0 = nxt * self.fs_song
|
|
2107
2109
|
|
|
@@ -177,6 +177,7 @@ def assemble(
|
|
|
177
177
|
ss_ball, last_sample_number_ball, sampling_rate_ball = ld.load_times(filepath_timestamps_ball, filepath_daq)
|
|
178
178
|
|
|
179
179
|
filepath_timestamps_movie = Path(root, res_path, datename, f"{datename}_movieframes.csv")
|
|
180
|
+
ss_movie = None
|
|
180
181
|
if os.path.exists(filepath_daq) and os.path.exists(filepath_timestamps_movie):
|
|
181
182
|
ss_movie, last_sample_number_movie, sampling_rate_movie = ld.load_movietimes(filepath_timestamps_movie, filepath_daq)
|
|
182
183
|
|
|
@@ -284,20 +285,23 @@ def assemble(
|
|
|
284
285
|
with_movieparams = False
|
|
285
286
|
if include_movieparams:
|
|
286
287
|
logger.info("Loading movie params:")
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
try:
|
|
290
|
-
xr_movieparams = movieparams_loader.make(movieparams_loader.path)
|
|
291
|
-
xr_movieparams = add_time(xr_movieparams, ss_movie, dim="frame_number_movie", suffix="_movie")
|
|
292
|
-
|
|
293
|
-
logger.info(f" {movieparams_loader.path} loaded.")
|
|
294
|
-
with_movieparams = True
|
|
295
|
-
except Exception as e:
|
|
296
|
-
logger.info(f" Loading {movieparams_loader.path} failed.")
|
|
297
|
-
logger.exception(e)
|
|
288
|
+
if ss_movie is None:
|
|
289
|
+
logger.warning(" Failed loading movie params - no ss_movie")
|
|
298
290
|
else:
|
|
299
|
-
|
|
300
|
-
|
|
291
|
+
movieparams_loader = io.get_loader(kind="movieparams", basename=os.path.join(root, dat_path, datename, datename))
|
|
292
|
+
if movieparams_loader:
|
|
293
|
+
try:
|
|
294
|
+
xr_movieparams = movieparams_loader.make(movieparams_loader.path)
|
|
295
|
+
xr_movieparams = add_time(xr_movieparams, ss_movie, dim="frame_number_movie", suffix="_movie")
|
|
296
|
+
|
|
297
|
+
logger.info(f" {movieparams_loader.path} loaded.")
|
|
298
|
+
with_movieparams = True
|
|
299
|
+
except Exception as e:
|
|
300
|
+
logger.info(f" Loading {movieparams_loader.path} failed.")
|
|
301
|
+
logger.exception(e)
|
|
302
|
+
else:
|
|
303
|
+
logger.warning(" Found no movie params data.")
|
|
304
|
+
logger.info("Done.")
|
|
301
305
|
|
|
302
306
|
# Init empty and event data
|
|
303
307
|
auto_event_seconds: Dict[str, Any] = {}
|
|
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
|
{xarray-behave-0.35.5 → xarray-behave-0.35.7}/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
|
|
File without changes
|
{xarray-behave-0.35.5 → xarray-behave-0.35.7}/src/xarray_behave/gui/forms/envelope_computation.yaml
RENAMED
|
File without changes
|
{xarray-behave-0.35.5 → xarray-behave-0.35.7}/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
|
|
File without changes
|
|
File without changes
|