pyphyschemtools 0.1.5__py3-none-any.whl → 0.2.1__py3-none-any.whl
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.
- pyphyschemtools/.ipynb_checkpoints/Chem3D-checkpoint.py +32 -12
- pyphyschemtools/Chem3D.py +32 -12
- pyphyschemtools/__init__.py +1 -1
- {pyphyschemtools-0.1.5.dist-info → pyphyschemtools-0.2.1.dist-info}/METADATA +1 -1
- {pyphyschemtools-0.1.5.dist-info → pyphyschemtools-0.2.1.dist-info}/RECORD +8 -8
- {pyphyschemtools-0.1.5.dist-info → pyphyschemtools-0.2.1.dist-info}/WHEEL +0 -0
- {pyphyschemtools-0.1.5.dist-info → pyphyschemtools-0.2.1.dist-info}/licenses/LICENSE +0 -0
- {pyphyschemtools-0.1.5.dist-info → pyphyschemtools-0.2.1.dist-info}/top_level.txt +0 -0
|
@@ -615,7 +615,9 @@ class molView:
|
|
|
615
615
|
response = requests.get(url)
|
|
616
616
|
if response.status_code == 200:
|
|
617
617
|
content = response.text
|
|
618
|
-
fmt = "
|
|
618
|
+
fmt = "proteindatabank"
|
|
619
|
+
else:
|
|
620
|
+
raise ValueError(f"Could not find PDB ID: {self.mol} on RSCB")
|
|
619
621
|
|
|
620
622
|
elif self.source == 'cod':
|
|
621
623
|
url = f"https://www.crystallography.net/cod/{self.mol}.cif"
|
|
@@ -634,8 +636,21 @@ class molView:
|
|
|
634
636
|
if self.source == 'file':
|
|
635
637
|
if not os.path.exists(self.mol):
|
|
636
638
|
raise FileNotFoundError(f"File not found: {self.mol}")
|
|
639
|
+
|
|
640
|
+
# Extraction de l'extension sans le point
|
|
637
641
|
ext = os.path.splitext(self.mol)[1].lower().replace('.', '')
|
|
638
|
-
|
|
642
|
+
|
|
643
|
+
# Mapping explicite pour ASE
|
|
644
|
+
if ext == 'pdb':
|
|
645
|
+
fmt = 'proteindatabank'
|
|
646
|
+
elif ext == 'xyz':
|
|
647
|
+
fmt = 'xyz'
|
|
648
|
+
elif ext == 'cif':
|
|
649
|
+
fmt = 'cif'
|
|
650
|
+
else:
|
|
651
|
+
# Fallback sur l'extension si format exotique
|
|
652
|
+
fmt = ext
|
|
653
|
+
|
|
639
654
|
with open(self.mol, 'r') as f:
|
|
640
655
|
content = f.read()
|
|
641
656
|
|
|
@@ -649,19 +664,24 @@ class molView:
|
|
|
649
664
|
|
|
650
665
|
# --- EXTRACTION XYZData (Interne) ---
|
|
651
666
|
# On extrait les données ici avant toute modification (RDKit ou Supercell)
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
667
|
+
if self.source == 'ase':
|
|
668
|
+
atoms = self.mol
|
|
669
|
+
else:
|
|
670
|
+
try:
|
|
671
|
+
# On utilise l'alias long d'ASE pour PDB, sinon le format détecté
|
|
672
|
+
atoms = read(io.StringIO(content), format=fmt)
|
|
673
|
+
except Exception as e:
|
|
674
|
+
# Si l'extraction échoue, on tente une dernière fois sans format forcé
|
|
675
|
+
try:
|
|
676
|
+
atoms = read(io.StringIO(content))
|
|
677
|
+
except:
|
|
678
|
+
print(f"Extraction of coordinates is impossible ({e})")
|
|
679
|
+
atoms = Atoms()
|
|
657
680
|
|
|
658
681
|
self.data = XYZData(
|
|
659
|
-
symbols=
|
|
660
|
-
positions=
|
|
682
|
+
symbols=atoms.get_chemical_symbols(),
|
|
683
|
+
positions=atoms.get_positions()
|
|
661
684
|
)
|
|
662
|
-
except Exception as e:
|
|
663
|
-
print(f"Note: Extraction des coordonnées impossible ({e})")
|
|
664
|
-
self.data = None
|
|
665
685
|
|
|
666
686
|
# --- Modern Bond Perception with RDKit ---
|
|
667
687
|
if self.detect_bonds and self.source in ['file', 'mol', 'xyz'] and fmt == 'xyz':
|
pyphyschemtools/Chem3D.py
CHANGED
|
@@ -615,7 +615,9 @@ class molView:
|
|
|
615
615
|
response = requests.get(url)
|
|
616
616
|
if response.status_code == 200:
|
|
617
617
|
content = response.text
|
|
618
|
-
fmt = "
|
|
618
|
+
fmt = "proteindatabank"
|
|
619
|
+
else:
|
|
620
|
+
raise ValueError(f"Could not find PDB ID: {self.mol} on RSCB")
|
|
619
621
|
|
|
620
622
|
elif self.source == 'cod':
|
|
621
623
|
url = f"https://www.crystallography.net/cod/{self.mol}.cif"
|
|
@@ -634,8 +636,21 @@ class molView:
|
|
|
634
636
|
if self.source == 'file':
|
|
635
637
|
if not os.path.exists(self.mol):
|
|
636
638
|
raise FileNotFoundError(f"File not found: {self.mol}")
|
|
639
|
+
|
|
640
|
+
# Extraction de l'extension sans le point
|
|
637
641
|
ext = os.path.splitext(self.mol)[1].lower().replace('.', '')
|
|
638
|
-
|
|
642
|
+
|
|
643
|
+
# Mapping explicite pour ASE
|
|
644
|
+
if ext == 'pdb':
|
|
645
|
+
fmt = 'proteindatabank'
|
|
646
|
+
elif ext == 'xyz':
|
|
647
|
+
fmt = 'xyz'
|
|
648
|
+
elif ext == 'cif':
|
|
649
|
+
fmt = 'cif'
|
|
650
|
+
else:
|
|
651
|
+
# Fallback sur l'extension si format exotique
|
|
652
|
+
fmt = ext
|
|
653
|
+
|
|
639
654
|
with open(self.mol, 'r') as f:
|
|
640
655
|
content = f.read()
|
|
641
656
|
|
|
@@ -649,19 +664,24 @@ class molView:
|
|
|
649
664
|
|
|
650
665
|
# --- EXTRACTION XYZData (Interne) ---
|
|
651
666
|
# On extrait les données ici avant toute modification (RDKit ou Supercell)
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
667
|
+
if self.source == 'ase':
|
|
668
|
+
atoms = self.mol
|
|
669
|
+
else:
|
|
670
|
+
try:
|
|
671
|
+
# On utilise l'alias long d'ASE pour PDB, sinon le format détecté
|
|
672
|
+
atoms = read(io.StringIO(content), format=fmt)
|
|
673
|
+
except Exception as e:
|
|
674
|
+
# Si l'extraction échoue, on tente une dernière fois sans format forcé
|
|
675
|
+
try:
|
|
676
|
+
atoms = read(io.StringIO(content))
|
|
677
|
+
except:
|
|
678
|
+
print(f"Extraction of coordinates is impossible ({e})")
|
|
679
|
+
atoms = Atoms()
|
|
657
680
|
|
|
658
681
|
self.data = XYZData(
|
|
659
|
-
symbols=
|
|
660
|
-
positions=
|
|
682
|
+
symbols=atoms.get_chemical_symbols(),
|
|
683
|
+
positions=atoms.get_positions()
|
|
661
684
|
)
|
|
662
|
-
except Exception as e:
|
|
663
|
-
print(f"Note: Extraction des coordonnées impossible ({e})")
|
|
664
|
-
self.data = None
|
|
665
685
|
|
|
666
686
|
# --- Modern Bond Perception with RDKit ---
|
|
667
687
|
if self.detect_bonds and self.source in ['file', 'mol', 'xyz'] and fmt == 'xyz':
|
pyphyschemtools/__init__.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyphyschemtools
|
|
3
|
-
Version: 0.1
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: A comprehensive Python toolbox for physical chemistry and cheminformatics
|
|
5
5
|
Author-email: "Romuald POTEAU, LPCNO" <romuald.poteau@utoulouse.fr>
|
|
6
6
|
Project-URL: Repository, https://github.com/rpoteau/pyphyschemtools
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
pyphyschemtools/.readthedocs.yaml,sha256=ZTw2bOyF9p3JpeF8Ux0fwhYWO6KHCsroNEOvnXxbYGM,469
|
|
2
|
-
pyphyschemtools/Chem3D.py,sha256=
|
|
2
|
+
pyphyschemtools/Chem3D.py,sha256=zhqUz3g7ubAKLBknsZGWPCuvjhC1V8HyRaDIDqY6vuo,33458
|
|
3
3
|
pyphyschemtools/ML.py,sha256=kR_5vm5TOOjVef8uXCW57y7685ts6K6OkRMBYKP_cYw,1599
|
|
4
4
|
pyphyschemtools/PeriodicTable.py,sha256=LfLSFOzRkirREQlwfeSR3TyvgHyjGiltIZXNmvBkbhQ,13526
|
|
5
|
-
pyphyschemtools/__init__.py,sha256=
|
|
5
|
+
pyphyschemtools/__init__.py,sha256=JIOLN4KtCr8ZUvH8R-l3weEmOY9tJM5L-_bAkEsdMXU,1442
|
|
6
6
|
pyphyschemtools/aithermo.py,sha256=kF8wtuYIJzkUKM2AGubmn9haAJKz-XaBskZ7HjivJeY,14984
|
|
7
7
|
pyphyschemtools/cheminformatics.py,sha256=Qps_JSYWOzZQcXwKElI1iWGjWAPDgwmtDKuJwONsKmI,8977
|
|
8
8
|
pyphyschemtools/core.py,sha256=5fRu83b125w2p_m2H521fLjktyswZHJXNKww1wfBwbU,4847
|
|
@@ -13,7 +13,7 @@ pyphyschemtools/sympyUtilities.py,sha256=LgLloh9dD9Mkff2WNoSnrJa3hxK0axOnK-4GS9w
|
|
|
13
13
|
pyphyschemtools/tools4AS.py,sha256=BVfxf6bHnCciBMdQBSJ76Ja_aA-I_iOqQHZuVb-DsdY,44783
|
|
14
14
|
pyphyschemtools/visualID.py,sha256=JlAd5nnZIliHOiKvkToArYhkbty-OntuFGf2CdPbgo8,3061
|
|
15
15
|
pyphyschemtools/visualID_Eng.py,sha256=o-EdCOduo_qruRrr5kkplixaT1t79f3I3M1Ya5TOc_Q,5244
|
|
16
|
-
pyphyschemtools/.ipynb_checkpoints/Chem3D-checkpoint.py,sha256=
|
|
16
|
+
pyphyschemtools/.ipynb_checkpoints/Chem3D-checkpoint.py,sha256=zhqUz3g7ubAKLBknsZGWPCuvjhC1V8HyRaDIDqY6vuo,33458
|
|
17
17
|
pyphyschemtools/.ipynb_checkpoints/PeriodicTable-checkpoint.py,sha256=LfLSFOzRkirREQlwfeSR3TyvgHyjGiltIZXNmvBkbhQ,13526
|
|
18
18
|
pyphyschemtools/.ipynb_checkpoints/aithermo-checkpoint.py,sha256=kF8wtuYIJzkUKM2AGubmn9haAJKz-XaBskZ7HjivJeY,14984
|
|
19
19
|
pyphyschemtools/.ipynb_checkpoints/core-checkpoint.py,sha256=5fRu83b125w2p_m2H521fLjktyswZHJXNKww1wfBwbU,4847
|
|
@@ -82,8 +82,8 @@ pyphyschemtools/resources/svg/pyPhysChemBanner.png,sha256=sK5NwjbEYJvMAAzPBCqwvr
|
|
|
82
82
|
pyphyschemtools/resources/svg/pyPhysChemBanner.svg,sha256=39LrLnFn7R681Hh3YXB3K17Sp0Xp3ynDOGUbXuORQ3s,4388883
|
|
83
83
|
pyphyschemtools/resources/svg/qrcode-pyPhysChem.png,sha256=rP7X-9eHL7HYj4ffmwBMLfQTaRIOyzShVfavRXiomtw,71070
|
|
84
84
|
pyphyschemtools/resources/svg/repository-open-graph-template.png,sha256=UlnW5BMkLGOv6IAnEi7teDYS_5qeSLmpxRMT9r9m-5Q,51470
|
|
85
|
-
pyphyschemtools-0.1.
|
|
86
|
-
pyphyschemtools-0.1.
|
|
87
|
-
pyphyschemtools-0.1.
|
|
88
|
-
pyphyschemtools-0.1.
|
|
89
|
-
pyphyschemtools-0.1.
|
|
85
|
+
pyphyschemtools-0.2.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
86
|
+
pyphyschemtools-0.2.1.dist-info/METADATA,sha256=BioidHl3jFOUaFy17bWIswfdStVkoTtR4SIrLi140gA,1273
|
|
87
|
+
pyphyschemtools-0.2.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
88
|
+
pyphyschemtools-0.2.1.dist-info/top_level.txt,sha256=N92w2qk4LQ42OSdzK1R2h_x1CyUFaFBOrOML2RnmFgE,16
|
|
89
|
+
pyphyschemtools-0.2.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|