brukerapi 0.1.9__py3-none-any.whl → 0.2.0__py3-none-any.whl
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.
- brukerapi/cli.py +21 -30
- brukerapi/config/properties_fid_core.json +63 -6
- brukerapi/config/properties_rawdata_core.json +16 -9
- brukerapi/config/properties_rawdata_custom.json +65 -1
- brukerapi/data.py +2 -3
- brukerapi/dataset.py +159 -158
- brukerapi/exceptions.py +57 -84
- brukerapi/folders.py +183 -169
- brukerapi/jcampdx.py +223 -237
- brukerapi/mergers.py +15 -22
- brukerapi/schemas.py +222 -279
- brukerapi/splitters.py +100 -87
- brukerapi/utils.py +35 -36
- brukerapi-0.2.0.dist-info/METADATA +244 -0
- brukerapi-0.2.0.dist-info/RECORD +25 -0
- {brukerapi-0.1.9.dist-info → brukerapi-0.2.0.dist-info}/WHEEL +1 -1
- brukerapi-0.1.9.dist-info/METADATA +0 -13
- brukerapi-0.1.9.dist-info/RECORD +0 -25
- {brukerapi-0.1.9.dist-info → brukerapi-0.2.0.dist-info}/entry_points.txt +0 -0
- {brukerapi-0.1.9.dist-info → brukerapi-0.2.0.dist-info/licenses}/LICENSE +0 -0
- {brukerapi-0.1.9.dist-info → brukerapi-0.2.0.dist-info}/top_level.txt +0 -0
brukerapi/exceptions.py
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
1
|
class UnknownAcqSchemeException(Exception):
|
|
4
2
|
def __init__(self, *args):
|
|
5
3
|
if args:
|
|
@@ -9,9 +7,8 @@ class UnknownAcqSchemeException(Exception):
|
|
|
9
7
|
|
|
10
8
|
def __str__(self):
|
|
11
9
|
if self.message:
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
return 'Unknown acquisition scheme'
|
|
10
|
+
return f"Unknown acquisition scheme, {self.message}"
|
|
11
|
+
return "Unknown acquisition scheme"
|
|
15
12
|
|
|
16
13
|
|
|
17
14
|
class UnsuportedDatasetType(Exception):
|
|
@@ -23,9 +20,8 @@ class UnsuportedDatasetType(Exception):
|
|
|
23
20
|
|
|
24
21
|
def __str__(self):
|
|
25
22
|
if self.message:
|
|
26
|
-
return
|
|
27
|
-
|
|
28
|
-
return 'Dataset type is not supported'
|
|
23
|
+
return f"Dataset type: {self.message} is not supported"
|
|
24
|
+
return "Dataset type is not supported"
|
|
29
25
|
|
|
30
26
|
|
|
31
27
|
class InvalidJcampdxFile(Exception):
|
|
@@ -37,9 +33,8 @@ class InvalidJcampdxFile(Exception):
|
|
|
37
33
|
|
|
38
34
|
def __str__(self):
|
|
39
35
|
if self.message:
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
-
return 'Invalid JCAMP-DX file'
|
|
36
|
+
return f"{self.message} is not valid JCAMP-DX file"
|
|
37
|
+
return "Invalid JCAMP-DX file"
|
|
43
38
|
|
|
44
39
|
|
|
45
40
|
class ParameterNotFound(Exception):
|
|
@@ -48,13 +43,14 @@ class ParameterNotFound(Exception):
|
|
|
48
43
|
self.key = args[0]
|
|
49
44
|
self.path = args[1]
|
|
50
45
|
else:
|
|
46
|
+
self.key = None
|
|
47
|
+
self.path = None
|
|
51
48
|
self.message = None
|
|
52
49
|
|
|
53
50
|
def __str__(self):
|
|
54
51
|
if self.key and self.path:
|
|
55
|
-
return
|
|
56
|
-
|
|
57
|
-
return 'Parameter not found'
|
|
52
|
+
return f"{self.key} not found in {self.path}"
|
|
53
|
+
return "Parameter not found"
|
|
58
54
|
|
|
59
55
|
|
|
60
56
|
class JcampdxVersionError(Exception):
|
|
@@ -66,9 +62,8 @@ class JcampdxVersionError(Exception):
|
|
|
66
62
|
|
|
67
63
|
def __str__(self):
|
|
68
64
|
if self.message:
|
|
69
|
-
return '"{}" is not a valid JCAMP-DX version
|
|
70
|
-
|
|
71
|
-
return 'Not a valid JCAMP-DX version'
|
|
65
|
+
return f'"{self.message}" is not a valid JCAMP-DX version'
|
|
66
|
+
return "Not a valid JCAMP-DX version"
|
|
72
67
|
|
|
73
68
|
|
|
74
69
|
class JcampdxFileError(Exception):
|
|
@@ -80,9 +75,8 @@ class JcampdxFileError(Exception):
|
|
|
80
75
|
|
|
81
76
|
def __str__(self):
|
|
82
77
|
if self.message:
|
|
83
|
-
return
|
|
84
|
-
|
|
85
|
-
return 'Not a valid JCAMP-DX file'
|
|
78
|
+
return f"Not a valid JCAMP-DX file {self.message} "
|
|
79
|
+
return "Not a valid JCAMP-DX file"
|
|
86
80
|
|
|
87
81
|
|
|
88
82
|
class JcampdxInvalidLine(Exception):
|
|
@@ -94,9 +88,8 @@ class JcampdxInvalidLine(Exception):
|
|
|
94
88
|
|
|
95
89
|
def __str__(self):
|
|
96
90
|
if self.message:
|
|
97
|
-
return
|
|
98
|
-
|
|
99
|
-
return 'Not a valid JCAMP-DX data line'
|
|
91
|
+
return f"Not a valid JCAMP-DX data line {self.message} "
|
|
92
|
+
return "Not a valid JCAMP-DX data line"
|
|
100
93
|
|
|
101
94
|
|
|
102
95
|
class DatasetTypeMissmatch(Exception):
|
|
@@ -109,8 +102,7 @@ class DatasetTypeMissmatch(Exception):
|
|
|
109
102
|
def __str__(self):
|
|
110
103
|
if self.message:
|
|
111
104
|
return self.message
|
|
112
|
-
|
|
113
|
-
return 'DatasetTypeMissmatch'
|
|
105
|
+
return "DatasetTypeMissmatch"
|
|
114
106
|
|
|
115
107
|
|
|
116
108
|
class IncompleteDataset(Exception):
|
|
@@ -123,8 +115,7 @@ class IncompleteDataset(Exception):
|
|
|
123
115
|
def __str__(self):
|
|
124
116
|
if self.message:
|
|
125
117
|
return self.message
|
|
126
|
-
|
|
127
|
-
return 'DatasetTypeMissmatch'
|
|
118
|
+
return "DatasetTypeMissmatch"
|
|
128
119
|
|
|
129
120
|
|
|
130
121
|
class ConditionNotMet(Exception):
|
|
@@ -136,9 +127,8 @@ class ConditionNotMet(Exception):
|
|
|
136
127
|
|
|
137
128
|
def __str__(self):
|
|
138
129
|
if self.message:
|
|
139
|
-
return
|
|
140
|
-
|
|
141
|
-
return 'Not a valid JCAMP-DX version'
|
|
130
|
+
return f"{self.message}"
|
|
131
|
+
return "Not a valid JCAMP-DX version"
|
|
142
132
|
|
|
143
133
|
|
|
144
134
|
class SequenceNotMet(Exception):
|
|
@@ -150,9 +140,8 @@ class SequenceNotMet(Exception):
|
|
|
150
140
|
|
|
151
141
|
def __str__(self):
|
|
152
142
|
if self.message:
|
|
153
|
-
return
|
|
154
|
-
|
|
155
|
-
return 'Not a valid JCAMP-DX version'
|
|
143
|
+
return f"Message {self.message}"
|
|
144
|
+
return "Not a valid JCAMP-DX version"
|
|
156
145
|
|
|
157
146
|
|
|
158
147
|
class PvVersionNotMet(Exception):
|
|
@@ -164,9 +153,8 @@ class PvVersionNotMet(Exception):
|
|
|
164
153
|
|
|
165
154
|
def __str__(self):
|
|
166
155
|
if self.message:
|
|
167
|
-
return
|
|
168
|
-
|
|
169
|
-
return 'Not a valid ParaVision version'
|
|
156
|
+
return f"Message {self.message}"
|
|
157
|
+
return "Not a valid ParaVision version"
|
|
170
158
|
|
|
171
159
|
|
|
172
160
|
class FilterEvalFalse(Exception):
|
|
@@ -178,9 +166,8 @@ class FilterEvalFalse(Exception):
|
|
|
178
166
|
|
|
179
167
|
def __str__(self):
|
|
180
168
|
if self.message:
|
|
181
|
-
return
|
|
182
|
-
|
|
183
|
-
return 'FilterEvalFalse'
|
|
169
|
+
return f"{self.message}"
|
|
170
|
+
return "FilterEvalFalse"
|
|
184
171
|
|
|
185
172
|
|
|
186
173
|
class NotADatasetDir(Exception):
|
|
@@ -192,9 +179,9 @@ class NotADatasetDir(Exception):
|
|
|
192
179
|
|
|
193
180
|
def __str__(self):
|
|
194
181
|
if self.message:
|
|
195
|
-
return
|
|
196
|
-
|
|
197
|
-
|
|
182
|
+
return f"{self.message}"
|
|
183
|
+
return f"NotADatasetDir {self.message}"
|
|
184
|
+
|
|
198
185
|
|
|
199
186
|
class ScanNotFound(Exception):
|
|
200
187
|
def __init__(self, *args):
|
|
@@ -205,9 +192,8 @@ class ScanNotFound(Exception):
|
|
|
205
192
|
|
|
206
193
|
def __str__(self):
|
|
207
194
|
if self.message:
|
|
208
|
-
return
|
|
209
|
-
|
|
210
|
-
return 'Scan: {} not found'.format(self.message)
|
|
195
|
+
return f"{self.message}"
|
|
196
|
+
return f"Scan: {self.message} not found"
|
|
211
197
|
|
|
212
198
|
|
|
213
199
|
class RecoNotFound(Exception):
|
|
@@ -219,9 +205,8 @@ class RecoNotFound(Exception):
|
|
|
219
205
|
|
|
220
206
|
def __str__(self):
|
|
221
207
|
if self.message:
|
|
222
|
-
return
|
|
223
|
-
|
|
224
|
-
return 'Reco: {} not found'.format(self.message)
|
|
208
|
+
return f"{self.message}"
|
|
209
|
+
return f"Reco: {self.message} not found"
|
|
225
210
|
|
|
226
211
|
|
|
227
212
|
class ParametersNotLoaded(Exception):
|
|
@@ -233,9 +218,8 @@ class ParametersNotLoaded(Exception):
|
|
|
233
218
|
|
|
234
219
|
def __str__(self):
|
|
235
220
|
if self.message:
|
|
236
|
-
return
|
|
237
|
-
|
|
238
|
-
return 'ParametersNotLoaded'
|
|
221
|
+
return f"{self.message}"
|
|
222
|
+
return "ParametersNotLoaded"
|
|
239
223
|
|
|
240
224
|
|
|
241
225
|
class SchemeNotLoaded(Exception):
|
|
@@ -247,9 +231,8 @@ class SchemeNotLoaded(Exception):
|
|
|
247
231
|
|
|
248
232
|
def __str__(self):
|
|
249
233
|
if self.message:
|
|
250
|
-
return
|
|
251
|
-
|
|
252
|
-
return 'SchemeNotLoaded'
|
|
234
|
+
return f"{self.message}"
|
|
235
|
+
return "SchemeNotLoaded"
|
|
253
236
|
|
|
254
237
|
|
|
255
238
|
class DataNotLoaded(Exception):
|
|
@@ -261,9 +244,8 @@ class DataNotLoaded(Exception):
|
|
|
261
244
|
|
|
262
245
|
def __str__(self):
|
|
263
246
|
if self.message:
|
|
264
|
-
return
|
|
265
|
-
|
|
266
|
-
return 'DataNotLoaded'
|
|
247
|
+
return f"{self.message}"
|
|
248
|
+
return "DataNotLoaded"
|
|
267
249
|
|
|
268
250
|
|
|
269
251
|
class TrajNotLoaded(Exception):
|
|
@@ -275,9 +257,8 @@ class TrajNotLoaded(Exception):
|
|
|
275
257
|
|
|
276
258
|
def __str__(self):
|
|
277
259
|
if self.message:
|
|
278
|
-
return
|
|
279
|
-
|
|
280
|
-
return 'TrajNotLoaded'
|
|
260
|
+
return f"{self.message}"
|
|
261
|
+
return "TrajNotLoaded"
|
|
281
262
|
|
|
282
263
|
|
|
283
264
|
class NotStudyFolder(Exception):
|
|
@@ -289,9 +270,8 @@ class NotStudyFolder(Exception):
|
|
|
289
270
|
|
|
290
271
|
def __str__(self):
|
|
291
272
|
if self.message:
|
|
292
|
-
return
|
|
293
|
-
|
|
294
|
-
return 'Not a Bruker study folder.'
|
|
273
|
+
return f"{self.message}"
|
|
274
|
+
return "Not a Bruker study folder."
|
|
295
275
|
|
|
296
276
|
|
|
297
277
|
class NotExperimentFolder(Exception):
|
|
@@ -303,9 +283,8 @@ class NotExperimentFolder(Exception):
|
|
|
303
283
|
|
|
304
284
|
def __str__(self):
|
|
305
285
|
if self.message:
|
|
306
|
-
return
|
|
307
|
-
|
|
308
|
-
return 'Not a Bruker experiment folder.'
|
|
286
|
+
return f"{self.message}"
|
|
287
|
+
return "Not a Bruker experiment folder."
|
|
309
288
|
|
|
310
289
|
|
|
311
290
|
class NotProcessingFolder(Exception):
|
|
@@ -317,9 +296,8 @@ class NotProcessingFolder(Exception):
|
|
|
317
296
|
|
|
318
297
|
def __str__(self):
|
|
319
298
|
if self.message:
|
|
320
|
-
return
|
|
321
|
-
|
|
322
|
-
return 'Not a Bruker processing folder.'
|
|
299
|
+
return f"{self.message}"
|
|
300
|
+
return "Not a Bruker processing folder."
|
|
323
301
|
|
|
324
302
|
|
|
325
303
|
class PropertyConditionNotMet(Exception):
|
|
@@ -331,9 +309,8 @@ class PropertyConditionNotMet(Exception):
|
|
|
331
309
|
|
|
332
310
|
def __str__(self):
|
|
333
311
|
if self.message:
|
|
334
|
-
return
|
|
335
|
-
|
|
336
|
-
return 'Not a Bruker processing folder.'
|
|
312
|
+
return f"{self.message}"
|
|
313
|
+
return "Not a Bruker processing folder."
|
|
337
314
|
|
|
338
315
|
|
|
339
316
|
class FidSchemaUndefined(Exception):
|
|
@@ -344,13 +321,13 @@ class FidSchemaUndefined(Exception):
|
|
|
344
321
|
self.message = None
|
|
345
322
|
|
|
346
323
|
def __str__(self):
|
|
347
|
-
common =
|
|
348
|
-
|
|
324
|
+
common = (
|
|
325
|
+
"Schema was not identified for this dataset. This issue might occur in case of a pulse sequence. "
|
|
326
|
+
"Please, contact authors to include the new sequence into the API configuration."
|
|
327
|
+
)
|
|
349
328
|
if self.message:
|
|
350
|
-
return common +
|
|
351
|
-
|
|
352
|
-
else:
|
|
353
|
-
return common
|
|
329
|
+
return common + f"\n The name of pulse sequence used to measure this dataset is {self.message}"
|
|
330
|
+
return common
|
|
354
331
|
|
|
355
332
|
|
|
356
333
|
class MissingProperty(Exception):
|
|
@@ -362,9 +339,5 @@ class MissingProperty(Exception):
|
|
|
362
339
|
|
|
363
340
|
def __str__(self):
|
|
364
341
|
if self.message:
|
|
365
|
-
return "Dataset is missing the {} property. We can offer some help, please contact us via "
|
|
366
|
-
|
|
367
|
-
else:
|
|
368
|
-
return "Dataset is missing one of the required properties. We can offer some help, please contact us via " \
|
|
369
|
-
"https://github.com/isi-nmr/brukerapi-python"
|
|
370
|
-
|
|
342
|
+
return f"Dataset is missing the {self.message} property. We can offer some help, please contact us via https://github.com/isi-nmr/brukerapi-python"
|
|
343
|
+
return "Dataset is missing one of the required properties. We can offer some help, please contact us via https://github.com/isi-nmr/brukerapi-python"
|