PyOPIA 2.5.7__tar.gz → 2.5.9__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.
Files changed (26) hide show
  1. {pyopia-2.5.7 → pyopia-2.5.9}/PKG-INFO +1 -1
  2. pyopia-2.5.9/pyopia/__init__.py +1 -0
  3. {pyopia-2.5.7 → pyopia-2.5.9}/pyopia/instrument/silcam.py +2 -1
  4. {pyopia-2.5.7 → pyopia-2.5.9}/pyopia/io.py +14 -7
  5. pyopia-2.5.7/pyopia/__init__.py +0 -1
  6. {pyopia-2.5.7 → pyopia-2.5.9}/LICENSE +0 -0
  7. {pyopia-2.5.7 → pyopia-2.5.9}/README.md +0 -0
  8. {pyopia-2.5.7 → pyopia-2.5.9}/pyopia/background.py +0 -0
  9. {pyopia-2.5.7 → pyopia-2.5.9}/pyopia/classify.py +0 -0
  10. {pyopia-2.5.7 → pyopia-2.5.9}/pyopia/cli.py +0 -0
  11. {pyopia-2.5.7 → pyopia-2.5.9}/pyopia/exampledata.py +0 -0
  12. {pyopia-2.5.7 → pyopia-2.5.9}/pyopia/instrument/__init__.py +0 -0
  13. {pyopia-2.5.7 → pyopia-2.5.9}/pyopia/instrument/common.py +0 -0
  14. {pyopia-2.5.7 → pyopia-2.5.9}/pyopia/instrument/holo.py +0 -0
  15. {pyopia-2.5.7 → pyopia-2.5.9}/pyopia/instrument/uvp.py +0 -0
  16. {pyopia-2.5.7 → pyopia-2.5.9}/pyopia/pipeline.py +0 -0
  17. {pyopia-2.5.7 → pyopia-2.5.9}/pyopia/plotting.py +0 -0
  18. {pyopia-2.5.7 → pyopia-2.5.9}/pyopia/process.py +0 -0
  19. {pyopia-2.5.7 → pyopia-2.5.9}/pyopia/simulator/__init__.py +0 -0
  20. {pyopia-2.5.7 → pyopia-2.5.9}/pyopia/simulator/silcam.py +0 -0
  21. {pyopia-2.5.7 → pyopia-2.5.9}/pyopia/statistics.py +0 -0
  22. {pyopia-2.5.7 → pyopia-2.5.9}/pyopia/tests/__init__.py +0 -0
  23. {pyopia-2.5.7 → pyopia-2.5.9}/pyopia/tests/test_classify.py +0 -0
  24. {pyopia-2.5.7 → pyopia-2.5.9}/pyopia/tests/test_notebooks.py +0 -0
  25. {pyopia-2.5.7 → pyopia-2.5.9}/pyopia/tests/test_pipeline.py +0 -0
  26. {pyopia-2.5.7 → pyopia-2.5.9}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyOPIA
3
- Version: 2.5.7
3
+ Version: 2.5.9
4
4
  Summary: A Python Ocean Particle Image Analysis toolbox.
5
5
  Home-page: https://github.com/sintef/pyopia
6
6
  Keywords: Ocean,Particles,Imaging,Measurement,Size distribution
@@ -0,0 +1 @@
1
+ __version__ = '2.5.9'
@@ -214,7 +214,8 @@ class SilCamLoad():
214
214
  :func:`pyopia.instrument.silcam.timestamp_from_filename`
215
215
 
216
216
  Required keys in :class:`pyopia.pipeline.Data`:
217
- - :attr:`pyopia.pipeline.Data.filename`
217
+ - :attr:`pyopia.pipeline.Data.filename` conforming to the format 'DYYYYmmddTHHMMSS.ffffff.silc'
218
+ e.g. 'D20240919T074500.183294.silc'
218
219
 
219
220
  Parameters
220
221
  ----------
@@ -160,7 +160,11 @@ def load_image_stats(datafilename):
160
160
 
161
161
 
162
162
  def load_stats(datafilename):
163
- '''Load STATS file as a DataFrame
163
+ '''Load -STATS.nc file as xarray Dataset
164
+
165
+ .. warning:: Support for loading of old -STATS.h5 formats will be removed in version 3.0.0.
166
+ They will need to be converted to .nc prior to loading.
167
+ Data loaded from -STATS.h5 are returned as an xarray Dataset without metadata.
164
168
 
165
169
  Parameters
166
170
  ----------
@@ -169,21 +173,24 @@ def load_stats(datafilename):
169
173
 
170
174
  Returns
171
175
  -------
172
- stats : DataFrame
173
- STATS DataFrame / xarray dataset
176
+ xstats : xarray.Dataset
177
+ Particle statistics
174
178
  '''
175
179
 
176
180
  if datafilename.endswith('.nc'):
177
- with xarray.open_dataset(datafilename) as stats:
178
- stats.load()
181
+ with xarray.open_dataset(datafilename) as xstats:
182
+ xstats.load()
179
183
  elif datafilename.endswith('.h5'):
184
+ logger.warning('In future, load_stats will only take .nc files')
180
185
  stats = pd.read_hdf(datafilename, 'ParticleStats/stats')
186
+ xstats = stats.to_xarray()
181
187
  else:
182
188
  logger.warning('WARNING. File extension not specified.' +
183
189
  'Assuming prefix of -STATS.h5 for backwards compatability.' +
184
- 'In future, this function will only take .nc files')
190
+ 'In future, load_stats will only take .nc files')
185
191
  stats = pd.read_hdf(datafilename + '-STATS.h5', 'ParticleStats/stats')
186
- return stats
192
+ xstats = stats.to_xarray()
193
+ return xstats
187
194
 
188
195
 
189
196
  def combine_stats_netcdf_files(path_to_data, prefix='*'):
@@ -1 +0,0 @@
1
- __version__ = '2.5.7'
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