Skip to content

Commit fdcb73a

Browse files
committed
dscribe and sklearn added under def, similarity_threshold set to .999 - tested vs example problem poscar
1 parent 511c389 commit fdcb73a

File tree

2 files changed

+60
-6
lines changed

2 files changed

+60
-6
lines changed

autoadsorbate/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ def _filter_unique_sites_by_soap(
641641
site_df: pd.DataFrame,
642642
cutoff: float = 5.0,
643643
soap_params: dict = None,
644-
similarity_threshold: float = 0.98
644+
similarity_threshold: float = 0.999
645645
) -> pd.DataFrame:
646646

647647
"""

scripts/aads_2025.ipynb

Lines changed: 59 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
{
1212
"cell_type": "code",
13-
"execution_count": null,
13+
"execution_count": 3,
1414
"id": "1b3f770d-d1a5-4498-a508-be4469a8970c",
1515
"metadata": {},
1616
"outputs": [],
@@ -21,7 +21,7 @@
2121
},
2222
{
2323
"cell_type": "code",
24-
"execution_count": 1,
24+
"execution_count": 4,
2525
"id": "cd5c4cd6-d15b-4ad3-89b0-200610d1c960",
2626
"metadata": {},
2727
"outputs": [],
@@ -32,8 +32,8 @@
3232
"from ase.build.tools import sort as sort_atoms\n",
3333
"from matplotlib import colors as mcolors\n",
3434
"\n",
35-
"import sys\n",
36-
"sys.path.insert(0, '/home/djrm/git/hetcattoolbox')\n",
35+
"# import sys\n",
36+
"# sys.path.insert(0, '/home/djrm/git/hetcattoolbox')\n",
3737
"\n",
3838
"from glob import glob\n",
3939
"import pandas as pd\n",
@@ -45,7 +45,7 @@
4545
},
4646
{
4747
"cell_type": "code",
48-
"execution_count": 2,
48+
"execution_count": 5,
4949
"id": "67a98c50-f0d3-49e4-a4d8-183afe68d572",
5050
"metadata": {},
5151
"outputs": [],
@@ -1842,6 +1842,60 @@
18421842
" minhop_trj+=read(file, index=':')\n",
18431843
"len(minhop_trj)"
18441844
]
1845+
},
1846+
{
1847+
"cell_type": "markdown",
1848+
"id": "381b0ed8",
1849+
"metadata": {},
1850+
"source": [
1851+
"### sym reduce debug"
1852+
]
1853+
},
1854+
{
1855+
"cell_type": "code",
1856+
"execution_count": 6,
1857+
"id": "325fe48d",
1858+
"metadata": {},
1859+
"outputs": [
1860+
{
1861+
"name": "stdout",
1862+
"output_type": "stream",
1863+
"text": [
1864+
"len(s.site_df) = 72\n",
1865+
"len(xdf) = 3\n"
1866+
]
1867+
}
1868+
],
1869+
"source": [
1870+
"from pymatgen.core import Structure\n",
1871+
"from pymatgen.io.ase import AseAtomsAdaptor\n",
1872+
"from autoadsorbate.utils import _filter_unique_sites_by_soap\n",
1873+
"\n",
1874+
"structure = Structure.from_file(\"POSCAR\")\n",
1875+
"atoms = AseAtomsAdaptor.get_atoms(structure)\n",
1876+
"\n",
1877+
"s = Surface(atoms)\n",
1878+
"print(f'{len(s.site_df) = }')\n",
1879+
"\n",
1880+
"xdf = _filter_unique_sites_by_soap(s.atoms, s.site_df, similarity_threshold=0.999)\n",
1881+
"print(f'{len(xdf) = }')"
1882+
]
1883+
},
1884+
{
1885+
"cell_type": "code",
1886+
"execution_count": null,
1887+
"id": "1a1d5378",
1888+
"metadata": {},
1889+
"outputs": [],
1890+
"source": []
1891+
},
1892+
{
1893+
"cell_type": "code",
1894+
"execution_count": null,
1895+
"id": "5b99231b",
1896+
"metadata": {},
1897+
"outputs": [],
1898+
"source": []
18451899
}
18461900
],
18471901
"metadata": {

0 commit comments

Comments
 (0)