Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
qzhu2017 committed Aug 17, 2024
1 parent 2672a75 commit 084a827
Show file tree
Hide file tree
Showing 51 changed files with 331 additions and 96 deletions.
38 changes: 28 additions & 10 deletions doc/Usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -378,24 +378,42 @@ with a list of numbers. For example,
.. code-block:: Python
>>> my_crystal = pyxtal()
>>> my_crystal.from_random(3, 99, ['Ba','Ti','O'], [1,1,3])
>>> my_crystal.from_random(3, 99, ['Ba','Ti','O'], [1,1,3], random_state=10)
>>> my_crystal
------Random Crystal------
Composition: Ba1 Ti1 O3
------Crystal from random------
Dimension: 3
Group: P4mm (99)
Volume factor: 1.0
tetragonal lattice: 5.1029 5.1029 4.3018 90.0000 90.0000 90.0000
Composition: Ba1Ti1O3
Group: P 4 m m (99)
4.0080, 4.0080, 9.3650, 90.0000, 90.0000, 90.0000, tetragonal
Wyckoff sites:
Ba @ [0.5000 0.5000 0.3612], Wyckoff letter: 1b, Site symmetry: 4 m m
Ti @ [0.5000 0.5000 0.8701], Wyckoff letter: 1b, Site symmetry: 4 m m
O @ [0.5000 0.0000 0.0823], Wyckoff letter: 2c, Site symmetry: 2 mm .
O @ [0.5000 0.5000 0.8177], Wyckoff letter: 1b, Site symmetry: 4 m m
Ba @ [ 0.5000 0.5000 0.7043], WP [1b] Site [4mm]
Ti @ [ 0.0000 0.0000 0.2199], WP [1a] Site [4mm]
O @ [ 0.5000 0.0000 0.3652], WP [2c] Site [2mm.]
O @ [ 0.0000 0.0000 0.6833], WP [1a] Site [4mm]
would create a random :math:`BaTiO_3` crystal. If the generation is successful, the value
of ``my_crystal.valid`` will be set to ``True``;
otherwise, it will be ``False``.

Keep in mind that the you can pass an integer value to `random_state` to ensure the reproducibility.
This feature would be useful for many different purposes.

If you want to generate many random structures with a fixed random number generator, we recommend the following scripts by setting up a random number generator via `np.random.default_rng`:

.. code-block:: Python
from pyxtal import pyxtal
import numpy as np
rng = np.random.default_rng(0)

xtals = []
for i in range(10):
xtal = pyxtal()
xtal.from_random(3, 99, ['Ba','Ti','O'], [1,1,3], random_state=rng)
xtals.append(xtal)

Similar setup can be applied to other modules as well.

Random 3D molecular crystals
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
7 changes: 7 additions & 0 deletions doc/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pyxtal
======

.. toctree::
:maxdepth: 4

pyxtal
6 changes: 3 additions & 3 deletions doc/pyxtal.XRD.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ pyxtal.XRD module
=================

.. automodule:: pyxtal.XRD
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
6 changes: 3 additions & 3 deletions doc/pyxtal.block_crystal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ pyxtal.block\_crystal module
============================

.. automodule:: pyxtal.block_crystal
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions doc/pyxtal.constants.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pyxtal.constants module
=======================

.. automodule:: pyxtal.constants
:members:
:undoc-members:
:show-inheritance:
6 changes: 3 additions & 3 deletions doc/pyxtal.crystal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ pyxtal.crystal module
=====================

.. automodule:: pyxtal.crystal
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions doc/pyxtal.database.cifs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pyxtal.database.cifs package
============================

.. automodule:: pyxtal.database.cifs
:members:
:undoc-members:
:show-inheritance:
6 changes: 3 additions & 3 deletions doc/pyxtal.database.collection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ pyxtal.database.collection module
=================================

.. automodule:: pyxtal.database.collection
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
6 changes: 3 additions & 3 deletions doc/pyxtal.database.element.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ pyxtal.database.element module
==============================

.. automodule:: pyxtal.database.element
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
15 changes: 12 additions & 3 deletions doc/pyxtal.database.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,23 @@ pyxtal.database package
=======================

.. automodule:: pyxtal.database
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:

Subpackages
-----------

.. toctree::
:maxdepth: 4

pyxtal.database.cifs

Submodules
----------

.. toctree::
:maxdepth: 4

pyxtal.database.collection
pyxtal.database.element
7 changes: 7 additions & 0 deletions doc/pyxtal.db.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pyxtal.db module
================

.. automodule:: pyxtal.db
:members:
:undoc-members:
:show-inheritance:
6 changes: 3 additions & 3 deletions doc/pyxtal.descriptor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ pyxtal.descriptor module
========================

.. automodule:: pyxtal.descriptor
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions doc/pyxtal.elasticity.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pyxtal.elasticity module
========================

.. automodule:: pyxtal.elasticity
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions doc/pyxtal.interface.LJ.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pyxtal.interface.LJ module
==========================

.. automodule:: pyxtal.interface.LJ
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions doc/pyxtal.interface.ani.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pyxtal.interface.ani module
===========================

.. automodule:: pyxtal.interface.ani
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions doc/pyxtal.interface.charmm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pyxtal.interface.charmm module
==============================

.. automodule:: pyxtal.interface.charmm
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions doc/pyxtal.interface.dftb.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pyxtal.interface.dftb module
============================

.. automodule:: pyxtal.interface.dftb
:members:
:undoc-members:
:show-inheritance:
6 changes: 3 additions & 3 deletions doc/pyxtal.interface.gulp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ pyxtal.interface.gulp module
============================

.. automodule:: pyxtal.interface.gulp
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
6 changes: 3 additions & 3 deletions doc/pyxtal.interface.lammpslib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ pyxtal.interface.lammpslib module
=================================

.. automodule:: pyxtal.interface.lammpslib
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
15 changes: 11 additions & 4 deletions doc/pyxtal.interface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@ pyxtal.interface package
========================

.. automodule:: pyxtal.interface
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:

Submodules
----------

.. toctree::
:maxdepth: 4

pyxtal.interface.vasp
pyxtal.interface.LJ
pyxtal.interface.ani
pyxtal.interface.charmm
pyxtal.interface.dftb
pyxtal.interface.gulp
pyxtal.interface.lammpslib
pyxtal.interface.vasp
pyxtal.interface.vasprun
6 changes: 3 additions & 3 deletions doc/pyxtal.interface.vasp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ pyxtal.interface.vasp module
============================

.. automodule:: pyxtal.interface.vasp
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions doc/pyxtal.interface.vasprun.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pyxtal.interface.vasprun module
===============================

.. automodule:: pyxtal.interface.vasprun
:members:
:undoc-members:
:show-inheritance:
6 changes: 3 additions & 3 deletions doc/pyxtal.io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ pyxtal.io module
================

.. automodule:: pyxtal.io
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
8 changes: 4 additions & 4 deletions doc/pyxtal.lattice.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pyxtal.lattice module
======================
=====================

.. automodule:: pyxtal.lattice
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
6 changes: 3 additions & 3 deletions doc/pyxtal.molecular_crystal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ pyxtal.molecular\_crystal module
================================

.. automodule:: pyxtal.molecular_crystal
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
6 changes: 3 additions & 3 deletions doc/pyxtal.molecule.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ pyxtal.molecule module
======================

.. automodule:: pyxtal.molecule
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions doc/pyxtal.msg.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pyxtal.msg module
=================

.. automodule:: pyxtal.msg
:members:
:undoc-members:
:show-inheritance:
6 changes: 3 additions & 3 deletions doc/pyxtal.operations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ pyxtal.operations module
========================

.. automodule:: pyxtal.operations
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions doc/pyxtal.optimize.DFS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pyxtal.optimize.DFS module
==========================

.. automodule:: pyxtal.optimize.DFS
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions doc/pyxtal.optimize.QRS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pyxtal.optimize.QRS module
==========================

.. automodule:: pyxtal.optimize.QRS
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions doc/pyxtal.optimize.WFS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pyxtal.optimize.WFS module
==========================

.. automodule:: pyxtal.optimize.WFS
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions doc/pyxtal.optimize.base.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pyxtal.optimize.base module
===========================

.. automodule:: pyxtal.optimize.base
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions doc/pyxtal.optimize.basin_hopping.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pyxtal.optimize.basin\_hopping module
=====================================

.. automodule:: pyxtal.optimize.basin_hopping
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions doc/pyxtal.optimize.benchmark.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pyxtal.optimize.benchmark module
================================

.. automodule:: pyxtal.optimize.benchmark
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions doc/pyxtal.optimize.common.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pyxtal.optimize.common module
=============================

.. automodule:: pyxtal.optimize.common
:members:
:undoc-members:
:show-inheritance:
Loading

0 comments on commit 084a827

Please sign in to comment.