Skip to content

Commit

Permalink
[ci skip] Remove sphinx-paramlinks (#584)
Browse files Browse the repository at this point in the history
  • Loading branch information
michalk8 authored May 9, 2021
1 parent 2ffaaca commit d32cc2b
Show file tree
Hide file tree
Showing 21 changed files with 141 additions and 144 deletions.
4 changes: 2 additions & 2 deletions cellrank/external/kernels/_statot_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class OTKernel(OTKernel_, error=_error):
%(adata)s
terminal_states
Categorical :class:`pandas.Series` where non-`NaN` values mark terminal states.
If `None`, terminal states are assumed to be already present in :paramref:`adata` ``['terminal_states']``.
If `None`, terminal states are assumed to be already present in :attr:`adata` ``['terminal_states']``.
g
Key in :attr:`anndata.AnnData.obs` containing relative growth rates for cells or the array itself.
cluster_key
Expand Down Expand Up @@ -114,7 +114,7 @@ def compute_transition_matrix(
Returns
-------
:class:`cellrank.external.kernels.OTKernel`
Makes :paramref:`transition_matrix` available.
Makes :attr:`transition_matrix` available.
"""
if method not in ("ent", "quad", "unbal"):
raise ValueError(f"Invalid method `{method!r}`.")
Expand Down
2 changes: 1 addition & 1 deletion cellrank/pl/_gene_trend.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def gene_trends(
If ``same_plot=False``, show ``lineages`` in rows and ``genes`` in columns.
%(model_callback)s
conf_int
Whether to compute and show confidence interval. If the :paramref:`model` is :class:`cellrank.ul.models.GAMR`,
Whether to compute and show confidence interval. If the :attr:`model` is :class:`cellrank.ul.models.GAMR`,
it can also specify the confidence level, the default is `0.95`.
same_plot
Whether to plot all lineages for each gene in the same plot.
Expand Down
54 changes: 27 additions & 27 deletions cellrank/tl/estimators/_base_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,18 @@ class BaseEstimator(LineageEstimatorMixin, Partitioner, ABC):
Either a :class:`cellrank.tl.kernels.Kernel` object, an :class:`anndata.AnnData` object which
stores the transition matrix in ``.obsp`` attribute or :mod:`numpy` or :mod:`scipy` array.
inplace
Whether to modify :paramref:`adata` object inplace or make a copy.
Whether to modify :attr:`adata` object inplace or make a copy.
read_from_adata
Whether to read available attributes in :paramref:`adata`, if present.
Whether to read available attributes in :attr:`adata`, if present.
obsp_key
Key in ``obj.obsp`` when ``obj`` is an :class:`anndata.AnnData` object.
g2m_key
Key in :paramref:`adata` ``.obs``. Can be used to detect cell-cycle driven start- or endpoints.
Key in :attr:`adata` ``.obs``. Can be used to detect cell-cycle driven start- or endpoints.
s_key
Key in :paramref:`adata` ``.obs``. Can be used to detect cell-cycle driven start- or endpoints.
Key in :attr:`adata` ``.obs``. Can be used to detect cell-cycle driven start- or endpoints.
write_to_adata
Whether to write the transition matrix to :paramref:`adata` ``.obsp`` and the parameters to
:paramref:`adata` ``.uns``.
Whether to write the transition matrix to :attr:`adata` ``.obsp`` and the parameters to
:attr:`adata` ``.uns``.
%(write_to_adata.parameters)s
Only used when ``write_to_adata=True``.
"""
Expand Down Expand Up @@ -249,7 +249,7 @@ def set_terminal_states(
belonging to a transient state or a :class:`dict`, where each key is the name of the recurrent class and
values are list of cell names.
cluster_key
If a key to cluster labels is given, :paramref:`{fs}` will be associated with these for naming and colors.
If a key to cluster labels is given, :attr:`{fs}` will be associated with these for naming and colors.
%(en_cutoff_p_thresh)s
add_to_existing
Whether to add these categories to existing ones. Cells already belonging to recurrent classes will be
Expand All @@ -261,8 +261,8 @@ def set_terminal_states(
None
Nothing, but updates the following fields:
- :paramref:`{fsp}`
- :paramref:`{fs}`
- :attr:`{fsp}`
- :attr:`{fs}`
"""

self._set_categorical_labels(
Expand All @@ -283,19 +283,19 @@ def rename_terminal_states(
self, new_names: Mapping[str, str], update_adata: bool = True
) -> None:
"""
Rename the names of :paramref:`{ts}`.
Rename the names of :attr:`{ts}`.
Parameters
----------
new_names
Mapping where keys are the old names and the values are the new names. New names must be unique.
update_adata
Whether to update underlying :paramref:`adata` object as well or not.
Whether to update underlying :attr:`adata` object as well or not.
Returns
-------
None
Nothing, just updates the names of :paramref:`{ts}`.
Nothing, just updates the names of :attr:`{ts}`.
"""

term_states = self._get(P.TERM)
Expand Down Expand Up @@ -372,7 +372,7 @@ def compute_absorption_probabilities(
Compute absorption probabilities of a Markov chain.
For each cell, this computes the probability of it reaching any of the approximate recurrent classes defined
by :paramref:`{fs}`.
by :attr:`{fs}`.
Parameters
----------
Expand Down Expand Up @@ -421,8 +421,8 @@ def compute_absorption_probabilities(
None
Nothing, but updates the following fields:
- :paramref:`{abs_prob}` - probabilities of being absorbed into the terminal states.
- :paramref:`{lat}` - mean times until absorption to subset absorbing states and optionally
- :attr:`{abs_prob}` - probabilities of being absorbed into the terminal states.
- :attr:`{lat}` - mean times until absorption to subset absorbing states and optionally
their variances saved as ``'{{lineage}} mean'`` and ``'{{lineage}} var'``, respectively,
for each subset of absorbing states specified in ``time_to_absorption``.
"""
Expand Down Expand Up @@ -675,7 +675,7 @@ def compute_lineage_drivers(
Parameters
----------
lineages
Either a set of lineage names from :paramref:`absorption_probabilities` `.names` or `None`,
Either a set of lineage names from :attr:`absorption_probabilities` `.names` or `None`,
in which case all lineages are considered.
method
Mode to use when calculating p-values and confidence intervals. Can be one of:
Expand All @@ -684,13 +684,13 @@ def compute_lineage_drivers(
- {tm.PERM_TEST.s!r} - use permutation test.
cluster_key
Key from :paramref:`adata` ``.obs`` to obtain cluster annotations. These are considered for ``clusters``.
Key from :attr:`adata` ``.obs`` to obtain cluster annotations. These are considered for ``clusters``.
clusters
Restrict the correlations to these clusters.
layer
Key from :paramref:`adata` ``.layers``.
Key from :attr:`adata` ``.layers``.
use_raw
Whether or not to use :paramref:`adata` ``.raw`` to correlate gene expression.
Whether or not to use :attr:`adata` ``.raw`` to correlate gene expression.
If using a layer other than ``.X``, this must be set to `False`.
confidence_level
Confidence level for the confidence interval calculation. Must be in `[0, 1]`.
Expand All @@ -709,14 +709,14 @@ def compute_lineage_drivers(
Only if ``return_drivers=True``.
None
Updates :paramref:`adata` ``.var`` or :paramref:`adata` ``.raw.var``, depending ``use_raw`` with:
Updates :attr:`adata` ``.var`` or :attr:`adata` ``.raw.var``, depending ``use_raw`` with:
- ``'{{direction}} {{lineage}} corr'`` - the potential lineage drivers.
- ``'{{direction}} {{lineage}} qval'`` - the corrected p-values.
Updates the following fields:
- :paramref:`{lin_drivers}` - same as the returned values.
- :attr:`{lin_drivers}` - same as the returned values.
References
----------
Expand Down Expand Up @@ -858,7 +858,7 @@ def plot_lineage_drivers(
ncols
Number of columns.
use_raw
Whether to look in :paramref:`adata` ``.raw.var`` or :paramref:`adata` ``.var``.
Whether to look in :attr:`adata` ``.raw.var`` or :attr:`adata` ``.var``.
title_fmt
Title format. Possible keywords include `{gene}`, `{qval}`, `{corr}` for gene name,
q-value and correlation, respectively.
Expand Down Expand Up @@ -1122,10 +1122,10 @@ def fit(
None
Nothing, just makes available the following fields:
- :paramref:`{fsp}`
- :paramref:`{fs}`
- :paramref:`{ap}`
- :paramref:`{pd}`
- :attr:`{fsp}`
- :attr:`{fs}`
- :attr:`{ap}`
- :attr:`{pd}`
"""
self._fit_terminal_states(**kwargs)
if compute_absorption_probabilities:
Expand Down Expand Up @@ -1168,7 +1168,7 @@ def _set_or_debug(
logg.debug(f"Unable to set attribute `.{attr}`, skipping")

def copy(self) -> "BaseEstimator":
"""Return a copy of self, including the underlying :paramref:`adata` object."""
"""Return a copy of self, including the underlying :attr:`adata` object."""
k = deepcopy(self.kernel) # ensure we copy the adata object
res = type(self)(k, read_from_adata=False)
for k, v in self.__dict__.items():
Expand Down
14 changes: 7 additions & 7 deletions cellrank/tl/estimators/_cflare.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def compute_terminal_states(
method
Method to be used for clustering. Must be one of `'louvain'`, `'leiden'` or `'kmeans'`.
cluster_key
If a key to cluster labels is given, :paramref:`{fs}` will get associated with these for naming and colors.
If a key to cluster labels is given, :attr:`{fs}` will get associated with these for naming and colors.
n_clusters_kmeans
If `None`, this is set to ``use + 1``.
n_neighbors
Expand All @@ -94,8 +94,8 @@ def compute_terminal_states(
None
Nothing, but updates the following fields:
- :paramref:`{fsp}`
- :paramref:`{fs}`
- :attr:`{fsp}`
- :attr:`{fs}`
"""

def _compute_macrostates_prob() -> Series:
Expand Down Expand Up @@ -301,10 +301,10 @@ def fit(
None
Nothing, just makes available the following fields:
- :paramref:`{fsp}`
- :paramref:`{fs}`
- :paramref:`{ap}`
- :paramref:`{pd}`
- :attr:`{fsp}`
- :attr:`{fs}`
- :attr:`{ap}`
- :attr:`{pd}`
"""
super().fit(
n_lineages=n_lineages,
Expand Down
8 changes: 4 additions & 4 deletions cellrank/tl/estimators/_decomposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def compute_eigendecomposition(
None
Nothing, but updates the following field:
- :paramref:`{prop}`
- :attr:`{prop}`
"""

def get_top_k_evals():
Expand Down Expand Up @@ -431,9 +431,9 @@ def compute_schur(
None
Nothing, but updates the following fields:
- :paramref:`{schur_vectors}`
- :paramref:`{schur_matrix}`
- :paramref:`{eigendec}`
- :attr:`{schur_vectors}`
- :attr:`{schur_matrix}`
- :attr:`{eigendec}`
"""
if n_components < 2:
raise ValueError(
Expand Down
40 changes: 20 additions & 20 deletions cellrank/tl/estimators/_gpcca.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ def compute_macrostates(
None
Nothing, but updates the following fields:
- :paramref:`{msp}`
- :paramref:`{ms}`
- :paramref:`{schur}`
- :paramref:`{coarse_T}`
- :paramref:`{coarse_stat}`
- :attr:`{msp}`
- :attr:`{ms}`
- :attr:`{schur}`
- :attr:`{coarse_T}`
- :attr:`{coarse_stat}`
"""

was_from_eigengap = False
Expand Down Expand Up @@ -261,8 +261,8 @@ def set_terminal_states_from_macrostates(
None
Nothing, just updates the following fields:
- :paramref:`{fsp}`
- :paramref:`{fs}`
- :attr:`{fsp}`
- :attr:`{fs}`
"""

if not isinstance(n_cells, int):
Expand Down Expand Up @@ -383,8 +383,8 @@ def compute_terminal_states(
None
Nothing, just updates the following fields:
- :paramref:`{fsp}`
- :paramref:`{fs}`
- :attr:`{fsp}`
- :attr:`{fs}`
"""

if len(self._get(P.MACRO).cat.categories) == 1:
Expand Down Expand Up @@ -444,14 +444,14 @@ def compute_gdpt(
n_components
Number of real Schur vectors to consider.
key_added
Key in :paramref:`adata` ``.obs`` where to save the pseudotime.
Key in :attr:`adata` ``.obs`` where to save the pseudotime.
kwargs
Keyword arguments for :meth:`cellrank.tl.GPCCA.compute_schur` if Schur decomposition is not found.
Returns
-------
None
Nothing, just updates :paramref:`adata` ``.obs[key_added]`` with the computed pseudotime.
Nothing, just updates :attr:`adata` ``.obs[key_added]`` with the computed pseudotime.
"""

def _get_dpt_row(e_vals: np.ndarray, e_vecs: np.ndarray, i: int):
Expand Down Expand Up @@ -870,13 +870,13 @@ def _set_macrostates(
Fuzzy clustering.
%(n_cells)s
cluster_key
Key from :paramref:`adata` ``.obs`` to get reference cluster annotations.
Key from :attr:`adata` ``.obs`` to get reference cluster annotations.
en_cutoff
Threshold to decide when we we want to warn the user about an uncertain name mapping. This happens when
one fuzzy state overlaps with several reference clusters, and the most likely cells are distributed almost
evenly across the reference clusters.
p_thresh
Only used to detect cell cycle stages. These have to be present in :paramref:`adata` ``.obs`` as
Only used to detect cell cycle stages. These have to be present in :attr:`adata` ``.obs`` as
`'G2M_score'` and `'S_score'`.
check_row_sums
Check whether rows in `memberships` sum to `1`.
Expand Down Expand Up @@ -1071,12 +1071,12 @@ def fit(
None
Nothing, just makes available the following fields:
- :paramref:`{msp}`
- :paramref:`{ms}`
- :paramref:`{fsp}`
- :paramref:`{fs}`
- :paramref:`{ap}`
- :paramref:`{pd}`
- :attr:`{msp}`
- :attr:`{ms}`
- :attr:`{fsp}`
- :attr:`{fs}`
- :attr:`{ap}`
- :attr:`{pd}`
"""

super().fit(
Expand Down Expand Up @@ -1157,7 +1157,7 @@ def _set_initial_states_from_macrostates(
Returns
-------
None
Nothing, just writes to :paramref:`adata`:
Nothing, just writes to :attr:`adata`:
- ``.obs[{key!r}]`` - probability of being an initial state.
- ``.obs[{probs_key!r}]`` - top ``n_cells`` from each initial state.
Expand Down
14 changes: 7 additions & 7 deletions cellrank/tl/estimators/_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def _plot_vectors(
abs_value
Whether to take the absolute value before plotting.
cluster_key
Key in :paramref:`adata` ``.obs`` for plotting categorical observations.
Key in :attr:`adata` ``.obs`` for plotting categorical observations.
%(basis)s
kwargs
Keyword arguments for :func:`scvelo.pl.scatter`.
Expand Down Expand Up @@ -409,7 +409,7 @@ def _plot_discrete(
lineages
Plot only these lineages. If `None`, plot all lineages.
cluster_key
Key from :paramref:`adata` ``.obs`` for plotting categorical observations.
Key from :attr:`adata` ``.obs`` for plotting categorical observations.
same_plot
Whether to plot the lineages on the same plot or separately.
title
Expand Down Expand Up @@ -543,10 +543,10 @@ def _plot_continuous(
lineages
Plot only these lineages. If `None`, plot all lineages.
cluster_key
Key from :paramref:`adata` ``.obs`` for plotting categorical observations.
Key from :attr:`adata` ``.obs`` for plotting categorical observations.
%(time_mode)s
time_key
Key from :paramref:`adata` ``.obs`` to use as a pseudotime ordering of the cells.
Key from :attr:`adata` ``.obs`` to use as a pseudotime ordering of the cells.
title
Either `None`, in which case titles are ``'{to,from} {terminal,initial} {state}'``,
or an array of titles, one per lineage.
Expand Down Expand Up @@ -873,9 +873,9 @@ def compute_partition(self) -> None:
None
Nothing, but updates the following fields:
- :paramref:`recurrent_classes`
- :paramref:`transient_classes`
- :paramref:`is_irreducible`
- :attr:`recurrent_classes`
- :attr:`transient_classes`
- :attr:`is_irreducible`
"""

start = logg.info("Computing communication classes")
Expand Down
Loading

0 comments on commit d32cc2b

Please sign in to comment.