-
Notifications
You must be signed in to change notification settings - Fork 6
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
Avoid error in multipledispatch #12
Conversation
It's not throwing an error, but it does throw a number of warnings. This happens a lot with the doc build process, so I'm not sure how important this is. Definitely important, there's a few formatting issues, here's a screenshot of the build docs: Most obviously:
Here's the docstrings that generated this: Docstrings
Here's the output from building the docs where only Build output
I think the relevant lines are:
|
Ugh, that That docstring is buggy:
|
With correct formatting for the math equation, it just doesn't show up:
Multiply dispatched method: gearys_c
Inputs: <spmatrix, ndarray>
----------------------------
Params
------
g
Connectivity graph as a scipy sparse matrix. Should have shape:
`(n_obs, n_obs)`.
vals
Values to calculate Geary's C for. If one dimensional, should have
shape `(n_obs,)`. If two dimensional (i.e calculating Geary's C for
multiple variables) should have shape `(n_vars, n_obs)`.
Inputs: <AnnData>
------------------
Calculate `Geary's C`_ , as used by
`VISION <https://doi.org/10.1038/s41467-019-12235-0>`_.
Geary's C is a measure of autocorrelation for some measure on a graph. This
can be to whether measures are correlated between neighboring cells. Lower
values indicate greater correlation.
.. math
C =
\frac{
(N - 1)\sum_{i,j} w_{i,j} (x_i - x_j)^2
}{
2W \sum_i (x_i - \bar{x})^2
}
Params
------
adata
vals
Values to calculate Geary's C for. If this is two dimensional, should
be of shape `(n_features, n_cells)`. Otherwise should be of shape
`(n_cells,)`. This matrix can be selected from elements of the anndata
object by using key word arguments: `layer`, `obsm`, `obsp`, or
`use_raw`.
use_graph
Key to use for graph in anndata object. If not provided, default
neighbors connectivities will be used instead.
layer
Key for `adata.layers` to choose `vals`.
obsm
Key for `adata.obsm` to choose `vals`.
obsp
Key for `adata.obsp` to choose `vals`.
use_raw
Whether to use `adata.raw.X` for `vals`.
Returns
-------
If vals is two dimensional, returns a 1 dimensional ndarray array. Returns
a scalar if `vals` is 1d.
.. _Geary's C: https://en.wikipedia.org/wiki/Geary's_C
Other signatures:
spmatrix, spmatrix
csr_matrix, csr_matrix
spmatrix, DataFrame
spmatrix, Series |
Still not correct, it’s But yes, the way they paste together the docstrings seems buggy. The first section including the underline is indented too much. Just one of the “Params” sections seems to be converted to a “Parameters” section… I guess without proper support through a sphinx extension, we won’t be happy with this. So what you could do is
|
Helps avoid a problem in scverse/scanpy#915