imt-ring 1.6.36__py3-none-any.whl → 1.6.37__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- {imt_ring-1.6.36.dist-info → imt_ring-1.6.37.dist-info}/METADATA +2 -2
- {imt_ring-1.6.36.dist-info → imt_ring-1.6.37.dist-info}/RECORD +5 -5
- {imt_ring-1.6.36.dist-info → imt_ring-1.6.37.dist-info}/WHEEL +1 -1
- ring/utils/utils.py +18 -2
- {imt_ring-1.6.36.dist-info → imt_ring-1.6.37.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.2
|
2
2
|
Name: imt-ring
|
3
|
-
Version: 1.6.
|
3
|
+
Version: 1.6.37
|
4
4
|
Summary: RING: Recurrent Inertial Graph-based Estimator
|
5
5
|
Author-email: Simon Bachhuber <simon.bachhuber@fau.de>
|
6
6
|
Project-URL: Homepage, https://github.com/SimiPixel/ring
|
@@ -83,10 +83,10 @@ ring/utils/hdf5.py,sha256=BzXwVypZmEZeHVgeGZ78YYdi10NEQtnPhdrb8dQAXo0,5856
|
|
83
83
|
ring/utils/normalizer.py,sha256=67L2BU1MRsMT4pD41ta3JJMppLN0ozFmnwrmXDtnqrQ,1698
|
84
84
|
ring/utils/path.py,sha256=zRPfxYNesvgefkddd26oar6f9433LkMGkhp9dF3rPUs,1926
|
85
85
|
ring/utils/randomize_sys.py,sha256=G_vBIo0OwQkXL2u0djwbaoaeb02C4LQCTNNloOYIU2M,3699
|
86
|
-
ring/utils/utils.py,sha256=
|
86
|
+
ring/utils/utils.py,sha256=gKwOXLxWraeZfX6EbBcg3hkq30DcXN0mcRUeOSTNiMo,7336
|
87
87
|
ring/utils/register_gym_envs/__init__.py,sha256=PtPIRBQJ16339xZ9G9VpvqrvcGbQ_Pk_SUz4tQPa9nQ,94
|
88
88
|
ring/utils/register_gym_envs/saddle.py,sha256=tA5CyW_akSXyDm0xJ83CtOrUMVElH0f9vZtEDDJQalI,4422
|
89
|
-
imt_ring-1.6.
|
90
|
-
imt_ring-1.6.
|
91
|
-
imt_ring-1.6.
|
92
|
-
imt_ring-1.6.
|
89
|
+
imt_ring-1.6.37.dist-info/METADATA,sha256=NN6c8jI6u0PjCtw3ZXs9Ktk6ODPI9igC-qyS1aUIUsI,4251
|
90
|
+
imt_ring-1.6.37.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
91
|
+
imt_ring-1.6.37.dist-info/top_level.txt,sha256=EiT790-lAyi8iwTzJArH3f2k77rwhDn00q-4PlmvDQo,5
|
92
|
+
imt_ring-1.6.37.dist-info/RECORD,,
|
ring/utils/utils.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
from importlib import import_module as _import_module
|
2
2
|
import io
|
3
|
+
from pathlib import Path
|
3
4
|
import pickle
|
4
5
|
import random
|
5
6
|
from typing import Optional
|
@@ -152,13 +153,28 @@ def import_lib(
|
|
152
153
|
|
153
154
|
def pickle_save(obj, path, overwrite: bool = False):
|
154
155
|
path = parse_path(path, extension="pickle", file_exists_ok=overwrite)
|
155
|
-
|
156
|
-
|
156
|
+
try:
|
157
|
+
with open(path, "wb") as file:
|
158
|
+
pickle.dump(obj, file, protocol=5)
|
159
|
+
except OSError as e:
|
160
|
+
print(
|
161
|
+
f"saving with `pickle` throws exception {e}. "
|
162
|
+
+ "Attempting to save using `joblib`"
|
163
|
+
)
|
164
|
+
path = parse_path(path, extension="joblib", file_exists_ok=overwrite)
|
165
|
+
import joblib
|
166
|
+
|
167
|
+
joblib.dump(obj, path)
|
157
168
|
|
158
169
|
|
159
170
|
def pickle_load(
|
160
171
|
path,
|
161
172
|
):
|
173
|
+
if Path(path).suffix == ".joblib":
|
174
|
+
import joblib
|
175
|
+
|
176
|
+
return joblib.load(path)
|
177
|
+
|
162
178
|
path = parse_path(path, extension="pickle", require_is_file=True)
|
163
179
|
with open(path, "rb") as file:
|
164
180
|
obj = pickle.load(file)
|
File without changes
|