PyOPIA 2.5.11__tar.gz → 2.5.12__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.5.11 → pyopia-2.5.12}/PKG-INFO +1 -1
- pyopia-2.5.12/pyopia/__init__.py +1 -0
- {pyopia-2.5.11 → pyopia-2.5.12}/pyopia/io.py +9 -2
- {pyopia-2.5.11 → pyopia-2.5.12}/pyopia/process.py +6 -8
- pyopia-2.5.11/pyopia/__init__.py +0 -1
- {pyopia-2.5.11 → pyopia-2.5.12}/LICENSE +0 -0
- {pyopia-2.5.11 → pyopia-2.5.12}/README.md +0 -0
- {pyopia-2.5.11 → pyopia-2.5.12}/pyopia/background.py +0 -0
- {pyopia-2.5.11 → pyopia-2.5.12}/pyopia/classify.py +0 -0
- {pyopia-2.5.11 → pyopia-2.5.12}/pyopia/cli.py +0 -0
- {pyopia-2.5.11 → pyopia-2.5.12}/pyopia/exampledata.py +0 -0
- {pyopia-2.5.11 → pyopia-2.5.12}/pyopia/instrument/__init__.py +0 -0
- {pyopia-2.5.11 → pyopia-2.5.12}/pyopia/instrument/common.py +0 -0
- {pyopia-2.5.11 → pyopia-2.5.12}/pyopia/instrument/holo.py +0 -0
- {pyopia-2.5.11 → pyopia-2.5.12}/pyopia/instrument/silcam.py +0 -0
- {pyopia-2.5.11 → pyopia-2.5.12}/pyopia/instrument/uvp.py +0 -0
- {pyopia-2.5.11 → pyopia-2.5.12}/pyopia/pipeline.py +0 -0
- {pyopia-2.5.11 → pyopia-2.5.12}/pyopia/plotting.py +0 -0
- {pyopia-2.5.11 → pyopia-2.5.12}/pyopia/simulator/__init__.py +0 -0
- {pyopia-2.5.11 → pyopia-2.5.12}/pyopia/simulator/silcam.py +0 -0
- {pyopia-2.5.11 → pyopia-2.5.12}/pyopia/statistics.py +0 -0
- {pyopia-2.5.11 → pyopia-2.5.12}/pyopia/tests/__init__.py +0 -0
- {pyopia-2.5.11 → pyopia-2.5.12}/pyopia/tests/test_classify.py +0 -0
- {pyopia-2.5.11 → pyopia-2.5.12}/pyopia/tests/test_notebooks.py +0 -0
- {pyopia-2.5.11 → pyopia-2.5.12}/pyopia/tests/test_pipeline.py +0 -0
- {pyopia-2.5.11 → pyopia-2.5.12}/pyproject.toml +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '2.5.12'
|
|
@@ -84,14 +84,21 @@ def write_stats(stats,
|
|
|
84
84
|
existing_stats = load_stats(datafilename + '-STATS.nc')
|
|
85
85
|
xstats = xarray.concat([existing_stats, xstats], 'index')
|
|
86
86
|
elif not append:
|
|
87
|
+
# When appending, only store the last row in the image_stats DataFrame
|
|
87
88
|
datafilename += ('-Image-D' +
|
|
88
89
|
str(xstats['timestamp'][0].values).replace('-', '').replace(':', '').replace('.', '-'))
|
|
90
|
+
|
|
89
91
|
encoding = setup_xstats_encoding(xstats)
|
|
90
92
|
xstats.to_netcdf(datafilename + '-STATS.nc', encoding=encoding, engine=NETCDF_ENGINE, format='NETCDF4')
|
|
91
93
|
|
|
92
94
|
# If we have image statistics (summary data for each raw image), add the image_stats a group
|
|
93
95
|
if image_stats is not None:
|
|
94
|
-
|
|
96
|
+
if append:
|
|
97
|
+
ximage_stats = image_stats.to_xarray()
|
|
98
|
+
else:
|
|
99
|
+
ximage_stats = image_stats.loc[[image_stats.index[-1]], :].to_xarray()
|
|
100
|
+
|
|
101
|
+
ximage_stats.to_netcdf(datafilename + '-STATS.nc', group='image_stats', mode='a', engine=NETCDF_ENGINE)
|
|
95
102
|
|
|
96
103
|
|
|
97
104
|
def setup_xstats_encoding(xstats, string_vars=['export name', 'holo_filename']):
|
|
@@ -330,7 +337,7 @@ def merge_and_save_mfdataset(path_to_data, prefix='*', overwrite_existing_partia
|
|
|
330
337
|
num_chunks = int(np.ceil(num_files / chunk_size_used))
|
|
331
338
|
filelist_chunks = [sorted_filelist[i*chunk_size_used:min(num_files, (i+1)*chunk_size_used)] for i in range(num_chunks)]
|
|
332
339
|
infostr = f'Processing {num_chunks} partial file lists of {chunk_size_used} files each'
|
|
333
|
-
infostr += ', based on a total of {num_files} files.'
|
|
340
|
+
infostr += f', based on a total of {num_files} files.'
|
|
334
341
|
logging.info(infostr)
|
|
335
342
|
|
|
336
343
|
# Get config from first file in list
|
|
@@ -259,14 +259,12 @@ def extract_particles(imc, timestamp, Classification, region_properties,
|
|
|
259
259
|
stats : DataFrame
|
|
260
260
|
List of particle statistics for every particle, according to Partstats class
|
|
261
261
|
'''
|
|
262
|
-
|
|
262
|
+
num_rows = max(len(region_properties), 1)
|
|
263
|
+
filenames = ['not_exported'] * num_rows
|
|
263
264
|
|
|
264
265
|
if Classification is not None:
|
|
265
266
|
# pre-allocation
|
|
266
|
-
predictions = np.zeros((len(
|
|
267
|
-
len(Classification.class_labels)),
|
|
268
|
-
dtype='float64')
|
|
269
|
-
predictions *= np.nan
|
|
267
|
+
predictions = np.nan * np.zeros((num_rows, len(Classification.class_labels)), dtype='float64')
|
|
270
268
|
|
|
271
269
|
# obtain the original image filename from the timestamp
|
|
272
270
|
filename = timestamp.strftime('D%Y%m%dT%H%M%S.%f')
|
|
@@ -292,8 +290,8 @@ def extract_particles(imc, timestamp, Classification, region_properties,
|
|
|
292
290
|
HDF5File = None
|
|
293
291
|
|
|
294
292
|
# pre-allocate some things
|
|
295
|
-
data = np.zeros((
|
|
296
|
-
bboxes = np.zeros((
|
|
293
|
+
data = np.nan * np.zeros((num_rows, len(propnames)), dtype=np.float64)
|
|
294
|
+
bboxes = np.nan * np.zeros((num_rows, 4), dtype=np.float64)
|
|
297
295
|
nb_extractable_part = 0
|
|
298
296
|
|
|
299
297
|
for i, el in enumerate(region_properties):
|
|
@@ -630,7 +628,7 @@ class CalculateImageStats():
|
|
|
630
628
|
data['image_stats'].loc[data['timestamp'], 'saturation'] = image_saturation
|
|
631
629
|
|
|
632
630
|
# Skip remaining calculations if no particles where found
|
|
633
|
-
if data['stats'].size == 0:
|
|
631
|
+
if data['stats'].dropna().size == 0:
|
|
634
632
|
return data
|
|
635
633
|
|
|
636
634
|
# Calculate D50, nc and vc stats
|
pyopia-2.5.11/pyopia/__init__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '2.5.11'
|
|
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
|