aromatools 0.2.6__tar.gz → 0.2.7__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.

Potentially problematic release.


This version of aromatools might be problematic. Click here for more details.

Files changed (39) hide show
  1. {aromatools-0.2.6 → aromatools-0.2.7}/PKG-INFO +1 -1
  2. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/arogeometric/arogeometric.py +41 -25
  3. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/arogeometric/reporter.py +3 -3
  4. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools.egg-info/PKG-INFO +1 -1
  5. {aromatools-0.2.6 → aromatools-0.2.7}/setup.py +1 -1
  6. {aromatools-0.2.6 → aromatools-0.2.7}/LICENSE +0 -0
  7. {aromatools-0.2.6 → aromatools-0.2.7}/README.md +0 -0
  8. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/__init__.py +0 -0
  9. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/arogeometric/__init__.py +0 -0
  10. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/arogeometric/__main__.py +0 -0
  11. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/aromagnetic/__init__.py +0 -0
  12. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/aromagnetic/__main__.py +0 -0
  13. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/aromagnetic/amg_read_input.py +0 -0
  14. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/aromagnetic/amg_write_inputs.py +0 -0
  15. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/aromagnetic/aromagnetic.py +0 -0
  16. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/aromagnetic/check_out.py +0 -0
  17. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/aromagnetic/cube_to_vtk.py +0 -0
  18. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/aromagnetic/extrac_values.py +0 -0
  19. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/aromagnetic/get_cube.py +0 -0
  20. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/aromagnetic/get_grid.py +0 -0
  21. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/aromagnetic/get_integral.py +0 -0
  22. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/aromagnetic/get_mo.py +0 -0
  23. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/aromagnetic/get_nics_scan.py +0 -0
  24. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/aromagnetic/get_profile.py +0 -0
  25. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/aromagnetic/insert_basis.py +0 -0
  26. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/aromagnetic/make_input.py +0 -0
  27. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/aromagnetic/nics_scan.py +0 -0
  28. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/aromagnetic/parser_mo.py +0 -0
  29. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/aromagnetic/pseudo_pi.py +0 -0
  30. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/aromagnetic/reset_calc.py +0 -0
  31. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/aromagnetic/sum_rest.py +0 -0
  32. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools/aromagnetic/tools.py +0 -0
  33. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools.egg-info/SOURCES.txt +0 -0
  34. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools.egg-info/dependency_links.txt +0 -0
  35. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools.egg-info/entry_points.txt +0 -0
  36. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools.egg-info/requires.txt +0 -0
  37. {aromatools-0.2.6 → aromatools-0.2.7}/aromatools.egg-info/top_level.txt +0 -0
  38. {aromatools-0.2.6 → aromatools-0.2.7}/pyproject.toml +0 -0
  39. {aromatools-0.2.6 → aromatools-0.2.7}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aromatools
3
- Version: 0.2.6
3
+ Version: 0.2.7
4
4
  Summary: Python tools for aromaticity analysis using geometric and magnetic criteria
5
5
  Author: Fernando Martinez-Villarino
6
6
  Author-email: fernandomv5897@gmail.com
@@ -76,52 +76,68 @@ def build_graph(atoms, tol=0.45):
76
76
  G.add_edge(i, j, length=dist, bond_type=bond_type)
77
77
  return G
78
78
 
79
- def find_rings_by_size(G, sizes=(5, 6)):
80
- from itertools import combinations
79
+ def find_rings_by_size(G, sizes=None):
81
80
  rings = set()
82
81
 
82
+ if sizes is None:
83
+ sizes = tuple(range(3, len(G.nodes()) + 1))
84
+
85
+ if isinstance(sizes, int):
86
+ sizes = (sizes,)
87
+ elif isinstance(sizes, range):
88
+ sizes = tuple(sizes)
89
+
90
+ max_size = max(sizes)
91
+
92
+ def canon_ring(path):
93
+ seq1 = list(path)
94
+ seq2 = list(reversed(path))
95
+
96
+ def normalize(seq):
97
+ m = min(seq)
98
+ i = seq.index(m)
99
+ return tuple(seq[i:] + seq[:i])
100
+
101
+ return min(normalize(seq1), normalize(seq2))
102
+
83
103
  def dfs(path, depth):
84
104
  current = path[-1]
105
+
85
106
  if len(set(path)) != len(path):
86
107
  return
87
108
 
88
- if depth > max(sizes):
109
+ if depth > max_size:
89
110
  return
90
111
 
91
112
  for neighbor in G.neighbors(current):
92
113
  if neighbor == path[0] and len(path) in sizes:
93
- cycle = path + [path[0]]
94
- if all(G.has_edge(cycle[i], cycle[i + 1]) for i in range(len(path))):
95
- rings.add(tuple(sorted(path)))
114
+ rings.add(canon_ring(path))
96
115
  elif neighbor not in path:
97
116
  dfs(path + [neighbor], depth + 1)
98
117
 
99
118
  for start in G.nodes():
100
119
  dfs([start], 1)
101
120
 
102
- unique_rings = set()
103
- for ring in rings:
104
- ring = list(ring)
105
- min_idx = ring.index(min(ring))
106
- rotated = ring[min_idx:] + ring[:min_idx]
107
- unique_rings.add(tuple(rotated))
108
-
109
- return [list(r) for r in unique_rings]
121
+ return [list(r) for r in rings]
110
122
 
111
123
  def order_ring_nodes(G, ring):
112
- ordered = [ring[0]]
113
- used = set(ordered)
114
- while len(ordered) < len(ring):
115
- current = ordered[-1]
116
- for neighbor in G.neighbors(current):
117
- if neighbor in ring and neighbor not in used:
118
- ordered.append(neighbor)
119
- used.add(neighbor)
120
- break
121
- return ordered
124
+ ordered = [ring[0]]
125
+ used = set(ordered)
126
+
127
+ while len(ordered) < len(ring):
128
+ current = ordered[-1]
129
+ for neighbor in G.neighbors(current):
130
+ if neighbor in ring and neighbor not in used:
131
+ ordered.append(neighbor)
132
+ used.add(neighbor)
133
+ break
134
+ else:
135
+ raise ValueError(f"Could not consistently order ring nodes: {ring}")
136
+
137
+ return ordered
122
138
 
123
139
  def compute_index(G, atoms, index_type):
124
- rings = find_rings_by_size(G, sizes=(5, 6))
140
+ rings = find_rings_by_size(G)
125
141
  ring_data = []
126
142
  bond_rows = []
127
143
  coords = {i: (x, y, z) for i, (_, x, y, z) in enumerate(atoms)}
@@ -17,12 +17,12 @@ class AtomsReporter:
17
17
 
18
18
  self._graph = build_graph(atoms_list)
19
19
 
20
- # Ahora compute_index devuelve dos DataFrames
21
20
  rings, ring_indices_list, df_index, df_bonds = compute_index(
22
- self._graph, atoms_list, self.index_type
21
+ self._graph,
22
+ atoms_list,
23
+ self.index_type
23
24
  )
24
25
 
25
- # Selección de columnas según tipo de índice
26
26
  if self.index_type == "HOMA":
27
27
  self._df_main = df_index[["Ring", "HOMA93", "HOMAC", "BLA"]]
28
28
  elif self.index_type == "HOMER":
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aromatools
3
- Version: 0.2.6
3
+ Version: 0.2.7
4
4
  Summary: Python tools for aromaticity analysis using geometric and magnetic criteria
5
5
  Author: Fernando Martinez-Villarino
6
6
  Author-email: fernandomv5897@gmail.com
@@ -6,7 +6,7 @@ long_description = (this_directory / "README.md").read_text(encoding="utf-8")
6
6
 
7
7
  setup(
8
8
  name="aromatools",
9
- version="0.2.6",
9
+ version="0.2.7",
10
10
  packages=find_packages(),
11
11
  description="Python tools for aromaticity analysis using geometric and magnetic criteria",
12
12
  long_description=long_description,
File without changes
File without changes
File without changes
File without changes