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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: persist
3
- Version: 3.2
3
+ Version: 3.2.1
4
4
  Summary: Persistent archival of python objects in an importable format.
5
5
  Author-email: Michael McNeil Forbes <michael.forbes+python@gmail.com>
6
6
  Requires-Python: >=3.6.2
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = 'persist'
3
- version = '3.2'
3
+ version = '3.2.1'
4
4
  description = 'Persistent archival of python objects in an importable format.'
5
5
  readme = 'README.md'
6
6
  authors = [
@@ -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.base.spmatrix: _archive_spmatrix})
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 (module, iname, uiname) in imports:
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 (module_, iname_, uiname_) in imports:
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 (name, obj, env) in objects:
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 (name, obj, env) in objects:
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__(
@@ -1,4 +1,5 @@
1
1
  r"""Various Interfaces."""
2
+
2
3
  __all__ = ["IArchivable", "Interface", "implementer", "classImplements"]
3
4
 
4
5
  import warnings
@@ -1,5 +1,6 @@
1
1
  r"""Provides Archivable class.
2
2
  """
3
+
3
4
  __all__ = ["Archivable"]
4
5
 
5
6
  from . import interfaces
File without changes
File without changes