brukerapi 0.2.2__tar.gz → 0.2.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.
Files changed (37) hide show
  1. {brukerapi-0.2.2/brukerapi.egg-info → brukerapi-0.2.3}/PKG-INFO +1 -1
  2. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi/dataset.py +4 -4
  3. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi/exceptions.py +13 -0
  4. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi/folders.py +3 -2
  5. {brukerapi-0.2.2 → brukerapi-0.2.3/brukerapi.egg-info}/PKG-INFO +1 -1
  6. {brukerapi-0.2.2 → brukerapi-0.2.3}/pyproject.toml +1 -1
  7. {brukerapi-0.2.2 → brukerapi-0.2.3}/LICENSE +0 -0
  8. {brukerapi-0.2.2 → brukerapi-0.2.3}/MANIFEST.in +0 -0
  9. {brukerapi-0.2.2 → brukerapi-0.2.3}/README.rst +0 -0
  10. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi/__init__.py +0 -0
  11. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi/cli.py +0 -0
  12. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi/config/properties_2dseq_core.json +0 -0
  13. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi/config/properties_2dseq_custom.json +0 -0
  14. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi/config/properties_fid_core.json +0 -0
  15. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi/config/properties_fid_custom.json +0 -0
  16. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi/config/properties_rawdata_core.json +0 -0
  17. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi/config/properties_rawdata_custom.json +0 -0
  18. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi/config/properties_traj_core.json +0 -0
  19. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi/config/properties_traj_custom.json +0 -0
  20. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi/data.py +0 -0
  21. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi/jcampdx.py +0 -0
  22. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi/mergers.py +0 -0
  23. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi/schemas.py +0 -0
  24. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi/splitters.py +0 -0
  25. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi/utils.py +0 -0
  26. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi.egg-info/SOURCES.txt +0 -0
  27. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi.egg-info/dependency_links.txt +0 -0
  28. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi.egg-info/entry_points.txt +0 -0
  29. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi.egg-info/not-zip-safe +0 -0
  30. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi.egg-info/requires.txt +0 -0
  31. {brukerapi-0.2.2 → brukerapi-0.2.3}/brukerapi.egg-info/top_level.txt +0 -0
  32. {brukerapi-0.2.2 → brukerapi-0.2.3}/setup.cfg +0 -0
  33. {brukerapi-0.2.2 → brukerapi-0.2.3}/test/test_dataset.py +0 -0
  34. {brukerapi-0.2.2 → brukerapi-0.2.3}/test/test_exceptions.py +0 -0
  35. {brukerapi-0.2.2 → brukerapi-0.2.3}/test/test_jcampdx.py +0 -0
  36. {brukerapi-0.2.2 → brukerapi-0.2.3}/test/test_random_access.py +0 -0
  37. {brukerapi-0.2.2 → brukerapi-0.2.3}/test/test_split.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: brukerapi
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Bruker API
5
5
  Author-email: Tomas Psorn <tomaspsorn@isibrno.cz>, Jiri Vitous <vitous@isibrno.cz>
6
6
  Maintainer-email: Jiri Vitous <vitous@isibrno.cz>
@@ -15,6 +15,7 @@ from .exceptions import (
15
15
  DatasetTypeMissmatch,
16
16
  FilterEvalFalse,
17
17
  IncompleteDataset,
18
+ InvalidDataset,
18
19
  NotADatasetDir,
19
20
  ParametersNotLoaded,
20
21
  PropertyConditionNotMet,
@@ -269,7 +270,6 @@ class Dataset:
269
270
  if i not in set(os.listdir(str(param_path.parent))):
270
271
  raise IncompleteDataset
271
272
 
272
-
273
273
  def load(self):
274
274
  """
275
275
  Load parameters, properties, schema and data. In case, there is a traj file related to a fid file,
@@ -401,7 +401,7 @@ class Dataset:
401
401
  def unload_properties(self):
402
402
  for property in self._properties:
403
403
  if hasattr(self, property):
404
- delattr(self,property)
404
+ delattr(self, property)
405
405
  self._properties = []
406
406
  self._state["load_properties"] = False
407
407
 
@@ -565,11 +565,11 @@ class Dataset:
565
565
  -------
566
566
  1D ndarray containing the full data vector
567
567
  """
568
- # TODO debug with this
568
+
569
569
  try:
570
570
  assert os.stat(str(path)).st_size == np.prod(shape) * dtype.itemsize
571
571
  except AssertionError:
572
- raise ValueError("Dimension mismatch") from AssertionError
572
+ raise InvalidDataset("Invalid dataset, dimension mismatch") from AssertionError
573
573
 
574
574
  return np.array(np.memmap(path, dtype=dtype, shape=shape, order="F")[:])
575
575
 
@@ -248,6 +248,19 @@ class DataNotLoaded(Exception):
248
248
  return "DataNotLoaded"
249
249
 
250
250
 
251
+ class InvalidDataset(Exception):
252
+ def __init__(self, *args):
253
+ if args:
254
+ self.message = args[0]
255
+ else:
256
+ self.message = None
257
+
258
+ def __str__(self):
259
+ if self.message:
260
+ return f"{self.message}"
261
+ return "Invalid dataset loaded"
262
+
263
+
251
264
  class TrajNotLoaded(Exception):
252
265
  def __init__(self, *args):
253
266
  if args:
@@ -7,6 +7,7 @@ from .dataset import Dataset
7
7
  from .exceptions import (
8
8
  FilterEvalFalse,
9
9
  IncompleteDataset,
10
+ InvalidDataset,
10
11
  InvalidJcampdxFile,
11
12
  JcampdxVersionError,
12
13
  NotADatasetDir,
@@ -17,7 +18,7 @@ from .exceptions import (
17
18
  )
18
19
  from .jcampdx import JCAMPDX
19
20
 
20
- DEFAULT_DATASET_STATE = {"parameter_files": [], "property_files": [], "load": False}
21
+ DEFAULT_DATASET_STATE = {"parameter_files": [], "property_files": [], "load": 3}
21
22
 
22
23
 
23
24
  class Folder:
@@ -220,7 +221,7 @@ class Folder:
220
221
  if path.name in self._dataset_index or (path.name.partition(".")[0] in self._dataset_index and "rawdata" in path.name):
221
222
  try:
222
223
  children.append(Dataset(path, **self._dataset_state))
223
- except (UnsuportedDatasetType, IncompleteDataset, NotADatasetDir):
224
+ except (UnsuportedDatasetType, IncompleteDataset, NotADatasetDir, InvalidDataset):
224
225
  continue
225
226
 
226
227
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: brukerapi
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Bruker API
5
5
  Author-email: Tomas Psorn <tomaspsorn@isibrno.cz>, Jiri Vitous <vitous@isibrno.cz>
6
6
  Maintainer-email: Jiri Vitous <vitous@isibrno.cz>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "brukerapi"
7
- version = "0.2.2"
7
+ version = "0.2.3"
8
8
  description = "Bruker API"
9
9
  authors = [
10
10
  { name = "Tomas Psorn", email = "tomaspsorn@isibrno.cz" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes