Skip to content

Commit

Permalink
Updates to docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
perwin committed Nov 13, 2021
1 parent 12ff241 commit 1f7dc32
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 24 deletions.
1 change: 1 addition & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ sphinx:
formats: all

# Optionally set the version of Python and requirements required to build your docs
# Currently (Nov 2021), readthedocs does not support Python later than 3.8
python:
version: 3.8
system_packages: true
Expand Down
1 change: 1 addition & 0 deletions docs/api_ref_local/descriptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ generated instance of the ModelDescription (or SimpleModelDescription) class.


.. automodule:: pyimfit.descriptions
:imported-members:
:members:
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# -- Project information -----------------------------------------------------

project = 'PyImfit'
copyright = '2020-2021, Peter Erwin'
copyright = '2019-2021, Peter Erwin'
author = 'Peter Erwin'

# The short X.Y version
Expand Down
3 changes: 2 additions & 1 deletion docs/howto_generate_docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ while editing them.
2. Update rST files if needed: index.rst; api_ref/api_index.rst, other
api-related .rst files in that directory.

3. IF the Jupyter notebook file has been updated, generate a markdown version
3. IF one or more the Jupyter notebook files have been updated, generate a markdown versions
with
$ jupyter nbconvert pyimfit_emcee.ipynb --to markdown
$ jupyter nbconvert pyimfit_bootstrap_BtoT.ipynb --to markdown

4. Generate rST versions of the Markdown files (by running convert_md_to_rst.sh
script), generate the Sphinx HTML files, extract the apidoc-generated bits of
Expand Down
11 changes: 2 additions & 9 deletions docs/pyimfit_bootstrap_BtoT.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -464,18 +464,11 @@
"hist(b2t_values, bins=np.arange(0.14,0.2,0.0025));xlabel(r\"$B/T$\");ylabel(r\"$N$\")\n",
"axvline(GetBtoT(imfit_fitter, p_bestfit), color='k')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -489,7 +482,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.9.6"
},
"toc": {
"colors": {
Expand Down
7 changes: 2 additions & 5 deletions docs/pyimfit_bootstrap_BtoT.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,7 @@ axvline(GetBtoT(imfit_fitter, p_bestfit), color='k')




![png](pyimfit_bootstrap_BtoT_files/pyimfit_bootstrap_BtoT_37_1.png)




```python

```
2 changes: 0 additions & 2 deletions docs/pyimfit_bootstrap_BtoT.rst
Original file line number Diff line number Diff line change
Expand Up @@ -256,5 +256,3 @@ A histogram of the :math:`B/T` values (vertical line = best-fit value):
:alt: png

png

.. code:: python
11 changes: 5 additions & 6 deletions pyimfit/descriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,12 @@ def dict_to_FunctionDescription(cls, inputDict):
Parameters
----------
inputDict : dict
dict describing the function
Examples:
dict describing the function. Examples:
fDict = {'name': "Gaussian", 'label': "blob", 'parameters': p}
where p is a dict containing parameter names and values, e.g.
p = {'PA': 0.0, 'ell': 0.5, 'I_0': 100.0, 'sigma': 10.0}
OR
p = {'PA': [0.0, "fixed"], 'ell': [0.5, 0.1,0.8], 'I_0': [100.0, 10.0,1e3],
'sigma': [10.0, 5.0,20.0]}
p = {'PA': [0.0, "fixed"], 'ell': [0.5, 0.1,0.8], 'I_0': [100.0, 10.0,1e3], 'sigma': [10.0, 5.0,20.0]}
Returns
-------
Expand Down Expand Up @@ -439,8 +437,7 @@ def getFunctionAsDict(self):
where p is a dict containing parameter names and values, e.g.
p = {'PA': 0.0, 'ell': 0.5, 'I_0': 100.0, 'sigma': 10.0}
OR
p = {'PA': [0.0, "fixed"], 'ell': [0.5, 0.1,0.8], 'I_0': [100.0, 10.0,1e3],
'sigma': [10.0, 5.0,20.0]}
p = {'PA': [0.0, "fixed"], 'ell': [0.5, 0.1,0.8], 'I_0': [100.0, 10.0,1e3], 'sigma': [10.0, 5.0,20.0]}
"""
# FIXME: write code for this!
paramsDict = { param.name: param.getParamInfoList() for param in self._parameters }
Expand Down Expand Up @@ -567,6 +564,7 @@ def dict_to_FunctionSetDescription(cls, inputDict: dict):
dict describing the function set
{'X0': val-or-list, 'Y0': val-or-list, 'function_list': [list of dicts describing functions]}
{'label': str, 'X0': val-or-list, 'Y0': val-or-list, 'function_list': [list of dicts describing functions]}
where "val-or-list" for X0 and Y0 is one of
value
[value, "fixed"]
Expand Down Expand Up @@ -886,6 +884,7 @@ def dict_to_ModelDescription(cls, inputDict: dict):
inputDict : dict
dict describing the model, with one required entry -- "function_sets" --
and one optional entry -- "options"
"function_sets" : list of dict, each one specifying a function set,
suitable as input to FunctionSetDescription.dict_to_FunctionSetDescription()
Expand Down

0 comments on commit 1f7dc32

Please sign in to comment.