xarray-behave 0.35.3__tar.gz → 0.35.4__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.3 → xarray-behave-0.35.4}/.github/workflows/publish.yaml +4 -4
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/PKG-INFO +1 -1
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/conda/xarray-behave/meta.yaml +8 -10
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/__init__.py +1 -1
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/annot.py +14 -6
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/gui/app.py +22 -2
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/gui/views.py +9 -3
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/io/poses.py +6 -2
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/.gitignore +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/LICENSE +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/README.md +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/build_env.yml +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/conda/xarray-behave/bld.bat +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/conda/xarray-behave/build.sh +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/conda/xarray-behave/conda_build_config.yaml +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/condarc.yml +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/doc/demo.ipynb +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/doc/demo_behavioral_features.ipynb +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/doc/demo_behavioral_features_large_group.ipynb +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/doc/ncb.mplstyle +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/pyproject.toml +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/setup.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/event_utils.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/gui/__init__.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/gui/audio_player.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/gui/das.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/gui/formbuilder.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/gui/forms/das_make.yaml +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/gui/forms/das_predict.yaml +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/gui/forms/das_train.yaml +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/gui/forms/envelope_computation.yaml +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/gui/forms/export_for_das.yaml +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/gui/forms/from_dir.yaml +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/gui/forms/from_file.yaml +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/gui/forms/from_zarr.yaml +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/gui/forms/spec_freq.yaml +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/gui/icon.png +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/gui/table.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/gui/utils.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/gui/view_dialog.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/gui/widgets.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/io/__init__.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/io/annotations.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/io/annotations_manual.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/io/audio.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/io/balltracks.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/io/movieparams.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/io/timestamps.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/io/tracks.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/loaders.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/metrics.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/src/xarray_behave/xarray_behave.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/tests/test_annot.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/tests/test_assemble.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/tests/test_assemble_metrics.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/tests/test_imports.py +0 -0
- {xarray-behave-0.35.3 → xarray-behave-0.35.4}/tests/test_io.py +0 -0
|
@@ -19,11 +19,11 @@ jobs:
|
|
|
19
19
|
strategy:
|
|
20
20
|
fail-fast: False
|
|
21
21
|
matrix:
|
|
22
|
-
python-version: [
|
|
22
|
+
python-version: ['3.10']
|
|
23
23
|
os: [ubuntu-latest, windows-latest, macOS-13, macOS-14]
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
include:
|
|
25
|
+
- python-version: 3.9
|
|
26
|
+
os: windows-latest
|
|
27
27
|
defaults: # https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell
|
|
28
28
|
run:
|
|
29
29
|
shell: bash -l {0}
|
|
@@ -16,6 +16,7 @@ requirements:
|
|
|
16
16
|
host:
|
|
17
17
|
- python {{ python }}
|
|
18
18
|
- pip
|
|
19
|
+
- numpy=1.23
|
|
19
20
|
run:
|
|
20
21
|
- python {{ python }}
|
|
21
22
|
- defopt=6.3
|
|
@@ -24,30 +25,27 @@ requirements:
|
|
|
24
25
|
- h5py
|
|
25
26
|
- librosa>0.8
|
|
26
27
|
- matplotlib
|
|
27
|
-
- matplotlib-scalebar
|
|
28
28
|
- pandas
|
|
29
29
|
- scipy>=1.9
|
|
30
30
|
- peakutils
|
|
31
31
|
- pyyaml
|
|
32
32
|
- scikit-learn
|
|
33
33
|
- zarr
|
|
34
|
-
- numba
|
|
34
|
+
- numba
|
|
35
35
|
- xarray
|
|
36
36
|
- dask
|
|
37
|
-
|
|
38
|
-
- conda-forge::
|
|
39
|
-
- conda-forge::
|
|
40
|
-
-
|
|
41
|
-
- pyside2 # [win and py
|
|
42
|
-
-
|
|
43
|
-
- pyqtgraph>0.12.2
|
|
37
|
+
- conda-forge::pyside2
|
|
38
|
+
# - conda-forge::pyside2 # [linux or osx or arm64]
|
|
39
|
+
# - conda-forge::pyside6 # [win and py>39]
|
|
40
|
+
# - conda-forge::pyside2 # [osx or arm64]
|
|
41
|
+
# - pyside2 # [win and py==39]
|
|
42
|
+
- pyqtgraph>0.12
|
|
44
43
|
- qtpy
|
|
45
44
|
- superqt
|
|
46
45
|
- rich
|
|
47
46
|
- colorcet
|
|
48
47
|
- python-sounddevice
|
|
49
48
|
- scikit-image
|
|
50
|
-
# - opencv
|
|
51
49
|
- ffmpeg
|
|
52
50
|
- pyvideoreader
|
|
53
51
|
- samplestamps>=0.6
|
|
@@ -347,9 +347,9 @@ class Events(UserDict):
|
|
|
347
347
|
event_at_time = matching_start < time
|
|
348
348
|
elif self.categories[name] == "event":
|
|
349
349
|
if nearest_is_start:
|
|
350
|
-
event_at_time = np.abs(time - nearest_start)
|
|
350
|
+
event_at_time = np.abs(time - nearest_start) <= tol
|
|
351
351
|
else:
|
|
352
|
-
event_at_time = np.abs(time - nearest_stop)
|
|
352
|
+
event_at_time = np.abs(time - nearest_stop) <= tol
|
|
353
353
|
else:
|
|
354
354
|
event_at_time = False
|
|
355
355
|
|
|
@@ -359,7 +359,13 @@ class Events(UserDict):
|
|
|
359
359
|
return index
|
|
360
360
|
|
|
361
361
|
def change_name(
|
|
362
|
-
self,
|
|
362
|
+
self,
|
|
363
|
+
time: float,
|
|
364
|
+
new_name: str,
|
|
365
|
+
tol: float = 0,
|
|
366
|
+
min_time: Optional[float] = None,
|
|
367
|
+
max_time: Optional[float] = None,
|
|
368
|
+
old_name: Optional[str] = None,
|
|
363
369
|
) -> Tuple[Optional[List[int]], Optional[str], Optional[str]]:
|
|
364
370
|
"""Change the name of the annotation.
|
|
365
371
|
|
|
@@ -369,19 +375,21 @@ class Events(UserDict):
|
|
|
369
375
|
tol (float, optional): Tolerance for matching events. Defaults to 0.
|
|
370
376
|
min_time (Optional[float], optional): _description_. Defaults to None.
|
|
371
377
|
max_time (Optional[float], optional): _description_. Defaults to None.
|
|
372
|
-
|
|
378
|
+
old_name (Optional[str]): name of event to move. Defaults to None.
|
|
373
379
|
Returns:
|
|
374
380
|
Tuple[List[int], str, str]: ([start_seconds, stop_seconds], old_name, new_name
|
|
375
381
|
Tuple[None, None, None] if no event near time, or new_name is old_name
|
|
376
382
|
"""
|
|
377
|
-
|
|
383
|
+
if old_name is None:
|
|
384
|
+
name = self._get_name_of_nearest(time, min_time, max_time)
|
|
385
|
+
else:
|
|
386
|
+
name = old_name
|
|
378
387
|
|
|
379
388
|
# nothing to do
|
|
380
389
|
if name is None or name == new_name or self.categories[name] != self.categories[new_name]:
|
|
381
390
|
return None, None, None
|
|
382
391
|
|
|
383
392
|
index = self._get_index_of_nearest(time, name, tol, min_time, max_time)
|
|
384
|
-
print(index)
|
|
385
393
|
if index is not None:
|
|
386
394
|
changed_time = self[name][index, :]
|
|
387
395
|
old_name = name
|
|
@@ -1357,7 +1357,7 @@ class PSV(MainWindow):
|
|
|
1357
1357
|
self.spec_win = 200
|
|
1358
1358
|
self.show_songevents = True
|
|
1359
1359
|
self.movable_events = True
|
|
1360
|
-
self.edit_only_current_events =
|
|
1360
|
+
self.edit_only_current_events = False
|
|
1361
1361
|
self.show_all_channels = True
|
|
1362
1362
|
self.select_loudest_channel = False
|
|
1363
1363
|
self.threshold_mode = False
|
|
@@ -2303,6 +2303,16 @@ class PSV(MainWindow):
|
|
|
2303
2303
|
f" Moved {event_name_to_move} from t=[{region.bounds[0]:1.4f}:{region.bounds[1]:1.4f}] to [{new_region[0]:1.4f}:{new_region[1]:1.4f}] seconds."
|
|
2304
2304
|
)
|
|
2305
2305
|
|
|
2306
|
+
# FIXME for moving annotations in ethogram - fails in pyside6
|
|
2307
|
+
if self.annot_view.mousePoint is not None:
|
|
2308
|
+
mp = self.annot_view.mousePoint.y()
|
|
2309
|
+
if mp > 0 and mp < 1:
|
|
2310
|
+
new_event_idx = int(mp * self.nb_eventtypes)
|
|
2311
|
+
new_event_name = self.event_times.names[new_event_idx]
|
|
2312
|
+
_, old_name, new_name = self.event_times.change_name(new_region[0], new_event_name)
|
|
2313
|
+
if old_name is not None:
|
|
2314
|
+
logger.info(f" Changed from {old_name} to {new_name}.")
|
|
2315
|
+
|
|
2306
2316
|
self.update_xy()
|
|
2307
2317
|
|
|
2308
2318
|
def on_position_change_finished(self, position):
|
|
@@ -2312,11 +2322,21 @@ class PSV(MainWindow):
|
|
|
2312
2322
|
event_name_to_move = self.current_event_name
|
|
2313
2323
|
if self.current_event_index != position.event_index:
|
|
2314
2324
|
event_name_to_move = self.event_times.names[position.event_index]
|
|
2315
|
-
|
|
2325
|
+
print(position.pos(), position.position)
|
|
2316
2326
|
new_position = position.pos()[0]
|
|
2317
2327
|
self.event_times.move_time(event_name_to_move, position.position, new_position)
|
|
2318
2328
|
logger.info(f" Moved {event_name_to_move} from t={position.position:1.4f} to {new_position:1.4f} seconds.")
|
|
2319
2329
|
|
|
2330
|
+
# FIXME for moving annotations in ethogram - fails in pyside6
|
|
2331
|
+
if self.annot_view.mousePoint is not None:
|
|
2332
|
+
mp = self.annot_view.mousePoint.y()
|
|
2333
|
+
if mp > 0 and mp < 1:
|
|
2334
|
+
new_event_idx = int(mp * self.nb_eventtypes)
|
|
2335
|
+
new_event_name = self.event_times.names[new_event_idx]
|
|
2336
|
+
_, old_name, new_name = self.event_times.change_name(new_position, new_event_name, old_name=event_name_to_move)
|
|
2337
|
+
if old_name is not None:
|
|
2338
|
+
logger.info(f" Changed from {old_name} to {new_name}.")
|
|
2339
|
+
|
|
2320
2340
|
self.update_xy()
|
|
2321
2341
|
|
|
2322
2342
|
def on_position_dragged(self, fly, pos, offset):
|
|
@@ -572,8 +572,6 @@ class AnnotView(pg.PlotWidget):
|
|
|
572
572
|
# additionally make names of trace and event arrays in ds args?
|
|
573
573
|
super().__init__()
|
|
574
574
|
self.setMouseEnabled(x=False, y=False)
|
|
575
|
-
# this should be just a link/ref so changes in ds made by the controller will propagate
|
|
576
|
-
# mabe make Model as thin wrapper around ds that also handles ion and use ref to Modle instance
|
|
577
575
|
self.disableAutoRange()
|
|
578
576
|
self.enableAutoRange(False, False)
|
|
579
577
|
self.setDefaultPadding(0.0)
|
|
@@ -655,12 +653,20 @@ class AnnotView(pg.PlotWidget):
|
|
|
655
653
|
return np.interp(pos, self.xrange, self.m.trange)
|
|
656
654
|
|
|
657
655
|
def _click(self, event):
|
|
658
|
-
event.accept()
|
|
656
|
+
# event.accept()
|
|
659
657
|
pos = event.pos()
|
|
660
658
|
mouseT = self.getPlotItem().getViewBox().mapSceneToView(pos).x()
|
|
661
659
|
self.callback(mouseT, event.button())
|
|
662
660
|
|
|
661
|
+
# def mouseMoveEvent(self, ev):
|
|
662
|
+
# pos = ev.pos()
|
|
663
|
+
# # print(pos)
|
|
664
|
+
# if self.sceneBoundingRect().contains(pos):
|
|
665
|
+
# self.mousePoint = self.getPlotItem().vb.mapSceneToView(pos)
|
|
666
|
+
# print(self.mousePoint)
|
|
667
|
+
|
|
663
668
|
def mouseMoved(self, pos):
|
|
669
|
+
# pass
|
|
664
670
|
if self.sceneBoundingRect().contains(pos):
|
|
665
671
|
self.mousePoint = self.getPlotItem().vb.mapSceneToView(pos)
|
|
666
672
|
|
|
@@ -293,8 +293,12 @@ class Sleap(Poses, io.BaseProvider):
|
|
|
293
293
|
|
|
294
294
|
# indices and coordinate logic for sleap tracks. This could be cleaned/simplified later
|
|
295
295
|
nb_flies = tracks.shape[0]
|
|
296
|
-
|
|
297
|
-
|
|
296
|
+
try:
|
|
297
|
+
thorax_idx = np.argwhere(pose_parts == b"thorax")[0][0]
|
|
298
|
+
head_idx = np.argwhere(pose_parts == b"head")[0][0]
|
|
299
|
+
except IndexError:
|
|
300
|
+
thorax_idx = 0
|
|
301
|
+
head_idx = 1
|
|
298
302
|
x_idx = 0
|
|
299
303
|
y_idx = 1
|
|
300
304
|
|
|
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.3 → xarray-behave-0.35.4}/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.3 → xarray-behave-0.35.4}/src/xarray_behave/gui/forms/envelope_computation.yaml
RENAMED
|
File without changes
|
{xarray-behave-0.35.3 → xarray-behave-0.35.4}/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
|