Skip to content

Commit dfbb567

Browse files
committed
deploy: 9bb79e7
0 parents  commit dfbb567

81 files changed

Lines changed: 8241 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.buildinfo

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Sphinx build info version 1
2+
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
3+
config: 3123ef6225f14b74f3288a3e30285e4d
4+
tags: 645f666f9bcd5a90fca523b33c5a78b7

.nojekyll

Whitespace-only changes.
38.2 KB
Binary file not shown.

_sources/getting-started.rst.txt

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
:tocdepth: -1
2+
3+
.. index:: getting-started
4+
5+
.. _getting-started:
6+
7+
================
8+
Getting started
9+
================
10+
11+
``diffpy.apps`` provides user applications to help with tasks using
12+
diffpy packages. This page contains the instructions for all applications
13+
available, including:
14+
15+
- :ref:`runmacro`
16+
- :ref:`agentify`
17+
18+
.. _runmacro:
19+
20+
Use ``runmacro`` to start refinement with a macro file
21+
------------------------------------------------------
22+
23+
The ``runmacro`` application allows users to execute macros written in the
24+
diffpy macro language.
25+
26+
.. code-block:: bash
27+
28+
diffpy.app runmacro <macro_file.dp-in>
29+
30+
To follow the example,
31+
32+
1. download the example files from :download:`here <../example/runmacro_example.zip>`
33+
34+
2. extract the downloaded files and navigate to the extracted directory
35+
36+
.. code-block:: bash
37+
38+
mv /path/to/runmacro runmacro_example.zip working_directory
39+
cd working_directory
40+
unzip runmacro_example.zip
41+
42+
3. run the macro using the ``runmacro`` application
43+
44+
.. code-block:: bash
45+
46+
diffpy.app runmacro example_macro.dp-in
47+
48+
How to write macro
49+
~~~~~~~~~~~~~~~~~~
50+
51+
Let's still use the Ni example created earlier, but this time we will
52+
write the macro file from scratch.
53+
54+
1. Prepare the structure and profile file you want to work with.
55+
56+
.. note::
57+
58+
The structure file is a ``.cif`` file representing the atomic arrangement in
59+
your sample, and the profile file is a ``.gr`` file containing the
60+
experimental data.
61+
62+
Start the macro file with the following two lines:
63+
64+
.. code-block:: text
65+
66+
load structure G1 from "path/to/structure.cif"
67+
load profile exp_ni from "path/to/profile.gr"
68+
69+
``G1`` and ``exp_ni`` are the identifiers used in the macro to refer to the
70+
structure and profile files, respectively. Quotes ``""`` are must to specify
71+
the file paths.
72+
73+
2. (Optional) Declare the space group of the structure.
74+
75+
.. code-block:: text
76+
77+
set G1 spacegroup as Fm-3m
78+
79+
``G1`` is the identifier for the structure file loaded earlier. Space group
80+
symmetry ``Fm-3m`` is preserved during the refinement. You can also set
81+
it to be ``auto`` to use the one automatically parsed from the structure file.
82+
But if space group is not provided, nor can it be determined from the structure
83+
file, it will be considered as ``P1`` space group.
84+
85+
3. (Optional) Set the calculation parameters for the refinement.
86+
87+
.. code-block:: text
88+
89+
set exp_ni calculation_range as 0.5 20.0 0.01 # r_min, r_max, r_step
90+
set exp_ni q_range as 0.5 20.0 # q_min, q_max
91+
92+
``exp_ni`` is the identifier for the profile file loaded earlier.
93+
``calculation_range`` specifies the range and step size for the calculation,
94+
while ``q_range`` specifies the range of Q values to be used in the refinement.
95+
If calculation parameters are not set, it will use the ones
96+
that are defined in the profile file.
97+
98+
99+
4. Create the refinement equation.
100+
101+
.. code-block:: text
102+
103+
create equation variables s0
104+
set equation as "G1*s0"
105+
106+
``G1`` is the identifier for the structure file loaded earlier. In the
107+
equation, it represents the PDF data generated from the structure `G1`.
108+
``s0`` is created to count for the scaling factor.
109+
110+
5. Store the results.
111+
112+
.. code-block:: text
113+
114+
save to "output_results.json"
115+
116+
The results of the refinement will be saved to a file
117+
named ``output_results.json``.
118+
119+
6. List variables to be refined.
120+
121+
.. code-block:: text
122+
123+
variables:
124+
---
125+
- G1.a: 3.52
126+
- s0: 0.4
127+
- G1.Uiso_0: 0.005
128+
- G1.delta2: 2
129+
- qdamp: 0.04
130+
- qbroad: 0.02
131+
---
132+
133+
Only variables listed in this section will be refined during the
134+
execution of the macro, and the variables will also be refined in that order.
135+
Variables with initial values specified here will be used as the
136+
starting point for the refinement.
137+
138+
.. note::
139+
The naming of variables follows the format
140+
``structure_identifier.parameter``,
141+
``profile_parameter``, or
142+
``equation_parameter``.
143+
144+
For parameters belonging to a specific atom in the parameter,
145+
the naming follows the format ``structure_identifier.parameter_atomindex``.
146+
e.g. ``G1.Uiso_0`` here refers to the Uiso parameter of the first atom in
147+
the structure ``G1``.
148+
149+
For constrained parameters, it will use the first parameter in the
150+
constraint. e.g. Here, lattice parameter ``a=b=c``,
151+
and ``Usio_0=Uiso_i, i=1,2,3``, ``a`` and ``Uiso_0`` are used as the
152+
reference variables.
153+
154+
.. _agentify:
155+
Use ``agentify`` to deploy agent skills ``diffpy.cmi``
156+
------------------------------------------------------
157+
158+
The ``agentify`` application allows users to deploy agentic skills in the
159+
local environment. To use this application, run:
160+
161+
.. code-block:: bash
162+
163+
diffpy.app agentify
164+
165+
``claude`` and ``codex`` agent skills are supported, and ``claude`` is used
166+
by default. To specify the agent skill, use the ``--agent`` option:
167+
168+
.. code-block:: bash
169+
170+
diffpy.app agentify --agent codex
171+
172+
To deploy the agentic skill to the system directory, use the ``--system`` flag:
173+
174+
.. code-block:: bash
175+
176+
diffpy.app agentify --system
177+
178+
To update the existing ``diffpy.cmi`` agentic skill, use the ``--update`` flag:
179+
180+
.. code-block:: bash
181+
182+
diffpy.app agentify --update

_sources/index.rst.txt

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#######
2+
|title|
3+
#######
4+
5+
.. |title| replace:: diffpy.apps documentation
6+
7+
``diffpy.apps`` - User applications to help with tasks using diffpy packages
8+
9+
| Software version |release|
10+
| Last updated |today|.
11+
12+
===============
13+
Getting started
14+
===============
15+
16+
Welcome to the ``diffpy.apps`` documentation!
17+
18+
To get started, please visit the :ref:`Getting started <getting-started>` page.
19+
20+
=======
21+
Authors
22+
=======
23+
24+
``diffpy.apps`` is developed by Yuchen Xiao, Simon Billinge and members of the Billinge group. This project is maintained by Yuchen Xiao and Simon Billinge. For a detailed list of contributors see
25+
https://github.com/diffpy/diffpy.apps/graphs/contributors.
26+
27+
============
28+
Installation
29+
============
30+
31+
See the `README <https://github.com/diffpy/diffpy.apps#installation>`_
32+
file included with the distribution.
33+
34+
================
35+
Acknowledgements
36+
================
37+
38+
``diffpy.apps`` is built and maintained with `scikit-package <https://scikit-package.github.io/scikit-package/>`_.
39+
40+
=================
41+
Table of contents
42+
=================
43+
.. toctree::
44+
:maxdepth: 2
45+
46+
getting-started
47+
release
48+
license
49+
50+
=======
51+
Indices
52+
=======
53+
54+
* :ref:`genindex`
55+
* :ref:`search`

_sources/license.rst.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
:tocdepth: -1
2+
3+
.. index:: license
4+
5+
License
6+
#######
7+
8+
OPEN SOURCE LICENSE AGREEMENT
9+
=============================
10+
BSD 3-Clause License
11+
12+
Copyright (c) 2026, diffpy.apps contributors.
13+
All Rights Reserved.
14+
15+
Redistribution and use in source and binary forms, with or without
16+
modification, are permitted provided that the following conditions are met:
17+
18+
1. Redistributions of source code must retain the above copyright notice, this
19+
list of conditions and the following disclaimer.
20+
21+
2. Redistributions in binary form must reproduce the above copyright notice,
22+
this list of conditions and the following disclaimer in the documentation
23+
and/or other materials provided with the distribution.
24+
25+
3. Neither the name of the copyright holder nor the names of its
26+
contributors may be used to endorse or promote products derived from
27+
this software without specific prior written permission.
28+
29+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
30+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
32+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
33+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
35+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
36+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
37+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

_sources/release.rst.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
:tocdepth: -1
2+
3+
.. index:: release notes
4+
5+
.. include:: ../../CHANGELOG.rst

0 commit comments

Comments
 (0)