Skip to content

Commit

Permalink
Correct generated doc
Browse files Browse the repository at this point in the history
  • Loading branch information
mjwen committed Apr 28, 2022
1 parent 4211123 commit 17c4661
Show file tree
Hide file tree
Showing 17 changed files with 357 additions and 27 deletions.
8 changes: 8 additions & 0 deletions devtool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
- remove `.git/hooks/pre-commit` so that it will not correct the generated
doc files, otherwise ReadTheDoc will try to regenerate it and then fail
- after commit it, then `$ pre-commit install` to get pre-commit back
- Note, check the generated tutorial notebooks -- sometimes sphinx-galley will
not correctly capture the stdout and embed it in the file. In this case,
delete hte .md5 file and return `make html`. (Also, do it one be one.)
For example,
```shell
$ rm source/auto_examples/example_kim_SW_Si.py.md5
$ make html
```

- Commit and merge it to the `docs` branch. [ReadTheDocs](https://readthedocs.org)
is set up to watch this branch and will automatically generate the docs.)
Expand Down
Binary file modified docs/source/auto_examples/auto_examples_jupyter.zip
Binary file not shown.
Binary file modified docs/source/auto_examples/auto_examples_python.zip
Binary file not shown.
110 changes: 109 additions & 1 deletion docs/source/auto_examples/example_kim_SW_Si.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,49 @@ parameters that can be optimized (we call this ``model parameters``).

.. code-block:: none
#================================================================================
# Available parameters to optimize.
# Parameters in `original` space.
# Model: SW_StillingerWeber_1985_Si__MO_405512056662_006
#================================================================================
name: A
value: [15.28484792]
size: 1
name: B
value: [0.60222456]
size: 1
name: p
value: [4.]
size: 1
name: q
value: [0.]
size: 1
name: sigma
value: [2.0951]
size: 1
name: gamma
value: [2.51412]
size: 1
name: cutoff
value: [3.77118]
size: 1
name: lambda
value: [45.5322]
size: 1
name: costheta0
value: [-0.33333333]
size: 1
'#================================================================================\n# Available parameters to optimize.\n# Parameters in `original` space.\n# Model: SW_StillingerWeber_1985_Si__MO_405512056662_006\n#================================================================================\n\nname: A\nvalue: [15.28484792]\nsize: 1\n\nname: B\nvalue: [0.60222456]\nsize: 1\n\nname: p\nvalue: [4.]\nsize: 1\n\nname: q\nvalue: [0.]\nsize: 1\n\nname: sigma\nvalue: [2.0951]\nsize: 1\n\nname: gamma\nvalue: [2.51412]\nsize: 1\n\nname: cutoff\nvalue: [3.77118]\nsize: 1\n\nname: lambda\nvalue: [45.5322]\nsize: 1\n\nname: costheta0\nvalue: [-0.33333333]\nsize: 1\n\n'
Expand Down Expand Up @@ -142,6 +185,25 @@ subset of them to reproduce the training set.

.. code-block:: none
#================================================================================
# Model parameters that are optimized.
# Note that the parameters are in the transformed space if
# `params_transform` is provided when instantiating the model.
#================================================================================
A 1
5.0000000000000000e+00 1.0000000000000000e+00 2.0000000000000000e+01
B 1
6.0222455840000000e-01
sigma 1
2.0951000000000000e+00 fix
gamma 1
1.5000000000000000e+00
'#================================================================================\n# Model parameters that are optimized.\n# Note that the parameters are in the transformed space if \n# `params_transform` is provided when instantiating the model.\n#================================================================================\n\nA 1\n 5.0000000000000000e+00 1.0000000000000000e+00 2.0000000000000000e+01 \n\nB 1\n 6.0222455840000000e-01 \n\nsigma 1\n 2.0951000000000000e+00 fix \n\ngamma 1\n 1.5000000000000000e+00 \n\n'
Expand Down Expand Up @@ -201,6 +263,14 @@ For the silicon training set, we can read and process the files by:
.. rst-class:: sphx-glr-script-out

Out:

.. code-block:: none
2022-04-28 11:03:34.898 | INFO | kliff.dataset.dataset:_read:397 - 1000 configurations read from /Users/mjwen/Applications/kliff/examples/Si_training_set
Expand Down Expand Up @@ -236,6 +306,14 @@ by:
.. rst-class:: sphx-glr-script-out

Out:

.. code-block:: none
2022-04-28 11:03:38.460 | INFO | kliff.calculators.calculator:create:107 - Create calculator for 1000 configurations.
Expand Down Expand Up @@ -277,6 +355,9 @@ the loss, and the minimization is allowed to run for a max number of 100 iterati

.. code-block:: none
2022-04-28 11:03:38.462 | INFO | kliff.loss:minimize:290 - Start minimization using method: L-BFGS-B.
2022-04-28 11:03:38.462 | INFO | kliff.loss:_scipy_optimize:406 - Running in multiprocessing mode with 2 processes.
2022-04-28 11:05:36.267 | INFO | kliff.loss:minimize:292 - Finish minimization using method: L-BFGS-B.
fun: 0.6940780132834561
hess_inv: <3x3 LbfgsInvHessProduct with dtype=float64>
Expand Down Expand Up @@ -313,6 +394,33 @@ that can be used with LAMMPS_, GULP_, ASE_, etc. via the kim-api_.
.. rst-class:: sphx-glr-script-out

Out:

.. code-block:: none
#================================================================================
# Model parameters that are optimized.
# Note that the parameters are in the transformed space if
# `params_transform` is provided when instantiating the model.
#================================================================================
A 1
1.4938636641779590e+01 1.0000000000000000e+00 2.0000000000000000e+01
B 1
5.8740288227791959e-01
sigma 1
2.0951000000000000e+00 fix
gamma 1
2.2014624192566941e+00
2022-04-28 11:05:36.291 | INFO | kliff.models.kim:write_kim_model:695 - KLIFF trained model write to `/Users/mjwen/Applications/kliff/examples/SW_StillingerWeber_1985_Si__MO_405512056662_006_kliff_trained`
Expand Down Expand Up @@ -340,7 +448,7 @@ parameters quite reasonably. The second line saves the fitted model to a file na

.. rst-class:: sphx-glr-timing

**Total running time of the script:** ( 2 minutes 5.502 seconds)
**Total running time of the script:** ( 2 minutes 4.046 seconds)


.. _sphx_glr_download_auto_examples_example_kim_SW_Si.py:
Expand Down
Binary file modified docs/source/auto_examples/example_kim_SW_Si_codeobj.pickle
Binary file not shown.
63 changes: 62 additions & 1 deletion docs/source/auto_examples/example_lennard_jones.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,69 @@ Compare this with :ref:`tut_kim_sw`.
.. rst-class:: sphx-glr-script-out

Out:

.. code-block:: none
2022-04-28 11:07:49.718 | INFO | kliff.dataset.dataset:_read:397 - 4 configurations read from /Users/mjwen/Applications/kliff/examples/Si_training_set_4_configs
#================================================================================
# Available parameters to optimize.
# Parameters in `original` space.
# Model: LJ6-12
#================================================================================
name: epsilon
value: [1.]
size: 1
name: sigma
value: [2.]
size: 1
name: cutoff
value: [5.]
size: 1
#================================================================================
# Model parameters that are optimized.
# Note that the parameters are in the transformed space if
# `params_transform` is provided when instantiating the model.
#================================================================================
sigma 1
2.0000000000000000e+00
epsilon 1
1.0000000000000000e+00
2022-04-28 11:07:49.726 | INFO | kliff.calculators.calculator:create:107 - Create calculator for 4 configurations.
2022-04-28 11:07:49.726 | INFO | kliff.loss:minimize:290 - Start minimization using method: L-BFGS-B.
2022-04-28 11:07:49.727 | INFO | kliff.loss:_scipy_optimize:404 - Running in serial mode.
2022-04-28 11:07:53.172 | INFO | kliff.loss:minimize:292 - Finish minimization using method: L-BFGS-B.
#================================================================================
# Model parameters that are optimized.
# Note that the parameters are in the transformed space if
# `params_transform` is provided when instantiating the model.
#================================================================================
sigma 1
2.0629043239028659e+00
epsilon 1
1.5614870430532530e+00
|
.. code-block:: default
Expand Down Expand Up @@ -75,7 +136,7 @@ Compare this with :ref:`tut_kim_sw`.
.. rst-class:: sphx-glr-timing

**Total running time of the script:** ( 0 minutes 6.187 seconds)
**Total running time of the script:** ( 0 minutes 5.538 seconds)


.. _sphx_glr_download_auto_examples_example_lennard_jones.py:
Expand Down
Binary file modified docs/source/auto_examples/example_lennard_jones_codeobj.pickle
Binary file not shown.
26 changes: 13 additions & 13 deletions docs/source/auto_examples/example_linear_regression.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,17 @@ symmetry functions.

.. code-block:: none
2022-04-28 10:33:14.541 | INFO | kliff.dataset.dataset:_read:397 - 400 configurations read from /Users/mjwen/Applications/kliff/examples/Si_training_set/varying_alat
2022-04-28 10:33:14.541 | INFO | kliff.calculators.calculator_torch:_get_device:417 - Training on cpu
2022-04-28 10:33:14.542 | INFO | kliff.descriptors.descriptor:generate_fingerprints:104 - Start computing mean and stdev of fingerprints.
2022-04-28 10:33:37.085 | INFO | kliff.descriptors.descriptor:generate_fingerprints:121 - Finish computing mean and stdev of fingerprints.
2022-04-28 10:33:37.092 | INFO | kliff.descriptors.descriptor:generate_fingerprints:129 - Fingerprints mean and stdev saved to `fingerprints_mean_and_stdev.pkl`.
2022-04-28 10:33:37.092 | INFO | kliff.descriptors.descriptor:_dump_fingerprints:164 - Pickling fingerprints to `fingerprints.pkl`
2022-04-28 10:33:37.095 | INFO | kliff.descriptors.descriptor:_dump_fingerprints:176 - Processing configuration: 0.
2022-04-28 10:33:37.424 | INFO | kliff.descriptors.descriptor:_dump_fingerprints:176 - Processing configuration: 100.
2022-04-28 10:33:38.046 | INFO | kliff.descriptors.descriptor:_dump_fingerprints:176 - Processing configuration: 200.
2022-04-28 10:33:38.510 | INFO | kliff.descriptors.descriptor:_dump_fingerprints:176 - Processing configuration: 300.
2022-04-28 10:33:38.884 | INFO | kliff.descriptors.descriptor:_dump_fingerprints:219 - Pickle 400 configurations finished.
2022-04-28 10:49:35.846 | INFO | kliff.dataset.dataset:_read:397 - 400 configurations read from /Users/mjwen/Applications/kliff/examples/Si_training_set/varying_alat
2022-04-28 10:49:35.848 | INFO | kliff.calculators.calculator_torch:_get_device:417 - Training on cpu
2022-04-28 10:49:35.849 | INFO | kliff.descriptors.descriptor:generate_fingerprints:104 - Start computing mean and stdev of fingerprints.
2022-04-28 10:49:56.708 | INFO | kliff.descriptors.descriptor:generate_fingerprints:121 - Finish computing mean and stdev of fingerprints.
2022-04-28 10:49:56.712 | INFO | kliff.descriptors.descriptor:generate_fingerprints:129 - Fingerprints mean and stdev saved to `fingerprints_mean_and_stdev.pkl`.
2022-04-28 10:49:56.712 | INFO | kliff.descriptors.descriptor:_dump_fingerprints:164 - Pickling fingerprints to `fingerprints.pkl`
2022-04-28 10:49:56.734 | INFO | kliff.descriptors.descriptor:_dump_fingerprints:176 - Processing configuration: 0.
2022-04-28 10:49:57.294 | INFO | kliff.descriptors.descriptor:_dump_fingerprints:176 - Processing configuration: 100.
2022-04-28 10:49:57.906 | INFO | kliff.descriptors.descriptor:_dump_fingerprints:176 - Processing configuration: 200.
2022-04-28 10:49:58.640 | INFO | kliff.descriptors.descriptor:_dump_fingerprints:176 - Processing configuration: 300.
2022-04-28 10:49:59.157 | INFO | kliff.descriptors.descriptor:_dump_fingerprints:219 - Pickle 400 configurations finished.
Expand Down Expand Up @@ -109,7 +109,7 @@ function of its calculator.

.. code-block:: none
2022-04-28 10:33:39.460 | INFO | kliff.models.linear_regression:fit:39 - fit model "LinearRegression" finished.
2022-04-28 10:49:59.693 | INFO | kliff.models.linear_regression:fit:39 - fit model "LinearRegression" finished.
fit model "LinearRegression" finished.
Expand All @@ -118,7 +118,7 @@ function of its calculator.
.. rst-class:: sphx-glr-timing

**Total running time of the script:** ( 0 minutes 26.918 seconds)
**Total running time of the script:** ( 0 minutes 25.892 seconds)


.. _sphx_glr_download_auto_examples_example_linear_regression.py:
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/source/auto_examples/example_nn_Si.rst
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ codes such as LAMMPS via the KIM API.

.. rst-class:: sphx-glr-timing

**Total running time of the script:** ( 0 minutes 47.669 seconds)
**Total running time of the script:** ( 0 minutes 45.015 seconds)


.. _sphx_glr_download_auto_examples_example_nn_Si.py:
Expand Down
2 changes: 1 addition & 1 deletion docs/source/auto_examples/example_nn_SiC.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ We can save the trained model to disk, and later can load it back if we want.
.. rst-class:: sphx-glr-timing

**Total running time of the script:** ( 0 minutes 2.116 seconds)
**Total running time of the script:** ( 0 minutes 1.955 seconds)


.. _sphx_glr_download_auto_examples_example_nn_SiC.py:
Expand Down
Binary file modified docs/source/auto_examples/example_nn_SiC_codeobj.pickle
Binary file not shown.
Binary file modified docs/source/auto_examples/example_nn_Si_codeobj.pickle
Binary file not shown.
Loading

0 comments on commit 17c4661

Please sign in to comment.