Skip to content

Commit

Permalink
Automated template update from cookiecutter-scverse (#61)
Browse files Browse the repository at this point in the history
* Update sync.yaml

* Automated template update from cookiecutter-scverse

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix merge conflicts

* Fix merge conflict

Co-authored-by: Gregor Sturm <[email protected]>
Co-authored-by: grst <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Gregor Sturm <[email protected]>
  • Loading branch information
5 people authored Oct 19, 2022
1 parent 008f8ae commit bab74f1
Show file tree
Hide file tree
Showing 13 changed files with 299 additions and 33 deletions.
9 changes: 6 additions & 3 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/scverse/cookiecutter-scverse",
"commit": "8148f720e622a82345bfc18b74b2bd288d12f7d5",
"commit": "28f47a97470826ca5000df24fd272e0d32d1c6fa",
"context": {
"cookiecutter": {
"project_name": "infercnvpy",
Expand All @@ -11,10 +11,13 @@
"github_user": "grst",
"project_repo": "https://github.com/icbi-lab/infercnvpy",
"license": "BSD 3-Clause License",
"_copy_without_render": [".github/workflows/**.yaml"],
"_copy_without_render": [
".github/workflows/**.yaml",
"docs/_templates/autosummary/**.rst"
],
"_template": "https://github.com/scverse/cookiecutter-scverse"
}
},
"directory": null,
"checkout": "v0.0.2"
"checkout": "v0.0.3"
}
16 changes: 7 additions & 9 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,28 @@ ignore =
E501
# whitespace before : -> black does not adhere to PEP8
E203
# line break before binary operator -> black does not adhere to PEP8
W503
# missing whitespace after ,', ';', or ':' -> black does not adhere to PEP8
E231
# continuation line over-indented for hanging indent -> black does not adhere to PEP8
E126
# E266 too many leading '#' for block comment -> this is fine for indicating sections
# too many leading '#' for block comment -> this is fine for indicating sections
E262
# Do not assign a lambda expression, use a def -> lambda expression assignments are convenient
E731
# allow I, O, l as variable names -> I is the identity matrix, i, j, k, l is reasonable indexing notation
# allow I, O, l as variable names -> I is the identity matrix
E741
# Missing docstring in public package
D104
# ... imported but unused
F401
# Missing docstring in public module
D100
# Missing docstring in __init__
D107
# Do not perform function calls in argument defaults.
# Errors from function calls in argument defaults. These are fine when the result is immutable.
B008
# line break before binary operator
W503
# Missing docstring in magic method
D105
# whitespace before ':'
E203
# format string does contain unindexed parameters
P101
# first line should end with a period [Bug: doesn't work with single-line docstrings]
Expand All @@ -58,6 +54,8 @@ rst-roles =
class,
func,
ref,
cite:p,
cite:t,
rst-directives =
envvar,
exception,
Expand Down
89 changes: 89 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Bug report
description: Report something that is broken or incorrect
labels: bug
body:
- type: markdown
attributes:
value: |
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports)
detailing how to provide the necessary information for us to reproduce your bug. In brief:
* Please provide exact steps how to reproduce the bug in a clean Python environment.
* In case it's not clear what's causing this bug, please provide the data or the data generation procecure.
* Sometimes it is not possible to share the data but usually it is possible to replicate problems on publicly
available datasets or to share a subset of your data.
- type: textarea
id: report
attributes:
label: Report
description: A clear and concise description of what the bug is.
validations:
required: true

- type: textarea
id: versions
attributes:
label: Version information
description: |
Please paste below the output of
```python
import session_info
session_info.show(html=False, dependencies=True)
```
placeholder: |
-----
anndata 0.8.0rc2.dev27+ge524389
session_info 1.0.0
-----
asttokens NA
awkward 1.8.0
backcall 0.2.0
cython_runtime NA
dateutil 2.8.2
debugpy 1.6.0
decorator 5.1.1
entrypoints 0.4
executing 0.8.3
h5py 3.7.0
ipykernel 6.15.0
jedi 0.18.1
mpl_toolkits NA
natsort 8.1.0
numpy 1.22.4
packaging 21.3
pandas 1.4.2
parso 0.8.3
pexpect 4.8.0
pickleshare 0.7.5
pkg_resources NA
prompt_toolkit 3.0.29
psutil 5.9.1
ptyprocess 0.7.0
pure_eval 0.2.2
pydev_ipython NA
pydevconsole NA
pydevd 2.8.0
pydevd_file_utils NA
pydevd_plugins NA
pydevd_tracing NA
pygments 2.12.0
pytz 2022.1
scipy 1.8.1
setuptools 62.5.0
setuptools_scm NA
six 1.16.0
stack_data 0.3.0
tornado 6.1
traitlets 5.3.0
wcwidth 0.2.5
zmq 23.1.0
-----
IPython 8.4.0
jupyter_client 7.3.4
jupyter_core 4.10.0
-----
Python 3.9.13 | packaged by conda-forge | (main, May 27 2022, 16:58:50) [GCC 10.3.0]
Linux-5.18.6-arch1-1-x86_64-with-glibc2.35
-----
Session information updated at 2022-07-07 17:55
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Scverse Community Forum
url: https://discourse.scverse.org/
about: If you have questions about “How to do X”, please ask them here.
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Feature request
description: Propose a new feature for infercnvpy
labels: enhancement
body:
- type: textarea
id: description
attributes:
label: Description of feature
description: Please describe your suggestion for a new feature. It might help to describe a problem or use case, plus any alternatives that you have considered.
validations:
required: true
1 change: 1 addition & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ build:
python: "3.10"
sphinx:
configuration: docs/conf.py
# disable this for more lenient docs builds
fail_on_warning: true
python:
install:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Please refer to the [documentation][link-docs]. In particular, the
## Installation

You need to have Python 3.8 or newer installed on your system. If you don't have
Python installed, we recommend installing [Miniconda](https://docs.conda.io/en/latest/miniconda.html).
Python installed, we recommend installing [Mambaforge](https://github.com/conda-forge/miniforge#mambaforge).

There are several alternative options to install infercnvpy:

Expand Down
65 changes: 65 additions & 0 deletions docs/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

.. add toctree option to make autodoc generate the pages
.. autoclass:: {{ objname }}

{% block attributes %}
{% if attributes %}
Attributes table
~~~~~~~~~~~~~~~~~~

.. autosummary::
{% for item in attributes %}
~{{ fullname }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block methods %}
{% if methods %}
Methods table
~~~~~~~~~~~~~

.. autosummary::
{% for item in methods %}
{%- if item != '__init__' %}
~{{ fullname }}.{{ item }}
{%- endif -%}
{%- endfor %}
{% endif %}
{% endblock %}

{% block attributes_documentation %}
{% if attributes %}
Attributes
~~~~~~~~~~~

{% for item in attributes %}
{{ item }}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. autoattribute:: {{ [objname, item] | join(".") }}
{%- endfor %}

{% endif %}
{% endblock %}

{% block methods_documentation %}
{% if methods %}
Methods
~~~~~~~

{% for item in methods %}
{%- if item != '__init__' %}
{{ item }}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. automethod:: {{ [objname, item] | join(".") }}
{%- endif -%}
{%- endfor %}

{% endif %}
{% endblock %}
39 changes: 32 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
# -- Project information -----------------------------------------------------

info = metadata("infercnvpy")
project = info["Name"]
project_name = info["Name"]
author = info["Author"]
copyright = f"{datetime.now():%Y}, {author}."
version = info["Version"]
repository_url = "https://github.com/" + "grst" + "/" + project_name

# The full version, including alpha/beta/rc tags
release = info["Version"]
Expand All @@ -33,7 +34,7 @@
html_context = {
"display_github": True, # Integrate GitHub
"github_user": "icbi-lab", # Username
"github_repo": project, # Repo name
"github_repo": project_name, # Repo name
"github_version": "main", # Version
"conf_py_path": "/docs/", # Path in the checkout to the docs root
}
Expand All @@ -43,15 +44,14 @@
# Add any Sphinx extension module names here, as strings.
# They can be extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
"myst_parser",
"myst_nb",
"sphinx_copybutton",
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
"sphinxcontrib.bibtex",
"sphinx_autodoc_typehints",
"scanpydoc.definition_list_typed_field",
"nbsphinx",
"sphinx.ext.mathjax",
*[p.stem for p in (HERE / "extensions").glob("*.py")],
]
Expand All @@ -65,6 +65,25 @@
napoleon_use_rtype = True # having a separate entry generally helps readability
napoleon_use_param = True
myst_heading_anchors = 3 # create anchors for h1-h3
myst_enable_extensions = [
"amsmath",
"colon_fence",
"deflist",
"dollarmath",
"html_image",
"html_admonition",
]
myst_url_schemes = ("http", "https", "mailto")
nb_output_stderr = "remove"
nb_execution_mode = "off"
nb_merge_streams = True
typehints_defaults = "braces"

source_suffix = {
".rst": "restructuredtext",
".ipynb": "myst-nb",
".myst": "myst-nb",
}

intersphinx_mapping = {
"scanpy": ("https://scanpy.readthedocs.io/en/stable/", None),
Expand Down Expand Up @@ -95,10 +114,16 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "furo"
html_theme = "sphinx_book_theme"
html_static_path = ["_static"]
html_title = project_name

html_theme_options = {
"repository_url": repository_url,
"use_repository_button": True,
}

pygments_style = "sphinx"
pygments_style = "default"

nitpick_ignore = [
# If building the documentation fails because of a missing link that is outside your control,
Expand Down
Loading

0 comments on commit bab74f1

Please sign in to comment.