sdata 0.23.2__tar.gz → 0.24.0__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.
- {sdata-0.23.2/sdata.egg-info → sdata-0.24.0}/PKG-INFO +1 -1
- {sdata-0.23.2 → sdata-0.24.0}/sdata/__init__.py +3 -3
- {sdata-0.23.2 → sdata-0.24.0}/sdata/data.py +80 -3
- {sdata-0.23.2 → sdata-0.24.0}/sdata/image.py +4 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/metadata.py +30 -2
- {sdata-0.23.2 → sdata-0.24.0/sdata.egg-info}/PKG-INFO +1 -1
- {sdata-0.23.2 → sdata-0.24.0}/tests/test_data.py +22 -0
- {sdata-0.23.2 → sdata-0.24.0}/LICENSE-MIT +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/MANIFEST.in +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/README.md +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/blob.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/__init__.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/attrdict/__init__.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/attrdict/default.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/attrdict/dictionary.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/attrdict/mapping.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/attrdict/merge.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/attrdict/mixins.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/piexif/__init__.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/piexif/_common.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/piexif/_dump.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/piexif/_exceptions.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/piexif/_exif.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/piexif/_insert.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/piexif/_load.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/piexif/_remove.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/piexif/_transplant.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/piexif/_webp.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/piexif/helper.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/ranger/__init__.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/ranger/collections/__init__.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/ranger/collections/rangebucketmap.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/ranger/collections/rangemap.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/ranger/collections/rangeset.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/ranger/range/__init__.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/ranger/range/cut.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/ranger/range/range.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/semver.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/simple_graph_db/LICENSE +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/simple_graph_db/__init__.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/simple_graph_db/database.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/simple_graph_db/schema.sql +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/sobol_seq.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/sortedcontainers/LICENSE +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/sortedcontainers/__init__.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/sortedcontainers/sorteddict.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/sortedcontainers/sortedlist.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/sortedcontainers/sortedset.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/sqlitedict.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/timeflake/__init__.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/timeflake/flake.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/contrib/timeflake/utils.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/doe.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/experiments/__init__.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/experiments/ks2.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/experiments/lapshear.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/experiments/material.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/iolib/__init__.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/iolib/db.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/iolib/hdf.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/iolib/isomme.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/iolib/pgp.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/iolib/pud.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/iolib/simple_signature.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/iolib/vault.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/suuid.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/timestamp.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/tools.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata/workbook.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata.egg-info/SOURCES.txt +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata.egg-info/dependency_links.txt +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata.egg-info/requires.txt +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/sdata.egg-info/top_level.txt +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/setup.cfg +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/setup.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/tests/__init__.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/tests/iolib/__init__.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/tests/iolib/pud/__init__.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/tests/iolib/pud/test_pud.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/tests/iolib/test_hdf.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/tests/test_attribute.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/tests/test_blob.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/tests/test_image.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/tests/test_io.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/tests/test_ks2.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/tests/test_metadata.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/tests/test_sqlite.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/tests/test_suuid.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/tests/test_table.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/tests/test_testprogram.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/tests/test_timeflake.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/tests/test_timestamp.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/tests/test_tools.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/tests/test_vault.py +0 -0
- {sdata-0.23.2 → sdata-0.24.0}/tests/test_workbook.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# -*-coding: utf-8-*-
|
|
2
2
|
from __future__ import division
|
|
3
3
|
|
|
4
|
-
__version__ = '0.
|
|
4
|
+
__version__ = '0.24.0'
|
|
5
5
|
__revision__ = None
|
|
6
6
|
__version_info__ = tuple([int(num) for num in __version__.split('.')])
|
|
7
7
|
|
|
@@ -14,8 +14,8 @@ import uuid
|
|
|
14
14
|
import logging
|
|
15
15
|
|
|
16
16
|
# fix "ValueError: unsupported pickle protocol: 5"
|
|
17
|
-
import pickle
|
|
18
|
-
pickle.HIGHEST_PROTOCOL = 4
|
|
17
|
+
#import pickle
|
|
18
|
+
#pickle.HIGHEST_PROTOCOL = 4
|
|
19
19
|
import pandas
|
|
20
20
|
|
|
21
21
|
from sdata.metadata import Metadata, Attribute
|
|
@@ -24,6 +24,7 @@ import json
|
|
|
24
24
|
import hashlib
|
|
25
25
|
import base64
|
|
26
26
|
import requests
|
|
27
|
+
import re
|
|
27
28
|
from tabulate import tabulate
|
|
28
29
|
from sdata.contrib.sqlitedict import SqliteDict
|
|
29
30
|
|
|
@@ -46,6 +47,24 @@ except:
|
|
|
46
47
|
def uuid_from_str(name):
|
|
47
48
|
return uuid.uuid3(uuid.NAMESPACE_DNS, name)
|
|
48
49
|
|
|
50
|
+
def nameunit_from_colname(column_name):
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
"""
|
|
54
|
+
#pattern = r"^(.*?)\s*\[(.+)\]$"
|
|
55
|
+
pattern = r"^(.*?)\s*\[([^\]]+)\]$"
|
|
56
|
+
|
|
57
|
+
# Anwenden des Regex
|
|
58
|
+
match = re.match(pattern, column_name)
|
|
59
|
+
|
|
60
|
+
if match:
|
|
61
|
+
name = match.group(1) # Der Name der Spalte
|
|
62
|
+
unit = match.group(2) # Die Einheit
|
|
63
|
+
else:
|
|
64
|
+
name = column_name
|
|
65
|
+
unit = "-"
|
|
66
|
+
return name.strip(), unit.strip()
|
|
67
|
+
|
|
49
68
|
class Data(object):
|
|
50
69
|
"""Base sdata object"""
|
|
51
70
|
ATTR_NAMES = []
|
|
@@ -61,6 +80,7 @@ class Data(object):
|
|
|
61
80
|
SDATA_CLASS = "!sdata_class"
|
|
62
81
|
SDATA_PROJECT = "!sdata_project"
|
|
63
82
|
SDATA_URL = "!sdata_url"
|
|
83
|
+
SDATA_COLUMN = "!sdata_column"
|
|
64
84
|
|
|
65
85
|
SDATA_ATTRIBUTES = [SDATA_VERSION, SDATA_NAME, SDATA_UUID, SDATA_SUUID, SDATA_CLASS, SDATA_PARENT, SDATA_PROJECT,
|
|
66
86
|
SDATA_CTIME, SDATA_MTIME, SDATA_URL]
|
|
@@ -104,6 +124,7 @@ class Data(object):
|
|
|
104
124
|
self.metadata.add(self.SDATA_CTIME, now_utc_str(), dtype="str", description="creation date")
|
|
105
125
|
self.metadata.add(self.SDATA_MTIME, now_utc_str(), dtype="str", description="modification date")
|
|
106
126
|
self.metadata.add(self.SDATA_URL, "", dtype="str", description="url of the data object")
|
|
127
|
+
self.metadata.add(self.SDATA_PROJECT, "", dtype="str", description="project name")
|
|
107
128
|
|
|
108
129
|
metadata = kwargs.get("metadata")
|
|
109
130
|
if metadata is not None:
|
|
@@ -130,7 +151,8 @@ class Data(object):
|
|
|
130
151
|
self.table = kwargs.get("table", None)
|
|
131
152
|
self._description = ""
|
|
132
153
|
self.description = kwargs.get("description", "")
|
|
133
|
-
self.project = kwargs.get("project", "")
|
|
154
|
+
self.project = kwargs.get("project", "N.N.")
|
|
155
|
+
self.metadata.add(self.SDATA_PROJECT, self.project, dtype="str", description="project name")
|
|
134
156
|
|
|
135
157
|
if (kwargs.get("uuid")=="" or kwargs.get("uuid") is not None) and not self.metadata.get(self.SDATA_UUID).value and kwargs.get("uuid")!="hash":
|
|
136
158
|
# logger.info("uuid in kwargs")
|
|
@@ -164,6 +186,10 @@ class Data(object):
|
|
|
164
186
|
if "sname" in kwargs:
|
|
165
187
|
self.sname = kwargs.get("sname")
|
|
166
188
|
|
|
189
|
+
|
|
190
|
+
if "parent" in kwargs:
|
|
191
|
+
self.metadata.add(self.SDATA_PARENT, kwargs.get("parent"))
|
|
192
|
+
|
|
167
193
|
def gen_suuid(self):
|
|
168
194
|
self.suuid = sdata.SUUID(self.__class__.__name__, self.name, huuid=self.uuid).idstr
|
|
169
195
|
self.sname = sdata.SUUID(self.__class__.__name__, self.name, huuid=self.uuid).sname
|
|
@@ -210,6 +236,10 @@ class Data(object):
|
|
|
210
236
|
self._set_uuid(suuid.huuid)
|
|
211
237
|
return self
|
|
212
238
|
|
|
239
|
+
@property
|
|
240
|
+
def m(self):
|
|
241
|
+
return self.metadata
|
|
242
|
+
|
|
213
243
|
def update_mtime(self):
|
|
214
244
|
"""update modification time
|
|
215
245
|
|
|
@@ -518,6 +548,49 @@ class Data(object):
|
|
|
518
548
|
data.to_folder(exportpath, dtype=dtype)
|
|
519
549
|
return path
|
|
520
550
|
|
|
551
|
+
def set_column_metadata(self):
|
|
552
|
+
"""convert 'Force [N]' -> 'Force', 'N'
|
|
553
|
+
|
|
554
|
+
add Attribute for each column
|
|
555
|
+
|
|
556
|
+
sdata_column_0: value="Force", unit="N"
|
|
557
|
+
sdata_column_1
|
|
558
|
+
...
|
|
559
|
+
sdata_column_n
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
"""
|
|
563
|
+
if self.df is None:
|
|
564
|
+
return
|
|
565
|
+
for i, col in enumerate(self.df.columns):
|
|
566
|
+
name, unit = nameunit_from_colname(col)
|
|
567
|
+
scolname = f"{self.SDATA_COLUMN}_{i}"
|
|
568
|
+
self.metadata.add(scolname, value=name, unit=unit, label=col)
|
|
569
|
+
|
|
570
|
+
def set_columnnames_from_metadata(self):
|
|
571
|
+
"""Use '!sdata_column_*' to reformat columns names
|
|
572
|
+
|
|
573
|
+
'!sdata_column_0', value='Force', unit='N' -> 'Force [N]'
|
|
574
|
+
|
|
575
|
+
> f'{name} [{unit}]'
|
|
576
|
+
|
|
577
|
+
"""
|
|
578
|
+
if self.df is None:
|
|
579
|
+
return
|
|
580
|
+
|
|
581
|
+
cols = []
|
|
582
|
+
for i, col in enumerate(self.df.columns):
|
|
583
|
+
scolname = f"{self.SDATA_COLUMN}_{i}"
|
|
584
|
+
attr = self.metadata.get(scolname)
|
|
585
|
+
if attr is None:
|
|
586
|
+
name, unit = nameunit_from_colname(col)
|
|
587
|
+
else:
|
|
588
|
+
name = attr.value
|
|
589
|
+
unit = attr.unit
|
|
590
|
+
new_colname = f'{name} [{unit}]'
|
|
591
|
+
cols.append(new_colname)
|
|
592
|
+
self.df.columns = cols
|
|
593
|
+
|
|
521
594
|
@classmethod
|
|
522
595
|
def from_folder(cls, path):
|
|
523
596
|
"""sdata object instance
|
|
@@ -1016,15 +1089,19 @@ class Data(object):
|
|
|
1016
1089
|
:param sep: separator (default=";")
|
|
1017
1090
|
:return: sdata.Data
|
|
1018
1091
|
"""
|
|
1092
|
+
if s is None and filepath is None:
|
|
1093
|
+
logging.error("specify string if filepath")
|
|
1094
|
+
return
|
|
1019
1095
|
data = cls()
|
|
1020
1096
|
df = None
|
|
1021
1097
|
try:
|
|
1022
1098
|
if filepath:
|
|
1023
1099
|
df = pd.read_csv(filepath, sep=";", comment="#", index_col=0)
|
|
1024
1100
|
sio = open(filepath, "r")
|
|
1101
|
+
sio.seek(0)
|
|
1025
1102
|
elif s is not None:
|
|
1026
1103
|
sio = StringIO(s)
|
|
1027
|
-
pd.read_csv(sio, sep=";", comment="#")
|
|
1104
|
+
df = pd.read_csv(sio, sep=";", comment="#")
|
|
1028
1105
|
sio.seek(0)
|
|
1029
1106
|
else:
|
|
1030
1107
|
logger.error("data.from_csv: no csv data available")
|
|
@@ -1272,7 +1349,7 @@ class Data(object):
|
|
|
1272
1349
|
:return: Data
|
|
1273
1350
|
"""
|
|
1274
1351
|
data = copy.deepcopy(self)
|
|
1275
|
-
data.metadata.add(self.SDATA_PARENT, self.
|
|
1352
|
+
data.metadata.add(self.SDATA_PARENT, self.suuid)
|
|
1276
1353
|
data.metadata.add(self.SDATA_UUID, self.gen_uuid())
|
|
1277
1354
|
data.metadata.add(self.SDATA_MTIME, now_utc_str(), dtype="str")
|
|
1278
1355
|
if "uuid" in kwargs:
|
|
@@ -59,7 +59,7 @@ class Attribute(object):
|
|
|
59
59
|
DTYPES_INV = {v: k for k, v in DTYPES.items()}
|
|
60
60
|
|
|
61
61
|
def __init__(self, name, value, **kwargs):
|
|
62
|
-
"""Attribute
|
|
62
|
+
"""Attribute(name, value, dtype=str, unit="-", description="", label="", required=False)
|
|
63
63
|
:param name
|
|
64
64
|
:param value
|
|
65
65
|
:param dtype ['float', 'int', 'str', 'timestamp', 'uuid?', 'unicode?']
|
|
@@ -303,10 +303,15 @@ class Metadata(object):
|
|
|
303
303
|
required_attributes = [(attr.name, attr) for attr in self.attributes.values() if attr.required is True]
|
|
304
304
|
return SortedDict(required_attributes)
|
|
305
305
|
|
|
306
|
+
def add_attribute(self, attr, **kwargs):
|
|
307
|
+
"""set Attribute"""
|
|
308
|
+
prefix = kwargs.get("prefix", "")
|
|
309
|
+
self._attributes[prefix + attr.name] = attr
|
|
310
|
+
|
|
306
311
|
def set_attr(self, name="N.N.", value=None, **kwargs):
|
|
307
312
|
"""set Attribute"""
|
|
308
313
|
prefix = kwargs.get("prefix", "")
|
|
309
|
-
if isinstance(name, Attribute):
|
|
314
|
+
if isinstance(name, Attribute) or "Attribute" in name.__class__.__name__:
|
|
310
315
|
attr = name # name is the Attribute!
|
|
311
316
|
else:
|
|
312
317
|
attr = self.get_attr(prefix + name) or Attribute(name, value, **kwargs)
|
|
@@ -419,6 +424,13 @@ class Metadata(object):
|
|
|
419
424
|
d[attr.name] = attr.value
|
|
420
425
|
return d
|
|
421
426
|
|
|
427
|
+
def get_dict(self):
|
|
428
|
+
"""get user attribute as dict"""
|
|
429
|
+
d = {}
|
|
430
|
+
for attr in self.attributes.values():
|
|
431
|
+
d[attr.name] = attr.value
|
|
432
|
+
return d
|
|
433
|
+
|
|
422
434
|
def _to_dataframe(self, attributes):
|
|
423
435
|
"""create dataframe from attributes"""
|
|
424
436
|
d = self._to_dict(attributes)
|
|
@@ -443,6 +455,22 @@ class Metadata(object):
|
|
|
443
455
|
"""create dataframe for user attributes"""
|
|
444
456
|
return self._to_dataframe(self.user_attributes)
|
|
445
457
|
|
|
458
|
+
@property
|
|
459
|
+
def dft(self):
|
|
460
|
+
"""create transposed dataframe for sdata attributes"""
|
|
461
|
+
mt = self.df[["value"]].transpose(copy=True)
|
|
462
|
+
mt.index = [self.get("!sdata_sname").value]
|
|
463
|
+
return mt
|
|
464
|
+
|
|
465
|
+
def get_dft(self, index_name=None):
|
|
466
|
+
"""create transposed dataframe for sdata attributes"""
|
|
467
|
+
if index_name is None:
|
|
468
|
+
index_name = "!sdata_sname"
|
|
469
|
+
mt = self.df[["value"]].transpose(copy=True)
|
|
470
|
+
mt.index = [self.get(index_name).value]
|
|
471
|
+
return mt
|
|
472
|
+
|
|
473
|
+
|
|
446
474
|
@property
|
|
447
475
|
def sdf(self):
|
|
448
476
|
"""create dataframe for sdata attributes"""
|
|
@@ -25,6 +25,28 @@ def test_data():
|
|
|
25
25
|
|
|
26
26
|
assert data2.uuid == uuidobj.hex
|
|
27
27
|
|
|
28
|
+
def test_column_units():
|
|
29
|
+
columns = ["Länge [mm]", "Breite [cm]", "wtf", "Spannung[MPa]"]
|
|
30
|
+
df = pd.DataFrame(columns=columns)
|
|
31
|
+
d = sdata.Data(table=df)
|
|
32
|
+
d.set_column_metadata()
|
|
33
|
+
print(d.sdf)
|
|
34
|
+
c0 = d.m.get("!sdata_column_0")
|
|
35
|
+
|
|
36
|
+
assert "!sdata_column_3" in d.m.keys()
|
|
37
|
+
assert c0
|
|
38
|
+
print(c0.value, c0.unit)
|
|
39
|
+
assert c0.value == "Länge"
|
|
40
|
+
assert c0.unit == "mm"
|
|
41
|
+
|
|
42
|
+
c3 = d.m.get("!sdata_column_3")
|
|
43
|
+
print(c3.value, c3.unit)
|
|
44
|
+
assert c3.value == "Spannung"
|
|
45
|
+
assert c3.unit == "MPa"
|
|
46
|
+
c4 = d.m.get("!sdata_column_4")
|
|
47
|
+
assert c4 is None
|
|
48
|
+
|
|
49
|
+
|
|
28
50
|
def test_group():
|
|
29
51
|
|
|
30
52
|
data1 = sdata.Data(name="data1", uuid="38b26864e7794f5182d38459bab8584f")
|
|
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
|
|
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
|
|
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
|