Skip to content

Commit ebcfc13

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent a062a06 commit ebcfc13

5 files changed

+54
-41
lines changed

docs/source/examples/01_Data_Loading_and_Selection.ipynb

+35-16
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,22 @@
3333
}
3434
],
3535
"source": [
36-
"import ipsuite as ips\n",
3736
"from zntrack.utils import cwd_temp_dir\n",
3837
"\n",
38+
"import ipsuite as ips\n",
39+
"\n",
3940
"temp_dir = cwd_temp_dir()\n",
4041
"\n",
41-
"import ipsuite as ips\n",
4242
"\n",
4343
"import os\n",
44+
"\n",
4445
"from ase import units\n",
4546
"from ase.calculators.emt import EMT\n",
4647
"from ase.io.trajectory import TrajectoryWriter\n",
4748
"from ase.lattice.cubic import FaceCenteredCubic\n",
48-
"from ase.md.velocitydistribution import MaxwellBoltzmannDistribution\n",
4949
"from ase.md.langevin import Langevin\n",
50-
"from ase.visualize import view\n"
50+
"from ase.md.velocitydistribution import MaxwellBoltzmannDistribution\n",
51+
"from ase.visualize import view"
5152
]
5253
},
5354
{
@@ -119,10 +120,10 @@
119120
"# Set up a crystal\n",
120121
"atoms = FaceCenteredCubic(\n",
121122
" directions=[[1, 0, 0], [0, 1, 0], [0, 0, 1]],\n",
122-
" symbol='Cu',\n",
123+
" symbol=\"Cu\",\n",
123124
" size=(size, size, size),\n",
124-
" pbc=True\n",
125-
")\n"
125+
" pbc=True,\n",
126+
")"
126127
]
127128
},
128129
{
@@ -225,7 +226,7 @@
225226
"metadata": {},
226227
"outputs": [],
227228
"source": [
228-
"trajectory.load() # requires the project to have been run"
229+
"trajectory.load() # requires the project to have been run"
229230
]
230231
},
231232
{
@@ -296,9 +297,19 @@
296297
],
297298
"source": [
298299
"with project:\n",
299-
" random_test_selection = ips.RandomSelection(data=trajectory, n_configurations=10, name=\"random_test_selection\")\n",
300-
" random_val_selection = ips.RandomSelection(data=random_test_selection.excluded_atoms, n_configurations=15, name=\"random_val_selection\")\n",
301-
" random_train_selection = ips.RandomSelection(data=random_val_selection.excluded_atoms, n_configurations=75, name=\"random_train_selection\")\n",
300+
" random_test_selection = ips.RandomSelection(\n",
301+
" data=trajectory, n_configurations=10, name=\"random_test_selection\"\n",
302+
" )\n",
303+
" random_val_selection = ips.RandomSelection(\n",
304+
" data=random_test_selection.excluded_atoms,\n",
305+
" n_configurations=15,\n",
306+
" name=\"random_val_selection\",\n",
307+
" )\n",
308+
" random_train_selection = ips.RandomSelection(\n",
309+
" data=random_val_selection.excluded_atoms,\n",
310+
" n_configurations=75,\n",
311+
" name=\"random_train_selection\",\n",
312+
" )\n",
302313
"project.repro()"
303314
]
304315
},
@@ -416,12 +427,20 @@
416427
"with ips.Project() as project:\n",
417428
" trajectory = ips.AddData(file=traj_path, name=\"trajectory\")\n",
418429
" test_split = ips.SplitSelection(data=trajectory, split=0.1, name=\"test_split\")\n",
419-
" val_split = ips.SplitSelection(data=test_split.excluded_atoms, split=0.17, name=\"val_split\") # 0.15 / 0.9 * 1.0 \\approx 0.17\n",
420-
" train_split = val_split.excluded_atoms # 0.8 of the total data\n",
430+
" val_split = ips.SplitSelection(\n",
431+
" data=test_split.excluded_atoms, split=0.17, name=\"val_split\"\n",
432+
" ) # 0.15 / 0.9 * 1.0 \\approx 0.17\n",
433+
" train_split = val_split.excluded_atoms # 0.8 of the total data\n",
421434
"\n",
422-
" test_data = ips.UniformTemporalSelection(data=test_split, n_configurations=10, name=\"test_data\")\n",
423-
" val_data = ips.UniformTemporalSelection(data=val_split, n_configurations=15, name=\"val_data\")\n",
424-
" train_data = ips.UniformEnergeticSelection(data=train_split, n_configurations=80, name=\"train_data\")\n",
435+
" test_data = ips.UniformTemporalSelection(\n",
436+
" data=test_split, n_configurations=10, name=\"test_data\"\n",
437+
" )\n",
438+
" val_data = ips.UniformTemporalSelection(\n",
439+
" data=val_split, n_configurations=15, name=\"val_data\"\n",
440+
" )\n",
441+
" train_data = ips.UniformEnergeticSelection(\n",
442+
" data=train_split, n_configurations=80, name=\"train_data\"\n",
443+
" )\n",
425444
"\n",
426445
"project.repro()"
427446
]

docs/source/examples/03_Analysing_Datasets_and_Model_Predictions.ipynb

+4-6
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,19 @@
4242
}
4343
],
4444
"source": [
45-
"import ipsuite as ips\n",
4645
"from zntrack.utils import cwd_temp_dir\n",
4746
"\n",
4847
"temp_dir = cwd_temp_dir()\n",
4948
"\n",
50-
"import ipsuite as ips\n",
5149
"\n",
5250
"import os\n",
51+
"\n",
5352
"from ase import units\n",
5453
"from ase.calculators.emt import EMT\n",
5554
"from ase.io.trajectory import TrajectoryWriter\n",
5655
"from ase.lattice.cubic import FaceCenteredCubic\n",
57-
"from ase.md.velocitydistribution import MaxwellBoltzmannDistribution\n",
5856
"from ase.md.langevin import Langevin\n",
59-
"from ase.visualize import view\n"
57+
"from ase.md.velocitydistribution import MaxwellBoltzmannDistribution"
6058
]
6159
},
6260
{
@@ -115,9 +113,9 @@
115113
"# Set up a crystal\n",
116114
"atoms = FaceCenteredCubic(\n",
117115
" directions=[[1, 0, 0], [0, 1, 0], [0, 0, 1]],\n",
118-
" symbol='Cu',\n",
116+
" symbol=\"Cu\",\n",
119117
" size=(size, size, size),\n",
120-
" pbc=True\n",
118+
" pbc=True,\n",
121119
")"
122120
]
123121
},

docs/source/examples/04_Molecular_Dynamics_Structure_Generation_and_Simulation.ipynb

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
"execution_count": null,
1414
"metadata": {},
1515
"outputs": [],
16-
"source": [
17-
"import ipsuite as ips"
18-
]
16+
"source": []
1917
}
2018
],
2119
"metadata": {

docs/source/examples/05_Labeling_with_Calculators.ipynb

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
"execution_count": null,
1414
"metadata": {},
1515
"outputs": [],
16-
"source": [
17-
"import ipsuite as ips"
18-
]
16+
"source": []
1917
}
2018
],
2119
"metadata": {

docs/source/examples/06_Bootstrapping_Datasets.ipynb

+13-13
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@
4949
}
5050
],
5151
"source": [
52-
"import ipsuite as ips\n",
53-
"import znflow\n",
5452
"import matplotlib.pyplot as plt\n",
55-
"\n",
53+
"import znflow\n",
5654
"from zntrack.utils import cwd_temp_dir\n",
5755
"\n",
56+
"import ipsuite as ips\n",
57+
"\n",
5858
"temp_dir = cwd_temp_dir()"
5959
]
6060
},
@@ -372,9 +372,7 @@
372372
"\n",
373373
"with ips.Project() as project:\n",
374374
" water = ips.Smiles2Atoms(smiles=\"O\")\n",
375-
" packmol = ips.Packmol(\n",
376-
" data=[water.atoms], count=[10], density=997\n",
377-
" )\n",
375+
" packmol = ips.Packmol(data=[water.atoms], count=[10], density=997)\n",
378376
"\n",
379377
" opt_calc = ips.xTBSinglePoint(data=packmol, method=\"gfn1-xtb\", name=\"opt_calc\")\n",
380378
"\n",
@@ -390,27 +388,29 @@
390388
" data=geopt.atoms,\n",
391389
" data_id=-1,\n",
392390
" n_configurations=n_configs,\n",
393-
" maximum=0.08, # Ang max atomic displacement\n",
394-
" include_original=True\n",
391+
" maximum=0.08, # Ang max atomic displacement\n",
392+
" include_original=True,\n",
395393
" )\n",
396394
" rotate = ips.bootstrap.RotateMolecules(\n",
397395
" data=geopt.atoms,\n",
398396
" data_id=-1,\n",
399397
" n_configurations=n_configs,\n",
400398
" maximum=15, # deg max rotation\n",
401-
" include_original=False\n",
399+
" include_original=False,\n",
402400
" )\n",
403401
" translate = ips.bootstrap.TranslateMolecules(\n",
404402
" data=geopt.atoms,\n",
405403
" data_id=-1,\n",
406404
" n_configurations=n_configs,\n",
407-
" maximum=0.3, # Ang max molecular displacement\n",
408-
" include_original=False\n",
405+
" maximum=0.3, # Ang max molecular displacement\n",
406+
" include_original=False,\n",
409407
" )\n",
410408
"\n",
411409
" bootstrap_configurations = rattle.atoms + rotate.atoms + translate.atoms\n",
412410
"\n",
413-
" labeling_calc = ips.xTBSinglePoint(data=bootstrap_configurations, method=\"gfn1-xtb\", name=\"label_calc\")\n",
411+
" labeling_calc = ips.xTBSinglePoint(\n",
412+
" data=bootstrap_configurations, method=\"gfn1-xtb\", name=\"label_calc\"\n",
413+
" )\n",
414414
" volume_scan = ips.BoxScale(\n",
415415
" data=rattle.atoms,\n",
416416
" data_id=0,\n",
@@ -473,7 +473,7 @@
473473
"plt.xlabel(energy_hist.xlabel)\n",
474474
"plt.ylabel(energy_hist.ylabel)\n",
475475
"plt.yscale(\"log\")\n",
476-
"plt.show()\n"
476+
"plt.show()"
477477
]
478478
},
479479
{

0 commit comments

Comments
 (0)