LZGraphs 2.3.0__tar.gz → 2.3.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.
Files changed (67) hide show
  1. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/PKG-INFO +1 -1
  2. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/__init__.py +1 -1
  3. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/graphs/edge_data.py +11 -0
  4. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/mixins/bayesian_posterior.py +12 -2
  5. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs.egg-info/PKG-INFO +1 -1
  6. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/CHANGELOG.md +0 -0
  7. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/CONTRIBUTING.md +0 -0
  8. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/LICENSE +0 -0
  9. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/MANIFEST.in +0 -0
  10. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/README.md +0 -0
  11. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/pyproject.toml +0 -0
  12. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/requirements.txt +0 -0
  13. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/setup.cfg +0 -0
  14. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/setup.py +0 -0
  15. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/_fast_walk.c +0 -0
  16. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/bag_of_words/__init__.py +0 -0
  17. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/bag_of_words/bow_encoder.py +0 -0
  18. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/constants.py +0 -0
  19. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/exceptions/__init__.py +0 -0
  20. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/graphs/__init__.py +0 -0
  21. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/graphs/amino_acid_positional.py +0 -0
  22. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/graphs/graph_operations.py +0 -0
  23. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/graphs/lz_graph_base.py +0 -0
  24. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/graphs/naive.py +0 -0
  25. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/graphs/nucleotide_double_positional.py +0 -0
  26. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/metrics/__init__.py +0 -0
  27. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/metrics/convenience.py +0 -0
  28. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/metrics/diversity.py +0 -0
  29. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/metrics/entropy.py +0 -0
  30. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/metrics/pgen_distribution.py +0 -0
  31. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/metrics/saturation.py +0 -0
  32. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/mixins/__init__.py +0 -0
  33. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/mixins/gene_logic.py +0 -0
  34. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/mixins/gene_prediction.py +0 -0
  35. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/mixins/graph_topology.py +0 -0
  36. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/mixins/lzpgen_distribution.py +0 -0
  37. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/mixins/random_walk.py +0 -0
  38. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/mixins/serialization.py +0 -0
  39. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/mixins/walk_analysis.py +0 -0
  40. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/py.typed +0 -0
  41. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/utilities/__init__.py +0 -0
  42. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/utilities/decomposition.py +0 -0
  43. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/utilities/helpers.py +0 -0
  44. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/utilities/misc.py +0 -0
  45. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/visualization/__init__.py +0 -0
  46. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/visualization/visualize.py +0 -0
  47. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs.egg-info/SOURCES.txt +0 -0
  48. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs.egg-info/dependency_links.txt +0 -0
  49. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs.egg-info/requires.txt +0 -0
  50. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs.egg-info/top_level.txt +0 -0
  51. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_aap_lzgraph.py +0 -0
  52. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_abundance.py +0 -0
  53. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_analytical_distribution.py +0 -0
  54. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_base_class_methods.py +0 -0
  55. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_bow_encoder.py +0 -0
  56. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_diversity_theory.py +0 -0
  57. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_flexible_input.py +0 -0
  58. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_graph_operations.py +0 -0
  59. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_lzpgen_distribution.py +0 -0
  60. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_metrics.py +0 -0
  61. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_naive_lzgraph.py +0 -0
  62. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_ndp_lzgraph.py +0 -0
  63. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_new_features.py +0 -0
  64. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_pgen_fixes.py +0 -0
  65. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_serialization.py +0 -0
  66. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_simulate.py +0 -0
  67. {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_utilities.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: LZGraphs
3
- Version: 2.3.0
3
+ Version: 2.3.1
4
4
  Summary: An Implementation of LZ76 Based Graphs for Repertoire Representation and Analysis
5
5
  Author-email: Thomas Konstantinovsky <thomaskon90@gmail.com>
6
6
  Maintainer-email: Thomas Konstantinovsky <thomaskon90@gmail.com>
@@ -1,4 +1,4 @@
1
- __version__ = "2.3.0"
1
+ __version__ = "2.3.1"
2
2
 
3
3
  # =============================================================================
4
4
  # Graph classes
@@ -87,6 +87,17 @@ class EdgeData:
87
87
  if self.j_genes[j_gene] <= 0:
88
88
  del self.j_genes[j_gene]
89
89
 
90
+ def copy(self):
91
+ """Create a shallow copy of this EdgeData (fast, no pickle)."""
92
+ new = EdgeData.__new__(EdgeData)
93
+ new.count = self.count
94
+ new._weight = self._weight
95
+ new.v_genes = dict(self.v_genes)
96
+ new.j_genes = dict(self.j_genes)
97
+ new._vsum = self._vsum
98
+ new._jsum = self._jsum
99
+ return new
100
+
90
101
  def merge(self, other):
91
102
  """Merge another EdgeData into this one (for graph union).
92
103
 
@@ -1,5 +1,7 @@
1
1
  import copy
2
2
 
3
+ import networkx as nx
4
+
3
5
  from ..graphs.edge_data import EdgeData
4
6
 
5
7
 
@@ -47,9 +49,17 @@ class BayesianPosteriorMixin:
47
49
  seq_list, abd_list = self._parse_posterior_input(sequences, abundances)
48
50
  ind_counts = self._extract_counts_for_posterior(seq_list, abd_list)
49
51
 
50
- # 2. Create a lightweight copy (deep-copy only the nx.DiGraph)
52
+ # 2. Create a lightweight copy with a fast graph clone
53
+ # (avoids copy.deepcopy which does 51M recursive calls on large graphs)
51
54
  posterior = copy.copy(self)
52
- posterior.graph = copy.deepcopy(self.graph)
55
+ g = self.graph
56
+ new_g = nx.DiGraph()
57
+ new_g.add_nodes_from(g.nodes())
58
+ new_g.add_edges_from(
59
+ (a, b, {'data': g[a][b]['data'].copy()})
60
+ for a, b in g.edges()
61
+ )
62
+ posterior.graph = new_g
53
63
 
54
64
  # Deep copy mutable dicts that will be modified
55
65
  posterior.initial_state_counts = dict(self.initial_state_counts)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: LZGraphs
3
- Version: 2.3.0
3
+ Version: 2.3.1
4
4
  Summary: An Implementation of LZ76 Based Graphs for Repertoire Representation and Analysis
5
5
  Author-email: Thomas Konstantinovsky <thomaskon90@gmail.com>
6
6
  Maintainer-email: Thomas Konstantinovsky <thomaskon90@gmail.com>
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