Skip to content

Commit 93f030c

Browse files
committed
fix: fix format of docs build so that no warning arise
1 parent cbf4a11 commit 93f030c

File tree

5 files changed

+75
-77
lines changed

5 files changed

+75
-77
lines changed

docs/source/api/diffpy.utils.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,6 @@ diffpy.utils.tools module
4444
:undoc-members:
4545
:show-inheritance:
4646

47-
diffpy.utils.user_config module
48-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
49-
50-
.. automodule:: diffpy.utils.user_config
51-
:members:
52-
:undoc-members:
53-
:show-inheritance:
54-
5547
diffpy.utils.diffraction_objects module
5648
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5749

src/diffpy/utils/diffraction_objects.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,18 @@ def __init__(
108108
109109
Parameters
110110
----------
111-
xarray : ndarray
111+
xarray : ``ndarray``
112112
The independent variable array containing "q", "tth", or "d" values.
113-
yarray : ndarray
113+
yarray : ``ndarray``
114114
The dependent variable array corresponding to intensity values.
115115
xtype : str
116116
The type of the independent variable in `xarray`. Must be one of
117117
{*XQUANTITIES}.
118-
wavelength : float, optional, default is None.
118+
wavelength : float, ``optional``, default is None.
119119
The wavelength of the incoming beam, specified in angstroms (Å)
120-
scat_quantity : str, optional, default is an empty string "".
120+
scat_quantity : str, ``optional``, default is an empty string "".
121121
The type of scattering experiment (e.g., "x-ray", "neutron").
122-
name : str, optional, default is an empty string "".
122+
name : str, ``optional``, default is an empty string "".
123123
The name or label for the scattering data.
124124
metadata : dict, optional, default is an empty dictionary {}
125125
The additional metadata associated with the diffraction object.
@@ -360,7 +360,7 @@ def all_arrays(self):
360360
361361
Returns
362362
-------
363-
ndarray
363+
``ndarray``
364364
The shape (len(data), 4) 2D array with columns containing the `
365365
yarray` (intensity) and the `xarray` values in q, tth, and d.
366366
@@ -386,7 +386,7 @@ def input_xtype(self):
386386
Returns
387387
-------
388388
input_xtype : str
389-
The type of `xarray`, which must be one of {*XQUANTITIES}.
389+
The type of `xarray`, which must be one of ``{*XQUANTITIES}``.
390390
"""
391391
return self._input_xtype
392392

@@ -400,7 +400,7 @@ def uuid(self):
400400
401401
Returns
402402
-------
403-
uuid : UUID
403+
uuid : ``UUID``
404404
The unique identifier of the DiffractionObject instance.
405405
"""
406406
return self._uuid
@@ -478,7 +478,7 @@ def on_q(self):
478478
479479
Returns
480480
-------
481-
(q-array, y-array) : tuple of ndarray
481+
(q-array, y-array) : tuple of ``ndarray``
482482
The tuple containing two 1D numpy arrays with q and y data
483483
"""
484484
return [self.all_arrays[:, 1], self.all_arrays[:, 0]]
@@ -488,7 +488,7 @@ def on_tth(self):
488488
489489
Returns
490490
-------
491-
(tth-array, y-array) : tuple of ndarray
491+
(tth-array, y-array) : tuple of ``ndarray``
492492
The tuple containing two 1D numpy arrays with tth and y data
493493
"""
494494
return [self.all_arrays[:, 2], self.all_arrays[:, 0]]
@@ -498,7 +498,7 @@ def on_d(self):
498498
499499
Returns
500500
-------
501-
(d-array, y-array) : tuple of ndarray
501+
(d-array, y-array) : tuple of ``ndarray``
502502
The tuple containing two 1D numpy arrays with d and y data
503503
"""
504504
return [self.all_arrays[:, 3], self.all_arrays[:, 0]]
@@ -522,12 +522,12 @@ def scale_to(
522522
target_diff_object: DiffractionObject
523523
The diffraction object you want to scale the current one onto.
524524
525-
q, tth, d : float, optional, default is None
525+
q, tth, d : float, ``optional``, default is None
526526
The value of the x-array where you want the curves to line up
527527
vertically. Specify a value on one of the allowed grids, q, tth,
528528
or d), e.g., q=10.
529529
530-
offset : float, optional, default is None
530+
offset : float, ``optional``, default is None
531531
The offset to add to the scaled y-values.
532532
533533
Returns
@@ -574,16 +574,16 @@ def on_xtype(self, xtype):
574574
----------
575575
xtype : str
576576
The type of quantity for the independent variable chosen from
577-
{*XQUANTITIES, }
577+
``{*XQUANTITIES, }``
578578
579579
Raises
580580
------
581581
ValueError
582-
Raised when the specified xtype is not among {*XQUANTITIES, }
582+
Raised when the specified xtype is not among ``{*XQUANTITIES, }``
583583
584584
Returns
585585
-------
586-
(xarray, yarray) : tuple of ndarray
586+
(xarray, yarray) : tuple of ``ndarray``
587587
The tuple containing two 1D numpy arrays with x and y data for
588588
the specified xtype.
589589
"""
@@ -604,9 +604,9 @@ def dump(self, filepath, xtype=None):
604604
----------
605605
filepath : str
606606
The filepath where the diffraction object will be dumped
607-
xtype : str, optional, default is q
607+
xtype : str, ``optional``, default is q
608608
The type of quantity for the independent variable chosen from
609-
{*XQUANTITIES, }
609+
``{*XQUANTITIES, }``
610610
611611
Examples
612612
--------

src/diffpy/utils/resampler.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ def wsinterp(x, xp, fp, left=None, right=None):
3030
3131
Parameters
3232
----------
33-
x: ndarray
33+
x: ``ndarray``
3434
The x values at which interpolation is computed.
35-
xp: ndarray
35+
xp: ``ndarray``
3636
The array of known x values.
37-
fp: ndarray
37+
fp: ``ndarray``
3838
The array of y values associated with xp.
3939
left: float
4040
If given, set fp for x < xp[0] to left. Otherwise, if left is None
@@ -46,7 +46,7 @@ def wsinterp(x, xp, fp, left=None, right=None):
4646
4747
Returns
4848
-------
49-
ndarray or float
49+
``ndarray`` or float
5050
The interpolated values at points x. Returns a single float if x is a
5151
scalar, otherwise returns a numpy.ndarray.
5252
"""
@@ -91,9 +91,9 @@ def nsinterp(xp, fp, qmin=0, qmax=25, left=None, right=None):
9191
9292
Parameters
9393
----------
94-
xp: ndarray
94+
xp: ``ndarray``
9595
The array of known x values.
96-
fp: ndarray
96+
fp: ``ndarray``
9797
The array of y values associated with xp.
9898
qmin: float
9999
The lower band limit in the frequency domain.
@@ -102,7 +102,7 @@ def nsinterp(xp, fp, qmin=0, qmax=25, left=None, right=None):
102102
103103
Returns
104104
-------
105-
x: ndarray
105+
x: ``ndarray``
106106
The Nyquist-Shannon grid computed for the given qmin and qmax.
107107
fp_at_x: ndarray
108108
The interpolated values at points x. Returns a single float if x is a
@@ -139,7 +139,7 @@ def resample(r, s, dr):
139139
140140
Returns
141141
-------
142-
Returns resampled (r, s).
142+
Returns resampled ``(r, s)``.
143143
"""
144144

145145
warnings.warn(

src/diffpy/utils/tools.py

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -51,43 +51,46 @@ def _load_config(file_path):
5151

5252

5353
def get_user_info(owner_name=None, owner_email=None, owner_orcid=None):
54-
"""Get name, email, and orcid of the owner/user from various sources and
54+
"""Get name, email, and ORCID of the owner/user from various sources and
5555
return it as a metadata dictionary.
5656
57-
The function looks for the information in json format configuration files
58-
with the name 'diffpyconfig.json'. These can be in the user's home
59-
directory and in the current working directory. The information in the
60-
config files are combined, with the local config overriding the
61-
home- directory one. Values for owner_name, owner_email, and owner_orcid
62-
may be passed in to the function and these override the values in the
63-
config files.
64-
65-
A template for the config file is below. Create a text file called '
66-
diffpyconfig.json' in your home directory and copy-paste the template
67-
into it, editing it with your real information.
68-
{
69-
"owner_name": "<your name as you would like it stored with your data>>",
70-
"owner_email": "<your_associated_email>>@email.com",
71-
"owner_orcid": "<your_associated_orcid if you would like this stored with your data>>" # noqa: E501
72-
}
57+
The function looks for information in JSON configuration files named
58+
``diffpyconfig.json``. These can be in the user's home directory and in
59+
the current working directory. The information in the config files is
60+
combined, with the local config overriding the home-directory one.
61+
Values for ``owner_name``, ``owner_email``, and ``owner_orcid`` may be
62+
passed in to the function, and these override the config files.
63+
64+
A template for the config file is below. Create a text file called
65+
``diffpyconfig.json`` in your home directory and paste the template into
66+
it, editing it with your real information::
67+
68+
{
69+
"owner_name": "<your name as you would like it stored with your data>",
70+
"owner_email": "<your_associated_email>@email.com",
71+
"owner_orcid": "<your_associated_orcid if you would like this stored with your data>" # noqa: E501
72+
}
73+
7374
You may also store any other global-level information that you would like
74-
associated with your diffraction data in this file
75+
associated with your diffraction data in this file.
7576
7677
Parameters
7778
----------
78-
owner_name : str, optional, default is the value stored in the global or
79-
local config file. The name of the user who will show as owner in the
80-
metadata that is stored with the data
81-
owner_email : str, optional, default is the value stored in the global or
82-
local config file. The email of the user/owner
83-
owner_orcid : str, optional, default is the value stored in the global or
84-
local config file. The ORCID id of the user/owner
79+
owner_name : str, ``optional``
80+
Default is the value stored in the global or local config file.
81+
The name of the user stored in metadata.
82+
owner_email : str, ``optional``
83+
Default is the value stored in the global or local config file.
84+
The email address of the user/owner.
85+
owner_orcid : str, ``optional``
86+
Default is the value stored in the global or local config file.
87+
The ORCID ID of the user/owner.
8588
8689
Returns
8790
-------
8891
user_info : dict
89-
The dictionary containing username, email and orcid of the user/owner
90-
, and any other information stored in the global or local config files.
92+
Dictionary containing username, email, ORCID, and any other
93+
information stored in global or local config files.
9194
"""
9295
runtime_info = {
9396
"owner_name": owner_name,
@@ -127,9 +130,9 @@ def check_and_build_global_config(skip_config_creation=False):
127130
128131
Parameters
129132
----------
130-
skip_config_creation : bool, optional, default is False.
133+
skip_config_creation : bool, ``optional``
131134
The boolean that will override the creation workflow even if no
132-
config file exists.
135+
config file exists. Default is False.
133136
134137
Returns
135138
-------
@@ -190,6 +193,7 @@ def get_package_info(package_names, metadata=None):
190193
Package info stored in metadata as
191194
{'package_info': {'package_name': 'version_number'}}.
192195
196+
Parameters
193197
----------
194198
package_name : str or list
195199
The name of the package(s) to retrieve the version number for.
@@ -244,11 +248,13 @@ def compute_mu_using_xraydb(
244248
The chemical formula of the material.
245249
energy : float
246250
The energy of the incident x-rays in keV.
247-
sample_mass_density : float, optional, Default is None
251+
sample_mass_density : float, ``optional``
248252
The mass density of the packed powder/sample in g/cm*3.
249-
packing_fraction : float, optional, Default is None
253+
Default is None.
254+
packing_fraction : float, ``optional``
250255
The fraction of sample in the capillary (between 0 and 1).
251256
Specify either sample_mass_density or packing_fraction but not both.
257+
Default is None.
252258
253259
Returns
254260
-------

0 commit comments

Comments
 (0)