Skip to content

Commit 11c3611

Browse files
author
bfolie
authored
Merge pull request #145 from CitrineInformatics/docs-cleanup
Docs cleanup
2 parents 086bbd2 + 2a4f44f commit 11c3611

28 files changed

+360
-100
lines changed

docs/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ SPHINXBUILD ?= sphinx-build
88
SOURCEDIR = source
99
BUILDDIR = _build
1010

11+
export SPHINX_APIDOC_OPTIONS=members,undoc-members,inherited-members,show-inheritance
12+
1113
# Put it first so that "make" without argument is like "make help".
1214
help:
1315
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/source/_static/css/custom.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* Displays method signatures with one parameter per line.
2+
See https://github.com/sphinx-doc/sphinx/issues/1514 */
3+
4+
/* Newline (\a) and spaces (\20) before each parameter */
5+
.sig-param::before {
6+
content: "\a\20\20\20\20\20\20\20\20\20\20\20\20\20\20\20\20";
7+
white-space: pre;
8+
}
9+
10+
/* Newline after the last parameter (so the closing bracket is on a new line) */
11+
dt em.sig-param:last-of-type::after {
12+
content: "\a";
13+
white-space: pre;
14+
}
15+
16+
/* To have blue background be width of the block (instead of width of content) */
17+
dl.class > dt:first-of-type {
18+
display: block !important;
19+
}

docs/source/conf.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
# ones.
3333
extensions = [
3434
'sphinxcontrib.apidoc',
35-
'sphinx.ext.napoleon'
35+
'sphinx.ext.napoleon',
36+
'sphinx.ext.intersphinx'
3637
]
3738

3839
# Use the sphinxcontrib.apidoc extension to wire in the sphinx-apidoc invocation
@@ -59,12 +60,22 @@
5960
# The theme to use for HTML and HTML Help pages. See the documentation for
6061
# a list of builtin themes.
6162
#
62-
html_theme = 'alabaster'
63+
html_theme = 'sphinx_rtd_theme'
6364

6465
# Add any paths that contain custom static files (such as style sheets) here,
6566
# relative to this directory. They are copied after the builtin static files,
6667
# so a file named "default.css" will overwrite the builtin "default.css".
6768
html_static_path = ['_static']
6869

69-
# autodoc_mock_imports allows Spyinx to ignore any external modules listed in the array
70+
# These paths are either relative to html_static_path or fully qualified paths (eg. https://...)
71+
html_css_files = [
72+
'css/custom.css',
73+
]
74+
75+
autodoc_member_order = 'groupwise'
76+
# autodoc_mock_imports allows Sphinx to ignore any external modules listed in the array
7077
autodoc_mock_imports = []
78+
79+
html_theme_options = {
80+
"sticky_navigation": False
81+
}

gemd/entity/attribute/condition.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,24 @@ class Condition(BaseAttribute):
88
Conditions are environmental variables (typically measured) that may affect a process
99
or measurement: e.g., temperature, pressure.
1010
11+
Parameters
12+
----------
13+
name: str
14+
Required name of the attribute. Each attribute within an object must have a unique name.
15+
notes: str
16+
Optional free-form notes about the attribute.
17+
value: :class:`BaseValue <gemd.entity.value.base_value.BaseValue>`
18+
The value of the attribute.
19+
template: :class:`AttributeTemplate \
20+
<gemd.entity.template.attribute_template.AttributeTemplate>`
21+
Attribute template that defines the allowed bounds of this attribute. If a template
22+
and value are both present then the value must be within the template bounds.
23+
origin: str
24+
The origin of the attribute. Must be one of "measured", "predicted", "summary",
25+
"specified", "computed", or "unknown." Default is "unknown."
26+
file_links: List[:class:`FileLink <gemd.entity.file_link.FileLink>`]
27+
Links to files associated with the attribute.
28+
1129
"""
1230

1331
typ = "condition"

gemd/entity/attribute/parameter.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,24 @@ class Parameter(BaseAttribute):
99
affect a process or measurement: e.g. oven dial temperature for a kiln firing, magnification
1010
for a measurement taken with an electron microscope.
1111
12+
Parameters
13+
----------
14+
name: str
15+
Required name of the attribute. Each attribute within an object must have a unique name.
16+
notes: str
17+
Optional free-form notes about the attribute.
18+
value: :class:`BaseValue <gemd.entity.value.base_value.BaseValue>`
19+
The value of the attribute.
20+
template: :class:`AttributeTemplate \
21+
<gemd.entity.template.attribute_template.AttributeTemplate>`
22+
Attribute template that defines the allowed bounds of this attribute. If a template
23+
and value are both present then the value must be within the template bounds.
24+
origin: str
25+
The origin of the attribute. Must be one of "measured", "predicted", "summary",
26+
"specified", "computed", or "unknown." Default is "unknown."
27+
file_links: List[:class:`FileLink <gemd.entity.file_link.FileLink>`]
28+
Links to files associated with the attribute.
29+
1230
"""
1331

1432
typ = "parameter"

gemd/entity/attribute/property.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,25 @@ class Property(BaseAttribute):
66
Property of a material, measured in a MeasurementRun or specified in a MaterialSpec.
77
88
Properties are characteristics of a material that could be measured, e.g. chemical composition,
9-
density, yield strength.
9+
density, yield strength.
10+
11+
Parameters
12+
----------
13+
name: str
14+
Required name of the attribute. Each attribute within an object must have a unique name.
15+
notes: str
16+
Optional free-form notes about the attribute.
17+
value: :class:`BaseValue <gemd.entity.value.base_value.BaseValue>`
18+
The value of the attribute.
19+
template: :class:`AttributeTemplate \
20+
<gemd.entity.template.attribute_template.AttributeTemplate>`
21+
Attribute template that defines the allowed bounds of this attribute. If a template
22+
and value are both present then the value must be within the template bounds.
23+
origin: str
24+
The origin of the attribute. Must be one of "measured", "predicted", "summary",
25+
"specified", "computed", or "unknown." Default is "unknown."
26+
file_links: List[:class:`FileLink <gemd.entity.file_link.FileLink>`]
27+
Links to files associated with the attribute.
1028
1129
"""
1230

gemd/entity/attribute/property_and_conditions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ class PropertyAndConditions(DictSerializable):
1212
1313
Parameters
1414
----------
15-
property: Property
15+
property: :class:`Property <gemd.entity.attribute.property.Property>`
1616
A property attribute
17-
conditions: List[Condition]
17+
conditions: List[:class:`Condition <gemd.entity.attribute.condition.Condition>`]
1818
An optional list of conditions associated with this property.
1919
2020
"""

gemd/entity/object/base_object.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class BaseObject(BaseEntity):
2323
for filtering and discoverability.
2424
notes: str, optional
2525
Long-form notes about the object.
26-
file_links: List[FileLink], optional
26+
file_links: List[:class:`FileLink <gemd.entity.file_link.FileLink>`], optional
2727
Links to associated files, with resource paths into the files API.
2828
2929
"""

gemd/entity/object/has_conditions.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44

55

66
class HasConditions(object):
7-
"""Mixin-trait for entities that include conditions."""
7+
"""Mixin-trait for entities that include conditions.
8+
9+
Parameters
10+
----------
11+
conditions: List[:class:`Condition <gemd.entity.attribute.condition.Condition>`]
12+
A list of conditions associated with this entity.
13+
14+
"""
815

916
def __init__(self, conditions):
1017
self._conditions = None

gemd/entity/object/has_parameters.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44

55

66
class HasParameters(object):
7-
"""Mixin-trait for entities that include parameters."""
7+
"""Mixin-trait for entities that include parameters.
8+
9+
Parameters
10+
----------
11+
parameters: List[:class:`Parameter <gemd.entity.attribute.parameter.Parameter>`]
12+
A list of parameters associated with this entity.
13+
14+
"""
815

916
def __init__(self, parameters):
1017
self._parameters = None

0 commit comments

Comments
 (0)