Skip to content

Commit a2ec921

Browse files
Bug fixes, WIP
1 parent 1a1c0b4 commit a2ec921

File tree

6 files changed

+16
-27
lines changed

6 files changed

+16
-27
lines changed

.github/workflows/testing.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ jobs:
3535
python -m pip install --upgrade pip
3636
pip install -r requirements/runtime.txt
3737
pip install -r requirements/optional.txt
38+
cd tpl/pyastar2d
39+
pip install -e .
40+
cd ../../
41+
pip install -e .
3842
3943
- name: Check with pre-commit
4044
run: |

README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,16 +200,16 @@ Reference `pre-commit's installation instructions <https://pre-commit.com/#insta
200200
The code base has been formatted by `Black <https://black.readthedocs.io/en/stable/>`_. Furthermore, try to conform to ``PEP8``. You should set up your preferred editor to use ``flake8`` as its Python linter, but pre-commit will ensure compliance before a git commit is completed. This will use the ``flake8`` configuration within ``setup.cfg``, which ignores several errors and stylistic considerations. See the ``setup.cfg`` file for a full and accurate listing of stylistic codes to ignore.
201201

202202

203-
.. |Tests| image:: https://github.com/Kitware/batbot/actions/workflows/testing.yml/badge.svg?branch=main
204-
:target: https://github.com/Kitware/batbot/actions/workflows/testing.yml
203+
.. |Tests| image:: https://github.com/Kitware/batbot/actions/workflows/testing.yaml/badge.svg?branch=main
204+
:target: https://github.com/Kitware/batbot/actions/workflows/testing.yaml
205205
:alt: GitHub CI
206206

207207
.. |Codecov| image:: https://codecov.io/gh/Kitware/batbot/branch/main/graph/badge.svg?token=FR6ITMWQNI
208208
:target: https://app.codecov.io/gh/Kitware/batbot
209209
:alt: Codecov
210210

211-
.. |Wheel| image:: https://github.com/Kitware/batbot/actions/workflows/python-publish.yml/badge.svg
212-
:target: https://github.com/Kitware/batbot/actions/workflows/python-publish.yml
211+
.. |Wheel| image:: https://github.com/Kitware/batbot/actions/workflows/python-publish.yaml/badge.svg
212+
:target: https://github.com/Kitware/batbot/actions/workflows/python-publish.yaml
213213
:alt: Python Wheel
214214

215215
.. |Docker| image:: https://img.shields.io/docker/image-size/kitware/batbot/latest

batbot/spectrogram/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def plot_histogram(
115115
output_filename='histogram.png',
116116
):
117117
if output_path is None:
118-
return
118+
return None, None, (None, None)
119119

120120
if max_val is None:
121121
max_val = int(image.max())
@@ -1253,7 +1253,7 @@ def calculate_harmonic_and_echo_flags(
12531253

12541254
@lp
12551255
def compute_wrapper(
1256-
wav_filepath, annotations=None, output_folder='.', bitdepth=16, debug=True, **kwargs
1256+
wav_filepath, annotations=None, output_folder='.', bitdepth=16, debug=False, **kwargs
12571257
):
12581258
"""
12591259
Compute the spectrograms for a given input WAV and saves them to disk.
@@ -1481,7 +1481,7 @@ def compute_wrapper(
14811481

14821482
for key in segments:
14831483
value = segments[key]
1484-
segments[key] = np.hstack(value) if len(value) > 0 else None.copy()
1484+
segments[key] = np.hstack(value) if len(value) > 0 else stft_db.copy()
14851485

14861486
if debug_path:
14871487
cv2.imwrite(join(debug_path, 'spectrogram.tif'), stft_db, [cv2.IMWRITE_TIFF_COMPRESSION, 1])

requirements/optional.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ black
22
codecov
33
coverage
44
flake8
5-
gradio
5+
# gradio
66
imageio
77
ipython
88
isort
99
line_profiler
10-
onnx
11-
onnxruntime
10+
# onnx
11+
# onnxruntime
1212
pre-commit
1313
pytest
1414
pytest-benchmark[histogram]
@@ -24,6 +24,6 @@ rstcheck
2424
rstcheck[sphinx]
2525
Sphinx>=5,<6
2626
sphinx_rtd_theme
27-
torch
28-
torchvision
27+
# torch
28+
# torchvision
2929
xdoctest

setup.cfg

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,16 @@ platforms = any
1919
include_package_data = True
2020
install_requires =
2121
click
22-
codecov
23-
coverage
2422
cryptography
2523
cython
26-
gradio
27-
imgaug
2824
librosa
2925
matplotlib
3026
numpy
31-
onnxruntime
3227
opencv-python-headless
3328
Pillow
3429
pooch
3530
rich
3631
sphinx-click
37-
torch
38-
torchvision
3932
tqdm
4033
python_requires = >=3.7
4134

tests/test_batbot.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
import batbot
22

33

4-
def test_fetch():
5-
batbot.fetch(pull=False)
6-
batbot.fetch(pull=True)
7-
8-
batbot.fetch(pull=False, config='usgs')
9-
batbot.fetch(pull=True, config='usgs')
10-
11-
124
def test_example():
135
batbot.example()

0 commit comments

Comments
 (0)