Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sgbaird committed May 30, 2022
2 parents 042040d + eb4d526 commit 77fcfb1
Showing 1 changed file with 102 additions and 0 deletions.
102 changes: 102 additions & 0 deletions notebooks/default_feature_ranges.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 106127/106127 [19:32<00:00, 90.52it/s]\n"
]
}
],
"source": [
"import numpy as np\n",
"import pandas as pd\n",
"from pymatgen.ext.matproj import MPRester\n",
"\n",
"with MPRester(\"MmKt1VFA7e0UDs6L\") as m:\n",
" results = m.query(\n",
" {\"nelements\": {\"$gte\": 2},\n",
" \"nsites\": {\"$lte\": 52}},\n",
" properties=[\"structure\"],\n",
" )"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"range of a is: 2.296021 - 66.29136774227022\n",
"range of b is: 2.258778 - 61.125585795588215\n",
"range of c is: 2.131537 - 130.453537\n",
"range of volume is: 11.91856931582488 - 20090.90640762975\n",
"range of pair-wise distance is: 0.7249349602879995 - 64.8913973530744\n"
]
}
],
"source": [
"df = pd.DataFrame(results)\n",
"\n",
"a = []\n",
"b = []\n",
"c = []\n",
"volume = []\n",
"distance = []\n",
"\n",
"for s in df.structure:\n",
" a.append(s.lattice.a)\n",
" b.append(s.lattice.b)\n",
" c.append(s.lattice.c)\n",
" volume.append(s.lattice.volume)\n",
" distance.append(s.distance_matrix)\n",
"\n",
"print('range of a is: ', min(a), '-', max(a))\n",
"print('range of b is: ', min(b), '-', max(b))\n",
"print('range of c is: ', min(c), '-', max(c))\n",
"print('range of volume is: ', min(volume), '-', max(volume))\n",
"\n",
"dis_min_tmp = []\n",
"dis_max_tmp = []\n",
"for c in range (len(distance)):\n",
" dis_min_tmp.append(min(distance[c][np.nonzero(distance[c])]))\n",
" dis_max_tmp.append(max(distance[c][np.nonzero(distance[c])]))\n",
"\n",
"print('range of pair-wise distance is: ', min(dis_min_tmp), '-', max(dis_max_tmp))"
]
}
],
"metadata": {
"interpreter": {
"hash": "195ed5f8fd5aa2bed03100f3bbdf572faa54699dd064fdba078b2220f1314591"
},
"kernelspec": {
"display_name": "Python 3.9.12 ('xtal2png')",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.12"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}

0 comments on commit 77fcfb1

Please sign in to comment.