persist 3.2__tar.gz → 3.2.1__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.
- {persist-3.2 → persist-3.2.1}/PKG-INFO +1 -1
- {persist-3.2 → persist-3.2.1}/pyproject.toml +1 -1
- {persist-3.2 → persist-3.2.1}/src/persist/archive.py +13 -5
- {persist-3.2 → persist-3.2.1}/src/persist/interfaces.py +1 -0
- {persist-3.2 → persist-3.2.1}/src/persist/objects.py +1 -0
- {persist-3.2 → persist-3.2.1}/README.md +0 -0
- {persist-3.2 → persist-3.2.1}/src/persist/__init__.py +0 -0
- {persist-3.2 → persist-3.2.1}/src/persist/_contrib/RADLogic/__init__.py +0 -0
- {persist-3.2 → persist-3.2.1}/src/persist/_contrib/RADLogic/topsort.py +0 -0
- {persist-3.2 → persist-3.2.1}/src/persist/_contrib/README +0 -0
- {persist-3.2 → persist-3.2.1}/src/persist/_contrib/__init__.py +0 -0
|
@@ -206,6 +206,7 @@ unreliable::
|
|
|
206
206
|
except NameError: pass
|
|
207
207
|
|
|
208
208
|
"""
|
|
209
|
+
|
|
209
210
|
from __future__ import division, with_statement
|
|
210
211
|
|
|
211
212
|
from collections import OrderedDict
|
|
@@ -243,6 +244,10 @@ try:
|
|
|
243
244
|
import scipy.sparse
|
|
244
245
|
|
|
245
246
|
sp = scipy
|
|
247
|
+
|
|
248
|
+
if not hasattr(sp.sparse, "spmatrix"):
|
|
249
|
+
sp.sparse.spmatrix = sp.sparse.base.spmatrix
|
|
250
|
+
|
|
246
251
|
except ImportError: # pragma: no cover
|
|
247
252
|
sp = None
|
|
248
253
|
|
|
@@ -274,6 +279,7 @@ class ArchiveError(Exception):
|
|
|
274
279
|
|
|
275
280
|
class CycleError(ArchiveError):
|
|
276
281
|
r"""Cycle found in archive."""
|
|
282
|
+
|
|
277
283
|
message = "Archive contains cyclic dependencies."
|
|
278
284
|
|
|
279
285
|
def __init__(self, *v):
|
|
@@ -691,6 +697,7 @@ class Archive(object):
|
|
|
691
697
|
...
|
|
692
698
|
ValueError: Can't insert 'y' into single_item_mode=True archive with 'x'.
|
|
693
699
|
"""
|
|
700
|
+
|
|
694
701
|
data_name = "_arrays"
|
|
695
702
|
|
|
696
703
|
def __init__(
|
|
@@ -936,7 +943,7 @@ class Archive(object):
|
|
|
936
943
|
_dispatch.update({np.ndarray: _archive_ndarray, np.ufunc: _archive_func})
|
|
937
944
|
|
|
938
945
|
if sp:
|
|
939
|
-
_dispatch.update({sp.sparse.
|
|
946
|
+
_dispatch.update({sp.sparse.spmatrix: _archive_spmatrix})
|
|
940
947
|
|
|
941
948
|
def unique_name(self, name):
|
|
942
949
|
r"""Return a unique name not contained in the archive."""
|
|
@@ -1274,7 +1281,7 @@ class Archive(object):
|
|
|
1274
1281
|
"""
|
|
1275
1282
|
import_lines = []
|
|
1276
1283
|
del_lines = []
|
|
1277
|
-
for
|
|
1284
|
+
for module, iname, uiname in imports:
|
|
1278
1285
|
assert iname is not None or uiname is not None
|
|
1279
1286
|
if iname is None:
|
|
1280
1287
|
import_lines.append("import {} as {}".format(module, uiname))
|
|
@@ -2016,7 +2023,7 @@ class GraphMixin(object):
|
|
|
2016
2023
|
|
|
2017
2024
|
# Check for duplicate imports
|
|
2018
2025
|
replacements = {}
|
|
2019
|
-
for
|
|
2026
|
+
for module_, iname_, uiname_ in imports:
|
|
2020
2027
|
mod_inames = list(zip(*_unzip(self.imports)[:2]))
|
|
2021
2028
|
if (module_, iname_) in mod_inames:
|
|
2022
2029
|
# Import already specified. Just refer to it
|
|
@@ -2139,7 +2146,7 @@ class Graph(GraphMixin):
|
|
|
2139
2146
|
self.robust_replace = robust_replace
|
|
2140
2147
|
|
|
2141
2148
|
# First insert the root nodes
|
|
2142
|
-
for
|
|
2149
|
+
for name, obj, env in objects:
|
|
2143
2150
|
node = self._new_node(obj, env, name)
|
|
2144
2151
|
self.roots.add(node.id)
|
|
2145
2152
|
self.envs[node.id] = env
|
|
@@ -2422,7 +2429,7 @@ class _Graph(GraphMixin):
|
|
|
2422
2429
|
self.names = set()
|
|
2423
2430
|
|
|
2424
2431
|
# First insert the root nodes
|
|
2425
|
-
for
|
|
2432
|
+
for name, obj, env in objects:
|
|
2426
2433
|
node = self._new_node(obj, env, name)
|
|
2427
2434
|
self.roots.add(node.id)
|
|
2428
2435
|
self.envs[node.id] = env
|
|
@@ -2997,6 +3004,7 @@ class DataSet(object):
|
|
|
2997
3004
|
>>> shutil.rmtree(t)
|
|
2998
3005
|
|
|
2999
3006
|
"""
|
|
3007
|
+
|
|
3000
3008
|
_lock_file_name = "_locked"
|
|
3001
3009
|
|
|
3002
3010
|
def __init__(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|