Skip to content

Commit 137942e

Browse files
authored
Merge pull request #34 from connorjbracy/cbracy_update_site
Updating existing site detail
2 parents b9d9085 + 645335f commit 137942e

Some content is hidden

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

55 files changed

+21231
-6
lines changed

Diff for: Makefile

+43-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ SPHINXBUILD = sphinx-build
77
PAPER =
88
BUILDDIR = _build
99

10+
CURRENT_DOC_DIR = ./static_root/doc
11+
TEMP_TEST_DOC_DIR = ./doc
12+
1013
# User-friendly check for sphinx-build
1114
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
1215
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
@@ -166,7 +169,46 @@ changes:
166169
@echo "The overview file is in $(BUILDDIR)/changes."
167170

168171
linkcheck:
169-
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
172+
# For some reason, the doc directory for our sources is set to
173+
# ./static_root/doc but Sphinx expects it to be at ./doc and this has yet to
174+
# be addressed. The effect of this discontinuity is that when Sphinx is
175+
# running, it looks in the incorrect location with relative paths for static
176+
# files we are serving up. This ultimately is not an issue for the
177+
# functionality of the website as the links are indeed consistent in the
178+
# static files generated, but it causes tests such as `linkcheck` to fail.
179+
# For this reason, this make command has been modified to accoun for this
180+
# discontinuity to preserve the validity of the test, but this change may
181+
# have impact on future modifications to the website's internal structure
182+
# and/or a fix for this issue, hence the in-line documentation of the problem
183+
# (which gets printed to the console upon `linkcheck`'s failure).
184+
#
185+
# Here's what the make command was prior to this modification (and likely
186+
# should be converted back to after addressing the issue):
187+
#
188+
# $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
189+
# @echo
190+
# @echo "Link check complete; look for any errors in the above output " \
191+
# "or in $(BUILDDIR)/linkcheck/output.txt."
192+
#
193+
# Here's an overview of the logic for circumventing the issue:
194+
#
195+
# (1) Attempt to create the symlink to the actual doc directory in the
196+
# location that Sphinx expects it to be.
197+
# => Success
198+
# (a) Run linkcheck as we've properly configured our local structure
199+
# to be what Sphinx expects.
200+
# (b) Delete the symlink hack/patch, regardless of `linkcheck`'s
201+
# success as we know we create ./doc as a symlink in (1) (as
202+
# opposed to it being a directory containing its own data
203+
# possibly created at a later time without knowledge of this
204+
# fix).
205+
# => Failure
206+
# (a) Do no proceed and let this message be printed for future
207+
# debugging/maintainance effors.
208+
test -h $(TEMP_TEST_DOC_DIR) \
209+
|| ln -sT $(CURRENT_DOC_DIR) $(TEMP_TEST_DOC_DIR) \
210+
&& $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck \
211+
; rm $(TEMP_TEST_DOC_DIR)
170212
@echo
171213
@echo "Link check complete; look for any errors in the above output " \
172214
"or in $(BUILDDIR)/linkcheck/output.txt."

Diff for: README.md

+153-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,160 @@
11
diffpy.github.io
22
================
33

4-
Sphinx sources for the diffpy.org web page. This repository contains 3 branches:
4+
Sphinx sources for the [diffpy.org][site] web page.
55

6-
1. `source` sphinx sources for the web page
7-
2. `master` sources compiled to HTML format that are published via GitHub pages
8-
3. `archive` converted subversion repository for the old diffpy.org sources
6+
### Quick Jump:
7+
8+
- [GitHub Structure](#github-structure)
9+
- [Where to Make Changes](#where-to-make-changes)
10+
- [Adding Citations](#adding-citations)
11+
- [Adding Publications that Describe a DiffPy Project (the "Reference" Section)](#reference-section-1)
12+
- [Adding Other Publications (the "Publication Using DiffPy-CMI" Section)](#reference-section-2)
13+
- [Publishing New Version of Existing Project](#new-version)
14+
- [Publishing New Project](#publishing-new-project)
15+
- [Publishing Changes](#publishing-changes)
16+
- [Testing Changes](#testing-changes)
17+
- [Contributors (Submitting Changes)](#submitting-changes)
18+
- [Maintainers (Publishing Changes)](#publishing-changes)
19+
20+
21+
# GitHub Structure
22+
23+
This repository contains 3 branches:
24+
25+
1. [`source`][source] sphinx sources for the web page
26+
2. [`master`][master] sources compiled to HTML format that are published via GitHub pages
27+
3. [`archive`][archive] converted subversion repository for the old diffpy.org sources
928

1029
Please, see the [Wiki](https://github.com/diffpy/diffpy.github.io/wiki) for more
1130
information and tips about this project.
31+
32+
33+
# Where to Make Changes
34+
35+
## Adding Citations
36+
37+
<a name="reference-section-1"></a>
38+
### Adding Publications that Describe a DiffPy Project (the "Reference" Section)
39+
40+
When adding a new publication to the list of [references used within the website](https://www.diffpy.org/publications.html), add the citation text of the publication to the documentation *only once* as a named snippet in [abbreviations.txt](https://github.com/diffpy/diffpy.github.io/blob/source/abbreviations.txt#L286). For example:
41+
```
42+
.. |citeJuhasJac18| replace::
43+
P. Juhás, J. N. Louwen, L. van Eijck, E. T. C. Vogt, S. J. L. Billinge,
44+
`PDFgetN3: atomic pair distribution functions from
45+
neutron powder diffraction data using ad hoc corrections
46+
<https://doi.org/10.1107/S1600576718010002>`__,
47+
*J. Appl. Crystallogr.*, **51**, 1492--1497 (2018)
48+
|downloadJuhasJac18|
49+
```
50+
Here, `|citeJuhasJac18|` is the name that can be used elsewhere in the documentation and the Sphinx documentation generator will replace all instances of this tag with the indented text following the `replace::` directive.
51+
52+
**Important:** After defining the publication's tag as described above, make sure to add the publication to the list of publications maintained in [publications.rst](https://github.com/diffpy/diffpy.github.io/blob/source/publications.rst). Make sure that you add the reference to the proper section and do so in descending reverse chronological order (i.e., the newest citations should appear at the top of their respective sections).
53+
54+
<a name="reference-section-note">*Note:*</a> In this example, the citation is for a publication which describes a product of the DiffPy-CMI project (namely, PDFgetN3). For publications which describe a component of DiffPy-CMI, we provide a link to download the publication directly from the [diffpy.org][site] website. Here, the link is provided via the `|downloadJuhasJac18|` tag which is the identifier for another snippet within [abbreviations.txt](https://github.com/diffpy/diffpy.github.io/blob/source/abbreviations.txt#L294) following the definition of `|citeJuhasJac18|`, seen here as:
55+
```
56+
.. |downloadJuhasJac18| image:: /images/pdficon_small.png
57+
:target: /doc/pdfgetx/Juhas-jac-2018.pdf
58+
```
59+
Furthermore, note that since the initial use of `|downloadJuhasJac18|` occurs within the indented text of the definition of `|citeJuhasJac18|`, the link to `|downloadJuhasJac18|` will appear everywhere `|citeJuhasJac18|` does.
60+
61+
Lastly, make sure that the linked publication has been included within this project's files, placed in an appropriate directory (typically, the parent directory of the project that the paper relates to). In the above example, the publication covers the PDFgetN3 feature of the `pdfgetx` package, thus it is placed within `pdfgetx`'s documentation directory and referenced accordingly with the line
62+
```
63+
:target: /doc/pdfgetx/Juhas-jac-2018.pdf
64+
```
65+
66+
67+
<a name="reference-section-2"></a>
68+
### Adding Other Publications (the "Publication Using DiffPy-CMI" Section)
69+
70+
Adding references to publications that do not describe the release/use of a product within the DiffPy-CMI project (e.g., papers which use some component of DiffPy-CMI), we simply provide the usual citation text (with appropriate DOI link). To add a citation of this type, refer to the information in [Reference Section](#reference-section-1), but disregard everything starting at, and following, the [Note](#reference-section-note).
71+
72+
73+
<a name="new-version"></a>
74+
# Publishing New Version of Existing Project
75+
76+
For releasing an updated version of a project, first follow the release procedure outlined in the [group wiki](https://gitlab.thebillingegroup.com/resources/group-wiki/-/wikis/Finalizing-a-Project's-(Re)-Release) for packaging and deploying your project.
77+
78+
In what follows, [pdfgetx v2.1.1](https://github.com/diffpy/diffpy.pdfgetx/releases/tag/v2.1.1) was chosen to show example commands for the steps outlined.
79+
80+
After following the steps necessary for releasing your project, grab the set of documentation that will be provided with the deliverable upon user's request (typically, this would be something like the files hosted by GitHub on the GitHub releases page). Create a new directory for the updated version's documentation to live in
81+
```
82+
$ mkdir diffpy.github.io/doc/pdfgetx/2.1.1
83+
```
84+
Copy the updated documentation to this directory
85+
```
86+
$ tar --directory=static_root/doc/pdfgetx/2.1.1/ \
87+
--strip-components=4 \
88+
-vxzf ~/Downloads/diffpy.pdfgetx-2.1.1.tar.gz \
89+
diffpy.pdfgetx-2.1.1/doc/manual/_build/PDFgetXNS3_manual.pdf
90+
91+
$ tar --directory=static_root/doc/pdfgetx/2.1.1/ \
92+
--strip-components=5 \
93+
--exclude=objects.inv \
94+
--exclude=.buildinfo \
95+
-vxzf ~/Downloads/diffpy.pdfgetx-2.1.1.tar.gz \
96+
diffpy.pdfgetx-2.1.1/doc/manual/_build/html/
97+
98+
$ cp ~/Downloads/pdfgetxn3-examples.zip static_root/doc/pdfgetx/2.1.1/
99+
```
100+
Make sure to include all relevant files (e.g., `PDFgetXNS3_manual.pdf` and `pdfgetxn3-examples.zip`), exclude any files we don't want to provide to the user (e.g., `objects.inv` and `.buildinfo` from `diffpy.pdfgetx-2.1.1.tar.gz`)
101+
102+
Finally, edit the [landing page of your project](https://github.com/diffpy/diffpy.github.io/blob/source/products/pdfgetx.rst) (in the [`source` branch][source]) to properly document and provide the updated version of your project. Once the preceding steps are complete, see the instructions of the [Publishing Changes](#submitting-changes) section for publishing these changes.
103+
104+
105+
# Publishing New Project
106+
107+
For adding a new project to the website, see one of the existing projects (e.g., [pdfgetx](https://www.diffpy.org/products/pdfgetx.html)) as reference.
108+
109+
In what follows in this section, you will be working within the [`source`][source] branch, unless otherwise specified.
110+
111+
You will need to create a directory for the project to live in within (e.g., [/static_root/doc/pdfgetx](https://github.com/diffpy/diffpy.github.io/tree/source/static_root/doc/pdfgetx)), then write a landing page for the project (e.g., [/products/pdfgetx.rst](https://github.com/diffpy/diffpy.github.io/blob/source/products/pdfgetx.rst)) which will provide any necessary information or files needed for a user to use the project. Once this is complete, see [Publishing New Version of Existing Project](#new-version) for steps on publishing the project.
112+
113+
114+
# Publishing Changes
115+
116+
In order to test and/or publish changes, activate a conda environment that has a working installation of Sphinx (or make sure you have the necessary packages installed at a system level). If unsure how to achieve this, see the [Install Sphinx](https://gitlab.thebillingegroup.com/resources/group-wiki/-/wikis/Finalizing-a-Project's-(Re)-Release#install-sphinx) section of the projecct release wiki.
117+
118+
## Testing Changes
119+
120+
Make sure you have an active installation of Sphinx as per [Publishing Changes](#publishing-changes), run the set of Sphinx validation command(s) to check that the static files that Sphinx will create to be served on the website are written properly:
121+
```
122+
$ make Makefile linkcheck SPHINXOPTS="-W"
123+
```
124+
*NOTE:* the `"-W"` flag forces warnings to be treated as errors. If you believe there is a falsely reported warning that should be ignored that is preventing the test from passing, rerun the above command with the `SPHINXOPTS="-W"` portion omitted.
125+
126+
Additionally, one can visually/user-experience validate that the changes are what is expected by running:
127+
```
128+
$ make Makefile html
129+
```
130+
Then opening `/_build/html/index.html` which will open a local instance of the website with the proposed changes in place.
131+
132+
<a name="submitting-changes"></a>
133+
## Contributors (Submitting Changes)
134+
135+
In order to update the contents of [diffpy.org][site], create a new branch off of [`source`][source] in your local fork of this repo and make whatever changes you need to. Once the desired edits are complete, follow the steps outlined in [Testing Changes](#testing-changes) to verify the site won't break as a result of these changes. Finally, after verifying that the changes won't break things, push your changes to your fork and open a pull-request to submit the changes back into this repo.
136+
137+
<a name="publishing-changes"></a>
138+
## Maintainers (Publishing Changes)
139+
140+
First, follow the steps outlines in [Testing Changes](#testing-changes) to verify that the changes won't mess things up (too bad). Note that these tests, as they currently exist, are not extensive and it's quite possible that something indeed may appear incorrectly on the website (hence the manual review portion). After reviewing the changes, have Sphinx generate the static files to be hosted on the website:
141+
```
142+
$ make Makefile html
143+
```
144+
145+
Prepare the changes to be published:
146+
```
147+
$ make Makefile publish-prepare
148+
```
149+
150+
Finally, publish the changes:
151+
```
152+
$ make Makefile publish-push
153+
```
154+
155+
156+
157+
[site]: <https://www.diffpy.org/> "diffpy.org"
158+
[source]: <https://github.com/diffpy/diffpy.github.io/tree/source> "source"
159+
[master]: <https://github.com/diffpy/diffpy.github.io/tree/master> "master"
160+
[archive]: <https://github.com/diffpy/diffpy.github.io/tree/archive> "archive"

Diff for: abbreviations.txt

+12
Original file line numberDiff line numberDiff line change
@@ -293,3 +293,15 @@
293293

294294
.. |downloadJuhasJac18| image:: /images/pdficon_small.png
295295
:target: /doc/pdfgetx/Juhas-jac-2018.pdf
296+
297+
298+
.. |citeLiuJac20| replace::
299+
CH Liu, E. Janke, R. Li, P. Juhás, O. Gang, D. V. Talapin,
300+
S. J. L. Billinge,
301+
`sasPDF: pair distribution function analysis of nanoparticle assemblies
302+
from small-angle-scattering data
303+
<https://arxiv.org/abs/1910.08186>`__.
304+
|downloadLiuJac20|
305+
306+
.. |downloadLiuJac20| image:: /images/pdficon_small.png
307+
:target: /doc/pdfgetx/Liu-jac-2020.pdf

Diff for: products/pdfgetx.rst

+12-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,17 @@ Sorry for the complicated process. We hope you enjoy the software!
6767
Documentation
6868
=============
6969

70-
Version 2.1.0 - latest
70+
Version 2.1.1 - latest
71+
----------------------
72+
73+
* `installation instructions <../doc/pdfgetx/2.1.1/install.html>`__
74+
* `user manual <../doc/pdfgetx/2.1.1/index.html>`__,
75+
`printable manual <../doc/pdfgetx/2.1.1/PDFgetXNS3_manual.pdf>`__
76+
* `tutorial files <../doc/pdfgetx/2.1.1/pdfgetxn3-examples.zip>`__
77+
* `release notes <../doc/pdfgetx/2.1.1/release.html>`__
78+
79+
80+
Version 2.1.0
7181
----------------------
7282

7383
* `installation instructions <../doc/pdfgetx/2.1.0/install.html>`__
@@ -76,6 +86,7 @@ Version 2.1.0 - latest
7686
* `tutorial files <../doc/pdfgetx/2.1.0/pdfgetxn3-examples.zip>`__
7787
* `release notes <../doc/pdfgetx/2.1.0/release.html>`__
7888

89+
7990
Version 2.0.0
8091
-------------
8192

Diff for: publications.rst

+4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ References
66
The following papers in the literature describe the DiffPy products.
77
Please cite us if our software has been used in your research.
88

9+
* |citeLiuJac20|
10+
911
* |citeJuhasJac18|
1012

13+
* |citeShiJac18|
14+
1115
* |citeJuhasAca15|
1216

1317
* |citeGranlundAca15|

Diff for: static_root/doc/pdfgetx/2.1.1/PDFgetXNS3_manual.pdf

590 KB
Binary file not shown.

Diff for: static_root/doc/pdfgetx/2.1.1/_images/nickelfqgr.png

69.8 KB
Loading
69.7 KB
Loading
85.9 KB
Loading
77.6 KB
Loading
80.5 KB
Binary file not shown.

Diff for: static_root/doc/pdfgetx/2.1.1/_sources/files.rst.txt

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
Files used in PDF extraction
2+
========================================================================
3+
4+
.. include:: abbreviations.txt
5+
.. _my-configfile:
6+
.. program:: pdfgetx3
7+
8+
Configuration file
9+
------------------------------------------------------------------------
10+
11+
Configuration files may define the PDF processing parameters.
12+
By default, the :program:`pdfgetx3` program attempts to read
13+
:file:`.pdfgetx3.cfg` file from the user HOME directory,
14+
then :file:`.pdfgetx3.cfg` and :file:`pdfgetx3.cfg` files
15+
from the current working directory.
16+
If configuration file has a different name, it needs to be specified
17+
with the :option:`-c, --config <-c>` option.
18+
The :program:`pdfgetn3` program works in the same way,
19+
except it checks for configuration files
20+
:file:`~/.pdfgetn3.cfg`, :file:`.pdfgetn3.cfg` and :file:`pdfgetn3.cfg`.
21+
22+
The easiest way of creating a configuration file is to generate
23+
a template content using the :option:`--createconfig` option as ::
24+
25+
pdfgetx3 --createconfig=test.cfg
26+
27+
and then change the generated test.cfg file in your favorite text
28+
editor. The configuration file follows a simple "varname=value" syntax,
29+
any lines starting with "#" are ignored as comments.
30+
31+
The configuration file has several sections marked as ``[SECTIONNAME]``.
32+
The ``[DEFAULT]`` section is mandatory and it contains the default
33+
global settings. Any other sections are optional and they are applied
34+
only when selected with the :option:`-s, --section <-s>` option on the
35+
command line. Thus ::
36+
37+
pdfgetx3 --config=test.cfg --section=nacl
38+
39+
would read the parameters from the ``[nacl]`` section after reading the
40+
defaults. Having several sections in the configuration
41+
file is useful when there are multiple measurements that share most of
42+
the parameters, but differ in a few of them, for example in chemical
43+
composition. The configuration file can then contain sections per each
44+
sample that define only the composition, while all other parameters are
45+
specified just once in the global DEFAULT section.
46+
47+
48+
Input files
49+
------------------------------------------------------------------------
50+
51+
PDFgetX3 and PDFgetN3 accept input powder diffraction data
52+
in the form of two-column text file,
53+
where the first column x is either the scattering angle
54+
|twotheta| in degrees, momentum transfer *Q* in inverse nanometers or *Q*
55+
in inverse ångströms. The second column y contains the corresponding
56+
scattered intensities normalized per unit solid angle. The actual type
57+
of the x-values is identified by the :confval:`dataformat` parameter.
58+
The input files may contain header with comments or metadata, and the
59+
actual data are read from the first long section of numerical values.
60+
61+
The input files are usually passed as command-line arguments to
62+
:program:`pdfgetx3` or :program:`pdfgetn3` programs and must be paths
63+
accessible from the current working directory.
64+
65+
Input files can be also defined by setting the :confval:`inputfile`
66+
value in the configuration file. The :option:`-d, --datapath <-d>`
67+
option can be then used to provide additional data directories to
68+
search for these inputs and for the :confval:`backgroundfile`.
69+
This is to support configuration files located in a different
70+
directory than the data.
71+
72+
When the :option:`--find <-f>` option is active, the pdfgetx3 arguments
73+
are understood as filename patterns and the input files are found
74+
in the current or specified directory.
75+
76+
77+
Output files
78+
------------------------------------------------------------------------
79+
80+
PDFgetX3 and PDFgetN3 can produce up to four different output data files:
81+
82+
* .iq -- |IQ|, the background-corrected
83+
intensities sampled on a regular *Q*-space grid in inverse ångströms,
84+
85+
* .sq -- |SQ|, the total scattering structure function,
86+
with intensities normalized by average scattering factors and
87+
corrected by a polynomial fit,
88+
89+
* .fq -- |FQ|, the reduced structure function equal to *Q*\ (|SQ| - 1),
90+
91+
* .gr -- |Gr|, the resultant PDF, where the first column is the
92+
separation *r* in ångströms and the second is the function *G* in
93+
Å\ :sup:`-2`.
94+
95+
You can specify what output files should be produced by setting the
96+
:confval:`outputtypes` parameter in the configuration file or by
97+
passing the :option:`-t, --outputtypes <-t>` on the command line.
98+
99+
The header of all output files contains the parameter values that were
100+
used in the calculation and thus it is by itself a valid configuration
101+
file. When passed as an argument to the :option:`--config <-c>` option,
102+
the PDFgetX3 will reproduce the previous calculation.

0 commit comments

Comments
 (0)