aromatools 0.2.6__tar.gz → 0.2.8__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.8}/PKG-INFO +1 -1
  2. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/arogeometric/arogeometric.py +41 -25
  3. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/arogeometric/reporter.py +3 -3
  4. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/aromagnetic/aromagnetic.py +0 -11
  5. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/aromagnetic/make_input.py +8 -8
  6. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools.egg-info/PKG-INFO +1 -1
  7. {aromatools-0.2.6 → aromatools-0.2.8}/setup.py +1 -1
  8. {aromatools-0.2.6 → aromatools-0.2.8}/LICENSE +0 -0
  9. {aromatools-0.2.6 → aromatools-0.2.8}/README.md +0 -0
  10. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/__init__.py +0 -0
  11. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/arogeometric/__init__.py +0 -0
  12. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/arogeometric/__main__.py +0 -0
  13. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/aromagnetic/__init__.py +0 -0
  14. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/aromagnetic/__main__.py +0 -0
  15. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/aromagnetic/amg_read_input.py +0 -0
  16. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/aromagnetic/amg_write_inputs.py +0 -0
  17. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/aromagnetic/check_out.py +0 -0
  18. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/aromagnetic/cube_to_vtk.py +0 -0
  19. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/aromagnetic/extrac_values.py +0 -0
  20. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/aromagnetic/get_cube.py +0 -0
  21. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/aromagnetic/get_grid.py +0 -0
  22. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/aromagnetic/get_integral.py +0 -0
  23. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/aromagnetic/get_mo.py +0 -0
  24. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/aromagnetic/get_nics_scan.py +0 -0
  25. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/aromagnetic/get_profile.py +0 -0
  26. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/aromagnetic/insert_basis.py +0 -0
  27. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/aromagnetic/nics_scan.py +0 -0
  28. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/aromagnetic/parser_mo.py +0 -0
  29. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/aromagnetic/pseudo_pi.py +0 -0
  30. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/aromagnetic/reset_calc.py +0 -0
  31. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/aromagnetic/sum_rest.py +0 -0
  32. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools/aromagnetic/tools.py +0 -0
  33. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools.egg-info/SOURCES.txt +0 -0
  34. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools.egg-info/dependency_links.txt +0 -0
  35. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools.egg-info/entry_points.txt +0 -0
  36. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools.egg-info/requires.txt +0 -0
  37. {aromatools-0.2.6 → aromatools-0.2.8}/aromatools.egg-info/top_level.txt +0 -0
  38. {aromatools-0.2.6 → aromatools-0.2.8}/pyproject.toml +0 -0
  39. {aromatools-0.2.6 → aromatools-0.2.8}/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.8
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":
@@ -10,17 +10,6 @@ from .reset_calc import main as reset_calc_main
10
10
  from .check_out import main as check_out_main
11
11
  from .sum_rest import main as sum_rest_main
12
12
 
13
- '''
14
- from .get_cube import main as get_cube_main
15
- from .get_grid import main as get_grid_main
16
- from .get_integral import main as get_integral_main
17
- from .get_mo import main as get_mo_main
18
- from .get_nics_scan import main as get_nics_scan_main
19
- from .get_profile import main as get_profile_main
20
- from .extrac_values import main as extract_values_main
21
- from .nics_scan import main as nics_scan_main
22
- '''
23
-
24
13
  BANNER = r"""
25
14
  ======================================================================
26
15
  AROMAGNETIC
@@ -9,7 +9,7 @@ GEN_INPUT = """
9
9
  # ================================
10
10
 
11
11
  # --------------------------------
12
- # 1. General Information
12
+ # General Information
13
13
  # --------------------------------
14
14
 
15
15
  NAME_MOLECULE name_molecule
@@ -27,7 +27,7 @@ PSEUDO_PI NO # YES or NO
27
27
 
28
28
 
29
29
  # --------------------------------
30
- # 2. Module Switchboard
30
+ # Module Switchboard
31
31
  # --------------------------------
32
32
  # Turn ON only what you need.
33
33
 
@@ -37,7 +37,7 @@ NICS_SCAN_XY_MODULE OFF
37
37
 
38
38
 
39
39
  # --------------------------------
40
- # 3. GRID (Grid generation)
40
+ # GRID (Grid generation)
41
41
  # --------------------------------
42
42
  # Required if GRID_MODULE = ON
43
43
 
@@ -47,13 +47,13 @@ GA_MAX 200 # Maximum number of ghost atoms per input
47
47
  EXTERNAL_FIELD 0.0 0.0 1.0 # Bx By Bz
48
48
  NUM_POINTS 50 50 50 # Nx Ny Nz
49
49
  GRID_MARGIN 2.0 # Å
50
- VTK_FILES YES # NO
50
+ VTK_FILES YES # YES or NO
51
51
 
52
52
  END_GRID
53
53
 
54
54
 
55
55
  # --------------------------------
56
- # 4. Profile (1D normal to ring)
56
+ # Profile (1D normal to ring)
57
57
  # --------------------------------
58
58
  # Required if PROFILE_MODULE = ON
59
59
  #
@@ -78,7 +78,7 @@ END_PROFILE
78
78
 
79
79
 
80
80
  # --------------------------------
81
- # 5. NICS Scan XY (Transversal scan)
81
+ # NICS Scan XY (Transversal scan)
82
82
  # --------------------------------
83
83
  # Required if NICS_SCAN_XY_MODULE = ON
84
84
  #
@@ -98,7 +98,7 @@ END_NICS_SCAN_XY
98
98
 
99
99
 
100
100
  # --------------------------------
101
- # 6. Orbital Partition (optional)
101
+ # Orbital Partition (optional)
102
102
  # --------------------------------
103
103
 
104
104
  BEGIN_ORBITALS
@@ -112,7 +112,7 @@ END_ORBITALS
112
112
 
113
113
 
114
114
  # --------------------------------
115
- # 7. ORCA Block (Optional)
115
+ # ORCA Block (Optional)
116
116
  # --------------------------------
117
117
  # Used only if PROGRAM = ORCA.
118
118
  # If present, this block overrides PROCS/MEMORY_GB
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aromatools
3
- Version: 0.2.6
3
+ Version: 0.2.8
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.8",
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