Skip to content

[MRG] DOC: Fix the space between attributes in docs #3822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 37 additions & 37 deletions pymc3/backends/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ class BaseTrace:

Parameters
----------
name : str
name: str
Name of backend
model : Model
model: Model
If None, the model is taken from the `with` context.
vars : list of variables
vars: list of variables
Sampling values will be stored for these variables. If None,
`model.unobserved_RVs` is used.
test_point : dict
test_point: dict
use different test point that might be with changed variables shapes
"""

Expand Down Expand Up @@ -113,11 +113,11 @@ def setup(self, draws, chain, sampler_vars=None) -> None:

Parameters
----------
draws : int
draws: int
Expected number of draws
chain : int
chain: int
Chain number
sampler_vars : list of dictionaries (name -> dtype), optional
sampler_vars: list of dictionaries (name -> dtype), optional
Diagnostics / statistics for each sampler. Before passing this
to a backend, you should check, that the `supports_sampler_state`
flag is set.
Expand All @@ -130,9 +130,9 @@ def record(self, point, sampler_states=None):

Parameters
----------
point : dict
point: dict
Values mapped to variable names
sampler_states : list of dicts
sampler_states: list of dicts
The diagnostic values for each sampler
"""
raise NotImplementedError
Expand Down Expand Up @@ -163,9 +163,9 @@ def get_values(self, varname, burn=0, thin=1):

Parameters
----------
varname : str
burn : int
thin : int
varname: str
burn: int
thin: int

Returns
-------
Expand All @@ -178,10 +178,10 @@ def get_sampler_stats(self, stat_name, sampler_idx=None, burn=0, thin=1):

Parameters
----------
stat_name : str
sampler_idx : int or None
burn : int
thin : int
stat_name: str
sampler_idx: int or None
burn: int
thin: int

Returns
-------
Expand Down Expand Up @@ -275,13 +275,13 @@ class MultiTrace:

Attributes
----------
nchains : int
nchains: int
Number of chains in the `MultiTrace`.
chains : `List[int]`
chains: `List[int]`
List of chain indices
report : str
report: str
Report on the sampling process.
varnames : `List[str]`
varnames: `List[str]`
List of variable names in the trace(s)
"""

Expand Down Expand Up @@ -395,12 +395,12 @@ def add_values(self, vals, overwrite=False) -> None:

Parameters
----------
vals : dict (str: array-like)
vals: dict (str: array-like)
The keys should be the names of the new variables. The values are expected to be
array-like objects. For traces with more than one chain the length of each value
should match the number of total samples already in the trace `(chains * iterations)`,
otherwise a warning is raised.
overwrite : bool
overwrite: bool
If `False` (default) a ValueError is raised if the variable already exists.
Change to `True` to overwrite the values of variables

Expand Down Expand Up @@ -441,7 +441,7 @@ def remove_values(self, name):

Parameters
----------
name : str
name: str
Name of the variable to remove. Raises KeyError if the variable is not present
"""
varnames = self.varnames
Expand All @@ -461,15 +461,15 @@ def get_values(self, varname, burn=0, thin=1, combine=True, chains=None,

Parameters
----------
varname : str
burn : int
thin : int
combine : bool
varname: str
burn: int
thin: int
combine: bool
If True, results from `chains` will be concatenated.
chains : int or list of ints
chains: int or list of ints
Chains to retrieve. If None, all chains are used. A single
chain value can also be given.
squeeze : bool
squeeze: bool
Return a single array element if the resulting list of
values only has one element. If False, the result will
always be a list of arrays, even if `combine` is True.
Expand All @@ -495,10 +495,10 @@ def get_sampler_stats(self, stat_name, burn=0, thin=1, combine=True,

Parameters
----------
stat_name : str
sampler_idx : int or None
burn : int
thin : int
stat_name: str
sampler_idx: int or None
burn: int
thin: int

Returns
-------
Expand Down Expand Up @@ -535,8 +535,8 @@ def point(self, idx, chain=None):

Parameters
----------
idx : int
chain : int
idx: int
chain: int
If a chain is not given, the highest chain number is used.
"""
if chain is None:
Expand All @@ -548,7 +548,7 @@ def points(self, chains=None):

Parameters
----------
chains : list of int or N
chains: list of int or N
The chains whose points should be inlcuded in the iterator. If
chains is not given, include points from all chains.
"""
Expand All @@ -563,7 +563,7 @@ def merge_traces(mtraces: List[MultiTrace]) -> MultiTrace:

Parameters
----------
mtraces : list of MultiTraces
mtraces: list of MultiTraces
Each instance should have unique chain numbers.

Raises
Expand Down
18 changes: 9 additions & 9 deletions pymc3/backends/hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ class HDF5(base.BaseTrace):

Parameters
----------
name : str
name: str
Name of backend. This has no meaning for the HDF5 backend.
model : Model
model: Model
If None, the model is taken from the `with` context.
vars : list of variables
vars: list of variables
Sampling values will be stored for these variables. If None,
`model.unobserved_RVs` is used.
test_point : dict
test_point: dict
use different test point that might be with changed variables shapes
"""

Expand Down Expand Up @@ -148,11 +148,11 @@ def setup(self, draws, chain, sampler_vars=None):

Parameters
----------
draws : int
draws: int
Expected number of draws
chain : int
chain: int
Chain number
sampler_vars : list of dicts
sampler_vars: list of dicts
Names and dtypes of the variables that are
exported by the samplers.
"""
Expand Down Expand Up @@ -228,9 +228,9 @@ def load(name, model=None):

Parameters
----------
name : str
name: str
Path to HDF5 arrays file
model : Model
model: Model
If None, the model is taken from the `with` context.

Returns
Expand Down
30 changes: 15 additions & 15 deletions pymc3/backends/ndarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ def save_trace(trace: MultiTrace, directory: Optional[str]=None, overwrite=False

Parameters
----------
trace : pm.MultiTrace
trace: pm.MultiTrace
trace to save to disk
directory : str (optional)
directory: str (optional)
path to a directory to save the trace
overwrite : bool (default False)
overwrite: bool (default False)
whether to overwrite an existing directory.

Returns
Expand Down Expand Up @@ -80,9 +80,9 @@ def load_trace(directory: str, model=None) -> MultiTrace:

Parameters
----------
directory : str
directory: str
Path to a pymc3 serialized trace
model : pm.Model (optional)
model: pm.Model (optional)
Model used to create the trace. Can also be inferred from context

Returns
Expand Down Expand Up @@ -182,11 +182,11 @@ class NDArray(base.BaseTrace):

Parameters
----------
name : str
name: str
Name of backend. This has no meaning for the NDArray backend.
model : Model
model: Model
If None, the model is taken from the `with` context.
vars : list of variables
vars: list of variables
Sampling values will be stored for these variables. If None,
`model.unobserved_RVs` is used.
"""
Expand All @@ -207,11 +207,11 @@ def setup(self, draws, chain, sampler_vars=None) -> None:

Parameters
----------
draws : int
draws: int
Expected number of draws
chain : int
chain: int
Chain number
sampler_vars : list of dicts
sampler_vars: list of dicts
Names and dtypes of the variables that are
exported by the samplers.
"""
Expand Down Expand Up @@ -260,7 +260,7 @@ def record(self, point, sampler_stats=None) -> None:

Parameters
----------
point : dict
point: dict
Values mapped to variable names
"""
for varname, value in zip(self.varnames, self.fn(point)):
Expand Down Expand Up @@ -303,9 +303,9 @@ def get_values(self, varname: str, burn=0, thin=1) -> np.ndarray:

Parameters
----------
varname : str
burn : int
thin : int
varname: str
burn: int
thin: int

Returns
-------
Expand Down
24 changes: 12 additions & 12 deletions pymc3/backends/sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ class SQLite(base.BaseTrace):

Parameters
----------
name : str
name: str
Name of database file
model : Model
model: Model
If None, the model is taken from the `with` context.
vars : list of variables
vars: list of variables
Sampling values will be stored for these variables. If None,
`model.unobserved_RVs` is used.
test_point : dict
test_point: dict
use different test point that might be with changed variables shapes
"""

Expand All @@ -110,9 +110,9 @@ def setup(self, draws, chain):

Parameters
----------
draws : int
draws: int
Expected number of draws
chain : int
chain: int
Chain number
"""
self.db.connect()
Expand Down Expand Up @@ -158,7 +158,7 @@ def record(self, point):

Parameters
----------
point : dict
point: dict
Values mapped to variable names
"""
for varname, value in zip(self.varnames, self.fn(point)):
Expand Down Expand Up @@ -219,9 +219,9 @@ def get_values(self, varname, burn=0, thin=1):

Parameters
----------
varname : str
burn : int
thin : int
varname: str
burn: int
thin: int

Returns
-------
Expand Down Expand Up @@ -313,9 +313,9 @@ def load(name, model=None):

Parameters
----------
name : str
name: str
Path to SQLite database file
model : Model
model: Model
If None, the model is taken from the `with` context.

Returns
Expand Down
Loading