xarray-behave 0.37.1__tar.gz → 0.37.3__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.37.1 → xarray_behave-0.37.3}/PKG-INFO +1 -1
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/conda/xarray-behave/meta.yaml +1 -2
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/__init__.py +1 -1
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/gui/app.py +10 -22
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/.github/workflows/publish.yaml +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/.gitignore +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/LICENSE +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/README.md +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/build_env.yml +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/conda/xarray-behave/bld.bat +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/conda/xarray-behave/build.sh +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/condarc.yml +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/doc/demo.ipynb +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/doc/demo_behavioral_features.ipynb +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/doc/demo_behavioral_features_large_group.ipynb +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/doc/ncb.mplstyle +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/pyproject.toml +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/setup.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/annot.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/event_utils.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/gui/__init__.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/gui/audio_player.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/gui/das.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/gui/formbuilder.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/gui/forms/das_make.yaml +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/gui/forms/das_predict.yaml +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/gui/forms/das_train.yaml +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/gui/forms/envelope_computation.yaml +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/gui/forms/export_for_das.yaml +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/gui/forms/from_dir.yaml +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/gui/forms/from_file.yaml +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/gui/forms/from_zarr.yaml +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/gui/forms/spec_freq.yaml +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/gui/icon.png +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/gui/table.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/gui/utils.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/gui/view_dialog.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/gui/views.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/gui/widgets.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/io/__init__.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/io/annotations.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/io/annotations_manual.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/io/audio.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/io/balltracks.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/io/movieparams.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/io/poses.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/io/samplestamps/__init__.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/io/samplestamps/samplestamps.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/io/samplestamps/utils.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/io/timestamps.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/io/tracks.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/loaders.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/metrics.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/xarray_behave.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/tests/test_annot.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/tests/test_assemble.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/tests/test_assemble_metrics.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/tests/test_imports.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/tests/test_io.py +0 -0
- {xarray_behave-0.37.1 → xarray_behave-0.37.3}/tests/test_sampstamps.py +0 -0
|
@@ -7,8 +7,7 @@ package:
|
|
|
7
7
|
version: "{{ version }}"
|
|
8
8
|
|
|
9
9
|
source:
|
|
10
|
-
url:
|
|
11
|
-
|
|
10
|
+
url: https://pypi.org/packages/source/x/xarray-behave/xarray_behave-{{ version }}.tar.gz
|
|
12
11
|
build:
|
|
13
12
|
number: 0
|
|
14
13
|
|
|
@@ -15,6 +15,7 @@ import defopt
|
|
|
15
15
|
import yaml
|
|
16
16
|
import h5py
|
|
17
17
|
import functools
|
|
18
|
+
import rich
|
|
18
19
|
|
|
19
20
|
import numpy as np
|
|
20
21
|
import scipy.interpolate
|
|
@@ -46,9 +47,7 @@ try:
|
|
|
46
47
|
from . import das
|
|
47
48
|
except Exception:
|
|
48
49
|
logger.warning(
|
|
49
|
-
"Failed to import the das module.\nIgnore if you do not want to use das.\
|
|
50
|
-
"Otherwise follow these instructions to install:\n"
|
|
51
|
-
"https://janclemenslab.org/das/install.html"
|
|
50
|
+
"Failed to import the das module.\nIgnore if you do not want to use das.\nOtherwise follow these instructions to install:\nhttps://janclemenslab.org/das/install.html"
|
|
52
51
|
)
|
|
53
52
|
|
|
54
53
|
sys.setrecursionlimit(10**6) # increase recursion limit to avoid errors when keeping key pressed for a long time
|
|
@@ -537,7 +536,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
|
537
536
|
cmd = "python3 -m das.train"
|
|
538
537
|
# FIXME formatting
|
|
539
538
|
for key, val in form_data.items():
|
|
540
|
-
cmd += f" --{key.replace('_','-')} {val}"
|
|
539
|
+
cmd += f" --{key.replace('_', '-')} {val}"
|
|
541
540
|
with open(savefilename, "w") as f:
|
|
542
541
|
f.write(cmd)
|
|
543
542
|
|
|
@@ -719,9 +718,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
|
719
718
|
params = das.utils.load_params(model_path)
|
|
720
719
|
if audio.shape[0] < params["nb_hist"]:
|
|
721
720
|
logger.warning(
|
|
722
|
-
f" Aborting. Audio has fewer samples ({audio.shape[0]}) shorter"
|
|
723
|
-
f" than network chunk size ({params['nb_hist']})."
|
|
724
|
-
" Fix by select longer audio."
|
|
721
|
+
f" Aborting. Audio has fewer samples ({audio.shape[0]}) shorter than network chunk size ({params['nb_hist']}). Fix by select longer audio."
|
|
725
722
|
)
|
|
726
723
|
return
|
|
727
724
|
|
|
@@ -737,14 +734,6 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
|
737
734
|
logger.info(" Running inference on audio.")
|
|
738
735
|
logger.info(f" Model from {model_path}.")
|
|
739
736
|
params = das.utils.load_params(model_path)
|
|
740
|
-
fs_model = params["samplerate_x_Hz"]
|
|
741
|
-
fs_audio = self.ds.song_raw.attrs["sampling_rate_Hz"]
|
|
742
|
-
|
|
743
|
-
if form_data["resample"] and fs_audio and fs_audio != fs_model:
|
|
744
|
-
logger.info(f" Resampling. Audio rate is {fs_audio}Hz but model was trained on data with {fs_model}Hz.")
|
|
745
|
-
audio = das.utils.resample(audio, fs_audio, fs_model)
|
|
746
|
-
|
|
747
|
-
import rich
|
|
748
737
|
|
|
749
738
|
rich.print(form_data)
|
|
750
739
|
events, segments, _, _ = das.predict.predict(
|
|
@@ -762,7 +751,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
|
762
751
|
bandpass_low_freq=form_data["bandpass_low_freq"],
|
|
763
752
|
bandpass_up_freq=form_data["bandpass_up_freq"],
|
|
764
753
|
resample=form_data["resample"],
|
|
765
|
-
fs_audio=
|
|
754
|
+
fs_audio=self.fs_song,
|
|
766
755
|
)
|
|
767
756
|
|
|
768
757
|
# Process detected song
|
|
@@ -872,8 +861,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
|
872
861
|
pass
|
|
873
862
|
except KeyError:
|
|
874
863
|
logger.info(
|
|
875
|
-
f"{filename} no sample rate info in NPZ file."
|
|
876
|
-
f"Need to save 'samplerate' variable with the audio data. Defaulting to {samplerate}"
|
|
864
|
+
f"{filename} no sample rate info in NPZ file.Need to save 'samplerate' variable with the audio data. Defaulting to {samplerate}"
|
|
877
865
|
)
|
|
878
866
|
elif (
|
|
879
867
|
filename.endswith(".h5")
|
|
@@ -2413,7 +2401,7 @@ class PSV(MainWindow):
|
|
|
2413
2401
|
|
|
2414
2402
|
modifiers = QtWidgets.QApplication.keyboardModifiers()
|
|
2415
2403
|
|
|
2416
|
-
if mouseButton ==
|
|
2404
|
+
if mouseButton == QtCore.Qt.MouseButton.LeftButton and modifiers == QtCore.Qt.ControlModifier: # change event type
|
|
2417
2405
|
self.sinet0 = None
|
|
2418
2406
|
|
|
2419
2407
|
if not self.edit_only_current_events:
|
|
@@ -2436,7 +2424,7 @@ class PSV(MainWindow):
|
|
|
2436
2424
|
f" Changed segment at {changed_time[0]:1.4f}:{changed_time[1]:1.4f} from {old_name} to {new_name}."
|
|
2437
2425
|
)
|
|
2438
2426
|
self.update_xy()
|
|
2439
|
-
elif mouseButton ==
|
|
2427
|
+
elif mouseButton == QtCore.Qt.MouseButton.LeftButton: # add event
|
|
2440
2428
|
if self.current_event_index is not None:
|
|
2441
2429
|
if self.event_times.categories[self.current_event_name] == "segment":
|
|
2442
2430
|
if self.sinet0 is None:
|
|
@@ -2467,7 +2455,7 @@ class PSV(MainWindow):
|
|
|
2467
2455
|
self.update_xy()
|
|
2468
2456
|
else:
|
|
2469
2457
|
self.sinet0 = None
|
|
2470
|
-
elif mouseButton ==
|
|
2458
|
+
elif mouseButton == QtCore.Qt.MouseButton.RightButton: # delete nearest event
|
|
2471
2459
|
self.spec_view.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
|
|
2472
2460
|
self.slice_view.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
|
|
2473
2461
|
self.annot_view.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
|
|
@@ -2555,7 +2543,7 @@ class PSV(MainWindow):
|
|
|
2555
2543
|
)
|
|
2556
2544
|
self.event_times.delete_range(name, t0, t1, strict=False)
|
|
2557
2545
|
if len(within_range_times):
|
|
2558
|
-
logger.info(f" {len(within_range_times)} events of {name} to {name[
|
|
2546
|
+
logger.info(f" {len(within_range_times)} events of {name} to {name[: -len(proposal_suffix)]}")
|
|
2559
2547
|
# update event selector in case the event did not exist yet
|
|
2560
2548
|
self.nb_eventtypes = len(self.event_times)
|
|
2561
2549
|
self.eventtype_colors = utils.make_colors(self.nb_eventtypes)
|
|
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.37.1 → xarray_behave-0.37.3}/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
|
|
File without changes
|
{xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/gui/forms/envelope_computation.yaml
RENAMED
|
File without changes
|
{xarray_behave-0.37.1 → xarray_behave-0.37.3}/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
|
{xarray_behave-0.37.1 → xarray_behave-0.37.3}/src/xarray_behave/io/samplestamps/samplestamps.py
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
|