Skip to content

Commit

Permalink
Use PyPI release of AtomDB when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
FanwangM committed Oct 5, 2024
1 parent ecddd4b commit 754ec58
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 12 deletions.
26 changes: 15 additions & 11 deletions website/examples/getting_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
"metadata": {},
"outputs": [],
"source": [
"## Install the AtomDB package\n",
"## prefer to use the release from PyPI\n",
"#! pip install qc-AtomDB\n",
"## alternatively, install the development version from GitHub\n",
"# ! python -m pip install git+https://github.com/theochem/AtomDB.git"
]
},
Expand Down Expand Up @@ -114,7 +118,7 @@
}
],
"source": [
"%%bash \n",
"%%bash\n",
"c_0_3_json_output=$(python -m atomdb -q slater C 0 3)\n",
"\n",
"# Define an array of keys\n",
Expand Down Expand Up @@ -159,7 +163,7 @@
"source": [
"from atomdb import load\n",
"\n",
"c_slater = load(elem='C', charge=0, mult=3, dataset='slater')"
"c_slater = load(elem=\"C\", charge=0, mult=3, dataset=\"slater\")"
]
},
{
Expand Down Expand Up @@ -268,10 +272,10 @@
"import numpy as np\n",
"\n",
"# Define a uniform radial grid and evaluate the density\n",
"rad_grid = np.linspace(0., 6., num=100)\n",
"rad_grid = np.linspace(0.0, 6.0, num=100)\n",
"# density and kinetic energy density functions (total)\n",
"dens_spline = c_slater.dens_func(spin='t',log=True)\n",
"ked_spline = c_slater.ked_func(spin='t')\n",
"dens_spline = c_slater.dens_func(spin=\"t\", log=True)\n",
"ked_spline = c_slater.ked_func(spin=\"t\")\n",
"\n",
"dens = dens_spline(rad_grid)\n",
"ked = ked_spline(rad_grid)\n",
Expand Down Expand Up @@ -311,14 +315,14 @@
"ax1 = fig.add_subplot(121)\n",
"ax2 = fig.add_subplot(122)\n",
"\n",
"ax1.plot(rad_grid, dens, '-r', linewidth=2)\n",
"ax1.plot(rad_grid, dens, \"-r\", linewidth=2)\n",
"ax1.set(xlabel=\"Radial distance [Bohr]\", ylabel=\"Density [Bohr$^{-3}$]\")\n",
"ax1.set_yscale('log')\n",
"ax1.set_yscale(\"log\")\n",
"ax1.set_ylim(top=1000, bottom=0.00001)\n",
"ax1.set_xlim(left=0., right=6)\n",
"ax1.set_title(f'Spherically averaged density')\n",
"ax1.set_xlim(left=0.0, right=6)\n",
"ax1.set_title(f\"Spherically averaged density\")\n",
"\n",
"ax2.plot(rad_grid, ked, '-b', linewidth=2)\n",
"ax2.plot(rad_grid, ked, \"-b\", linewidth=2)\n",
"ax2.set(xlabel=\"Radial distance [Bohr]\", ylabel=\"KED E$_{h}$ Bohr$^{-3}$\")\n",
"plt.show()"
]
Expand Down Expand Up @@ -354,7 +358,7 @@
],
"source": [
"# Dumping Data to a JSON string\n",
"c_slater_json= c_slater.to_json()\n",
"c_slater_json = c_slater.to_json()\n",
"\n",
"# Print the first 90 characters of the JSON string\n",
"print(c_slater_json[:90])"
Expand Down
8 changes: 7 additions & 1 deletion website/examples/hello_atomdb.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,15 @@
"metadata": {},
"outputs": [],
"source": [
"# # Install packages in Google Colab.\n",
"# # Don't run this cell if packages/data is already in your environment\n",
"# ! pip install git+https://github.com/theochem/iodata.git\n",
"# ! pip install git+https://github.com/theochem/grid.git\n",
"# ! pip install git+https://github.com/theochem/AtomDB.git@dev"
"## Install the AtomDB package\n",
"## prefer to use the release from PyPI\n",
"#! pip install qc-AtomDB\n",
"## alternatively, install the development version from GitHub\n",
"# ! python -m pip install git+https://github.com/theochem/AtomDB.git"
]
},
{
Expand Down
4 changes: 4 additions & 0 deletions website/examples/promolecule_intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"metadata": {},
"outputs": [],
"source": [
"## Install the AtomDB package\n",
"## prefer to use the release from PyPI\n",
"#! pip install qc-AtomDB\n",
"## alternatively, install the development version from GitHub\n",
"# ! python -m pip install git+https://github.com/theochem/AtomDB.git"
]
},
Expand Down
4 changes: 4 additions & 0 deletions website/examples/promolecule_nci.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
"# # Don't run this cell if packages/data is already in your environment\n",
"# ! pip install git+https://github.com/theochem/iodata.git\n",
"# ! pip install git+https://github.com/theochem/grid.git\n",
"## Install the AtomDB package\n",
"## prefer to use the release from PyPI\n",
"#! pip install qc-AtomDB\n",
"## alternatively, install the development version from GitHub\n",
"# ! python -m pip install git+https://github.com/theochem/AtomDB.git\n",
"\n",
"# # Download the example files\n",
Expand Down

0 comments on commit 754ec58

Please sign in to comment.