Skip to content

Commit 09b5cf7

Browse files
committed
rerun notebooks
1 parent e82c9d7 commit 09b5cf7

File tree

3 files changed

+221
-36
lines changed

3 files changed

+221
-36
lines changed

docs/jupyter_execute/notebooks/localization.ipynb

Lines changed: 198 additions & 20 deletions
Large diffs are not rendered by default.

docs/jupyter_execute/notebooks/usage.ipynb

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,16 @@
8282
"metadata": {},
8383
"outputs": [
8484
{
85-
"name": "stderr",
86-
"output_type": "stream",
87-
"text": [
88-
"/Users/michaelwilliamsdelabastida/Code/Nbed/.venv/lib/python3.13/site-packages/pyscf/dft/libxc.py:512: UserWarning: Since PySCF-2.3, B3LYP (and B3P86) are changed to the VWN-RPA variant, corresponding to the original definition by Stephens et al. (issue 1480) and the same as the B3LYP functional in Gaussian. To restore the VWN5 definition, you can put the setting \"B3LYP_WITH_VWN5 = True\" in pyscf_conf.py\n",
89-
" warnings.warn('Since PySCF-2.3, B3LYP (and B3P86) are changed to the VWN-RPA variant, '\n"
85+
"ename": "ValidationError",
86+
"evalue": "1 validation error for NbedConfig\nrun_virtual_localization\n Extra inputs are not permitted [type=extra_forbidden, input_value=True, input_type=bool]\n For further information visit https://errors.pydantic.dev/2.11/v/extra_forbidden",
87+
"output_type": "error",
88+
"traceback": [
89+
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
90+
"\u001b[31mValidationError\u001b[39m Traceback (most recent call last)",
91+
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[2]\u001b[39m\u001b[32m, line 3\u001b[39m\n\u001b[32m 1\u001b[39m \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01mnbed\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mimport\u001b[39;00m nbed\n\u001b[32m----> \u001b[39m\u001b[32m3\u001b[39m result = \u001b[43mnbed\u001b[49m\u001b[43m(\u001b[49m\u001b[43mconfig\u001b[49m\u001b[43m=\u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mtest_config.json\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n",
92+
"\u001b[36mFile \u001b[39m\u001b[32m~/Code/Nbed/nbed/embed.py:66\u001b[39m, in \u001b[36mnbed\u001b[39m\u001b[34m(config, **config_kwargs)\u001b[39m\n\u001b[32m 64\u001b[39m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28mopen\u001b[39m(FilePath(config)) \u001b[38;5;28;01mas\u001b[39;00m f:\n\u001b[32m 65\u001b[39m data = json.load(f)\n\u001b[32m---> \u001b[39m\u001b[32m66\u001b[39m config = \u001b[43mNbedConfig\u001b[49m\u001b[43m(\u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mdata\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 67\u001b[39m config = overwrite_config_kwargs(config, **config_kwargs)\n\u001b[32m 68\u001b[39m \u001b[38;5;28;01mcase\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n",
93+
"\u001b[36mFile \u001b[39m\u001b[32m~/Code/Nbed/.venv/lib/python3.13/site-packages/pydantic/main.py:253\u001b[39m, in \u001b[36mBaseModel.__init__\u001b[39m\u001b[34m(self, **data)\u001b[39m\n\u001b[32m 251\u001b[39m \u001b[38;5;66;03m# `__tracebackhide__` tells pytest and some other tools to omit this function from tracebacks\u001b[39;00m\n\u001b[32m 252\u001b[39m __tracebackhide__ = \u001b[38;5;28;01mTrue\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m253\u001b[39m validated_self = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m__pydantic_validator__\u001b[49m\u001b[43m.\u001b[49m\u001b[43mvalidate_python\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdata\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mself_instance\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[32m 254\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m validated_self:\n\u001b[32m 255\u001b[39m warnings.warn(\n\u001b[32m 256\u001b[39m \u001b[33m'\u001b[39m\u001b[33mA custom validator is returning a value other than `self`.\u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[33m'\u001b[39m\n\u001b[32m 257\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mReturning anything other than `self` from a top level model validator isn\u001b[39m\u001b[33m'\u001b[39m\u001b[33mt supported when validating via `__init__`.\u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[33m\"\u001b[39m\n\u001b[32m 258\u001b[39m \u001b[33m'\u001b[39m\u001b[33mSee the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.\u001b[39m\u001b[33m'\u001b[39m,\n\u001b[32m 259\u001b[39m stacklevel=\u001b[32m2\u001b[39m,\n\u001b[32m 260\u001b[39m )\n",
94+
"\u001b[31mValidationError\u001b[39m: 1 validation error for NbedConfig\nrun_virtual_localization\n Extra inputs are not permitted [type=extra_forbidden, input_value=True, input_type=bool]\n For further information visit https://errors.pydantic.dev/2.11/v/extra_forbidden"
9095
]
9196
}
9297
],
@@ -216,7 +221,7 @@
216221
},
217222
{
218223
"cell_type": "code",
219-
"execution_count": 7,
224+
"execution_count": 25,
220225
"metadata": {},
221226
"outputs": [
222227
{
@@ -225,7 +230,7 @@
225230
"dict_keys(['scf', 'v_emb', 'mo_energies_emb_pre_del', 'mo_energies_emb_post_del', 'correction', 'beta_correction', 'cl', 'e_rhf', 'classical_energy', 'e_ccsd', 'ccsd_emb', 'e_fci', 'fci_emb', 'hf_emb', 'scf_dft', 'v_emb_dft', 'dft_correction', 'dft_correction_beta', 'e_dft_in_dft', 'emb_dft', 'second_quantised'])"
226231
]
227232
},
228-
"execution_count": 7,
233+
"execution_count": 25,
229234
"metadata": {},
230235
"output_type": "execute_result"
231236
}
@@ -245,16 +250,16 @@
245250
},
246251
{
247252
"cell_type": "code",
248-
"execution_count": 8,
253+
"execution_count": 31,
249254
"metadata": {},
250255
"outputs": [
251256
{
252257
"data": {
253258
"text/plain": [
254-
"<pyscf.scf.uhf.UHF at 0x12324c380>"
259+
"<pyscf.scf.uhf.UHF at 0x130d5bf00>"
255260
]
256261
},
257-
"execution_count": 8,
262+
"execution_count": 31,
258263
"metadata": {},
259264
"output_type": "execute_result"
260265
}
@@ -265,7 +270,7 @@
265270
},
266271
{
267272
"cell_type": "code",
268-
"execution_count": 9,
273+
"execution_count": 30,
269274
"metadata": {},
270275
"outputs": [
271276
{
@@ -274,7 +279,7 @@
274279
"np.float64(-14.229086664077219)"
275280
]
276281
},
277-
"execution_count": 9,
282+
"execution_count": 30,
278283
"metadata": {},
279284
"output_type": "execute_result"
280285
}
@@ -296,7 +301,7 @@
296301
},
297302
{
298303
"cell_type": "code",
299-
"execution_count": 10,
304+
"execution_count": 26,
300305
"metadata": {},
301306
"outputs": [],
302307
"source": [
@@ -305,7 +310,7 @@
305310
},
306311
{
307312
"cell_type": "code",
308-
"execution_count": 11,
313+
"execution_count": 27,
309314
"metadata": {},
310315
"outputs": [
311316
{
@@ -314,7 +319,7 @@
314319
"(np.float64(-14.229086664077219), (10, 10), (10, 10, 10, 10))"
315320
]
316321
},
317-
"execution_count": 11,
322+
"execution_count": 27,
318323
"metadata": {},
319324
"output_type": "execute_result"
320325
}
@@ -334,7 +339,7 @@
334339
},
335340
{
336341
"cell_type": "code",
337-
"execution_count": 12,
342+
"execution_count": 41,
338343
"metadata": {},
339344
"outputs": [
340345
{

tests/test_localizers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ def test_cl_shell_numbers(global_rks, global_uks) -> None:
248248
== unrestricted_virt.shells[1]
249249
)
250250

251+
def test_pao_localizer(global_rks, global_uks) -> None:
252+
pass
251253

252254
def test_ace_localizer(global_rks, global_uks) -> None:
253255
restricted = ACELocalizer(

0 commit comments

Comments
 (0)