Skip to content

Commit

Permalink
Fix path to H2O dimer coordinates to work locally and with colab.
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielasd committed Oct 4, 2024
1 parent f3dd8fe commit 591139a
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion website/examples/promolecule_nci.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,43 @@
"The `promolecule` module in QC-AtomDB constructs approximate molecular (promolecular) properties as linear combinations of atomic properties. This allows for the fast calculation of the reduced density gradient for large molecular systems. The following examples show how to calculate several molecular properties. As model systems the water molecule dimer will be used:\n",
"\n",
"<img src=\"images/h2o_dimer.png\" alt=\"drawing\" style=\"width: 300px;\"/>\n",
"\n",
"\n",
"## Install dependencies and download example files\n",
"\n",
"To run this notebook in Google Colab, the AtomDB, IOData and Grid libraries need to be installed. This can be done by uncommenting and running the next cell."
]
},
{
"cell_type": "code",
"execution_count": null,
"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",
"# ! python -m pip install git+https://github.com/theochem/AtomDB.git\n",
"\n",
"# # Download the example files\n",
"# import os\n",
"# from urllib.request import urlretrieve\n",
"\n",
"# fpath = \"data/\"\n",
"# if not os.path.exists(fpath):\n",
"# os.makedirs(fpath, exist_ok=True)\n",
"\n",
"# urlretrieve(\n",
"# \"https://raw.githubusercontent.com/theochem/AtomDB/refs/heads/master/website/examples/data/h2o_dimer.xyz\",\n",
"# os.path.join(fpath, \"h2o_dimer.xyz\")\n",
"# )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"## Loading the water dimer data:\n",
"\n",
Expand All @@ -28,6 +65,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Package 'qc-AtomDB' is not installed.\n",
"Atomic numbers dimer:\n",
" [8. 8. 1. 1. 1. 1.]\n",
"Atomic coordinates dimer:\n",
Expand All @@ -53,7 +91,7 @@
"from importlib_resources import files\n",
"\n",
"# Load the H2O dimer from a .xyz file\n",
"data_file=files(atomdb).joinpath('../website/examples/data/h2o_dimer.xyz')\n",
"data_file= 'data/h2o_dimer.xyz'\n",
"mol_data = iodata.load_one(data_file)\n",
"\n",
"atnums = mol_data.atcorenums\n",
Expand Down

0 comments on commit 591139a

Please sign in to comment.