PyOPIA 2.16.12__tar.gz → 2.16.13__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.
- {pyopia-2.16.12 → pyopia-2.16.13}/PKG-INFO +1 -1
- pyopia-2.16.13/pyopia/__init__.py +1 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/pipeline.py +6 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/tests/test_pipeline.py +18 -1
- pyopia-2.16.12/pyopia/__init__.py +0 -1
- {pyopia-2.16.12 → pyopia-2.16.13}/.gitignore +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/LICENSE +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/README.md +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/auxillarydata.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/background.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/cf_metadata.json +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/classify.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/classify_torch.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/cli.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/dataexport/__init__.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/dataexport/ecotaxa.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/exampledata.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/instrument/__init__.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/instrument/common.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/instrument/holo.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/instrument/silcam.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/instrument/uvp.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/io.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/metadata.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/plotting.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/process.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/realtime.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/simulator/__init__.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/simulator/silcam.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/statistics.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/tests/__init__.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/tests/test_auxillarydata.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/tests/test_classify.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/tests/test_io.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/tests/test_notebooks.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/tests/test_process.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyopia/tests/test_realtime.py +0 -0
- {pyopia-2.16.12 → pyopia-2.16.13}/pyproject.toml +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.16.13"
|
|
@@ -351,6 +351,7 @@ class FilesToProcess:
|
|
|
351
351
|
'''
|
|
352
352
|
def __init__(self, glob_pattern=None):
|
|
353
353
|
self.files = None
|
|
354
|
+
self.glob_pattern = glob_pattern
|
|
354
355
|
self.background_files = []
|
|
355
356
|
self.chunked_files = []
|
|
356
357
|
if glob_pattern is not None:
|
|
@@ -399,6 +400,11 @@ class FilesToProcess:
|
|
|
399
400
|
strategy : str, optional
|
|
400
401
|
Strategy to use for chunking dataset, either `block` or `interleave`. Defult: `block`
|
|
401
402
|
'''
|
|
403
|
+
if len(self.files) == 0:
|
|
404
|
+
raise RuntimeError(
|
|
405
|
+
f'No raw files found for "{self.glob_pattern}". '
|
|
406
|
+
'Check the general.raw_files setting in your config file.'
|
|
407
|
+
)
|
|
402
408
|
if num_chunks > len(self.files) // 2:
|
|
403
409
|
raise RuntimeError('Number of chunks exceeds more than half the number of files to process. Use less chunks.')
|
|
404
410
|
self.chunk_files(num_chunks, strategy)
|
|
@@ -7,12 +7,13 @@ from glob import glob
|
|
|
7
7
|
import tempfile
|
|
8
8
|
import os
|
|
9
9
|
import numpy as np
|
|
10
|
+
import pytest
|
|
10
11
|
import skimage.io
|
|
11
12
|
|
|
12
13
|
import pyopia.exampledata as testdata
|
|
13
14
|
import pyopia.io
|
|
14
15
|
import pyopia.classify
|
|
15
|
-
from pyopia.pipeline import Pipeline
|
|
16
|
+
from pyopia.pipeline import FilesToProcess, Pipeline
|
|
16
17
|
import pyopia.process
|
|
17
18
|
import pyopia.statistics
|
|
18
19
|
import pyopia.background # noqa: F401
|
|
@@ -307,7 +308,23 @@ def test_per_class_concentration():
|
|
|
307
308
|
np.testing.assert_allclose(result.loc[ts_2, 'sample_volume_L'], sample_volume)
|
|
308
309
|
|
|
309
310
|
|
|
311
|
+
def test_files_to_process_raises_clear_error_for_no_matching_files(tmp_path):
|
|
312
|
+
'''Regression test for #279: an empty/non-matching raw_files pattern used to surface
|
|
313
|
+
as a misleading "Number of chunks exceeds..." RuntimeError instead of a clear
|
|
314
|
+
"no files found" error.
|
|
315
|
+
'''
|
|
316
|
+
empty_dir = tmp_path / 'empty'
|
|
317
|
+
empty_dir.mkdir()
|
|
318
|
+
glob_pattern = str(empty_dir / '*.silc')
|
|
319
|
+
|
|
320
|
+
raw_files = FilesToProcess(glob_pattern)
|
|
321
|
+
|
|
322
|
+
with pytest.raises(RuntimeError, match='No raw files found'):
|
|
323
|
+
raw_files.prepare_chunking(num_chunks=1, average_window=0, bgshift_function='pass')
|
|
324
|
+
|
|
325
|
+
|
|
310
326
|
if __name__ == "__main__":
|
|
311
327
|
test_holo_pipeline()
|
|
312
328
|
test_silcam_pipeline()
|
|
313
329
|
test_per_class_concentration()
|
|
330
|
+
test_files_to_process_raises_clear_error_for_no_matching_files()
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.16.12"
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|