syned 1.0.47__py3-none-any.whl → 1.0.48__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.
syned/syned_object.py CHANGED
@@ -1,5 +1,6 @@
1
1
  import copy
2
2
  from collections import OrderedDict
3
+ import pickle
3
4
  try:
4
5
  import json_tricks as json # to save numpy arrays
5
6
  except:
@@ -34,6 +35,8 @@ class SynedObject(object):
34
35
  * to_dictionary()
35
36
  * to_full_dictionary()
36
37
  * to_json()
38
+ * to_hex_tring()
39
+ * from_hex_tring()
37
40
  * info()
38
41
  * set_value_from_key_name()
39
42
  * get_value_from_key_name()
@@ -163,6 +166,14 @@ class SynedObject(object):
163
166
  print("File written to disk: %s"%(file_name))
164
167
  return jsn1
165
168
 
169
+ def to_hex_tring(self):
170
+ return pickle.dumps(self).hex()
171
+
172
+ @classmethod
173
+ def from_hex_tring(cls, hex_string):
174
+ return pickle.loads(bytes.fromhex(hex_string))
175
+
176
+
166
177
  def info_recurrent(self, fd, prefix=" "):
167
178
  """
168
179
  Get text info of recurrent SYNED objects.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: syned
3
- Version: 1.0.47
3
+ Version: 1.0.48
4
4
  Summary: SYNED (SYNchrotron Elements Dictionary) kernel library
5
5
  Home-page: https://github.com/oasys-kit/syned
6
6
  Download-URL: https://github.com/oasys-kit/syned
@@ -14,7 +14,6 @@ Classifier: Development Status :: 5 - Production/Stable
14
14
  Classifier: Environment :: Console
15
15
  Classifier: Environment :: Plugins
16
16
  Classifier: Programming Language :: Python :: 3
17
- Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
18
17
  Classifier: Operating System :: POSIX
19
18
  Classifier: Operating System :: Microsoft :: Windows
20
19
  Classifier: Topic :: Scientific/Engineering :: Visualization
@@ -1,5 +1,5 @@
1
1
  syned/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- syned/syned_object.py,sha256=p9nGtvxVZkNx5JlDol3c-1n8qXRxtFc01SjXV8HLyOs,8033
2
+ syned/syned_object.py,sha256=yJwaiQFdomZFP6ajpWUq0DH8UJoZNykDFGY_AXDJRxw,8283
3
3
  syned/__test/__init__.py,sha256=OQwx0a5g_fzul1uaL4Lsq60GAnadpFUphcVuDbgjCKE,3390
4
4
  syned/__test/test.py,sha256=ID7--g20G8vLj9q817Z8eCIoIEI2O_KVBd01ehivOpc,1172
5
5
  syned/beamline/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
@@ -47,8 +47,8 @@ syned/util/__init__.py,sha256=JmVXq2RSaCjSlvdVrXYfPhCVwJhZjvFjUqBYE8oIni8,742
47
47
  syned/util/json_tools.py,sha256=vC0dQHUJnz3m1PUFK-oawHs7l-IP5WYNbVKv_gOjfNk,7615
48
48
  syned/widget/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
49
  syned/widget/widget_decorator.py,sha256=hfjwWmK9HZe7MtwIOAHT7rUgMYN6VmHqHB2zfVVRY4E,1658
50
- syned-1.0.47.dist-info/licenses/LICENSE,sha256=C5iV2YY_hn_fGUPOveNdbY6tczl4oZCgfy5E8UdLQjk,1094
51
- syned-1.0.47.dist-info/METADATA,sha256=YZtfbepQlzDC7-uqK7UlIrLiicJV0CY-8uaD1sC1-3Q,2468
52
- syned-1.0.47.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
53
- syned-1.0.47.dist-info/top_level.txt,sha256=PMrZrTESxk_mUTBz0gyGBlYvM_3BesYCHB1MUgjSlVE,6
54
- syned-1.0.47.dist-info/RECORD,,
50
+ syned-1.0.48.dist-info/licenses/LICENSE,sha256=C5iV2YY_hn_fGUPOveNdbY6tczl4oZCgfy5E8UdLQjk,1094
51
+ syned-1.0.48.dist-info/METADATA,sha256=MAl_YEgSEX8c6lyXUK0hA2WHrPV8ffVQxieQt-38jUI,2381
52
+ syned-1.0.48.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
53
+ syned-1.0.48.dist-info/top_level.txt,sha256=PMrZrTESxk_mUTBz0gyGBlYvM_3BesYCHB1MUgjSlVE,6
54
+ syned-1.0.48.dist-info/RECORD,,
File without changes