Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update "QCArchive in 15 minutes" tutorial to use get_properties_df #806

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 35 additions & 2 deletions docs/source/quickstart/qca_15min.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
"Datasets are made up of many records of the same type of computation that can differ in molecule identity or other specification parameters.\n",
"You can pull out iterate over records, see specifications, and compile values from records.\n",
"\n",
"The cell below shows using the `compile_values` method to create a pandas dataframe containing the SCF total energy from each record."
"The cell below shows using the `get_properties_df` method to create a pandas dataframe containing the SCF total energy and SCF iterations from each record."
]
},
{
Expand All @@ -215,12 +215,45 @@
"outputs": [],
"source": [
"# use compile_values to make a dataframe\n",
"df = ds.compile_values(lambda record: record.properties['scf_total_energy'], \"scf_total_energy\")\n",
"df = ds.get_properties_df([\"scf_total_energy\", \"scf_iterations\"])\n",
"\n",
"# view the first 10 rows.\n",
"df.head(10)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This dataframe is a multi-index dataframe with the top level index being the \"specification\" of our calculation.\n",
"For example, we can pull out just our results for `hf/sto-3g`."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"df[\"hf/sto-3g\"]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"`df[\"hf/sto-3g\"][\"scf_total_energy\"]` will give us the SCF total energy for all of the records in the dataset with the `hf/sto-3g` specification."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"df[\"hf/sto-3g\"][\"scf_total_energy\"]"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
Loading