Skip to content

Commit

Permalink
update from master, testing actions docs
Browse files Browse the repository at this point in the history
  • Loading branch information
62442katieb committed Nov 29, 2022
2 parents b654cd4 + 3f5acac commit d152666
Show file tree
Hide file tree
Showing 21 changed files with 698 additions and 138 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: "Lint Code"

on:
push:
branches:
- "master"
pull_request:
branches:
- '*'

concurrency:
group: linting-${{ github.ref }}
cancel-in-progress: true

jobs:
# Determine if tests should be run based on commit message.
check_skip:
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.result_step.outputs.ci-skip }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- id: result_step
uses: mstachniuk/ci-skip@master
with:
commit-filter: '[skip ci];[ci skip];[skip github]'
commit-filter-separator: ';'

style_check:
needs: check_skip
if: ${{ needs.check_skip.outputs.skip == 'false' }}
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.7"]
name: Style check
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- name: 'Set up python'
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: 'Install IDConn'
shell: bash {0}
run: pip install -e .[tests]
- name: 'Run linter'
shell: bash {0}
run: flake8 idconn
31 changes: 31 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [published]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
76 changes: 76 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: "Run Tests"

on:
push:
branches:
- "master"
pull_request:
branches:
- '*'

concurrency:
group: testing-${{ github.ref }}
cancel-in-progress: true

jobs:
# Determine if tests should be run based on commit message.
check_skip:
name: Determine if CI should be skipped
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.result_step.outputs.ci-skip }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- id: result_step
uses: mstachniuk/ci-skip@master
with:
commit-filter: '[skip ci];[ci skip];[skip github]'
commit-filter-separator: ';'

run_unit_tests:
name: Unit tests
needs: check_skip
if: ${{ needs.check_skip.outputs.skip == 'false' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest"]
python-version: ["3.7", "3.8", "3.9", "3.10"]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- name: 'Set up python'
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: 'Install IDConn'
shell: bash {0}
run: pip install -e .[tests]
- name: 'Run tests'
shell: bash {0}
run: py.test --cov-append --cov-report=xml --cov=idconn idconn
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: unit_${{ matrix.os }}_${{ matrix.python-version }}
path: coverage.xml
if: success()

upload_to_codecov:
name: Upload coverage
needs: [run_unit_tests]
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v2
- name: Upload to CodeCov
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
docs/auto_examples/
*.ipynb_checkpoints/*
bad-qa.png
cp-corrmats.sh
Expand Down
19 changes: 19 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

python:
version: 3.8
install:
- method: pip
path: .
extra_requirements:
- doc
system_packages: true
15 changes: 12 additions & 3 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,23 @@
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= /Users/kbottenh/Library/Python/3.7/bin/sphinx-build
SOURCEDIR = source
BUILDDIR = build
SPHINXBUILD ?= python -msphinx
SPHINXPROJ = IDConn
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

clean:
rm -r _build generated auto_examples

html-noplot:
$(SPHINXBUILD) -D plot_gallery=0 -b html $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
Expand Down
File renamed without changes
File renamed without changes
41 changes: 41 additions & 0 deletions docs/_templates/class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
:mod:`{{module}}`.{{objname}}
{{ underline }}==============

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:members:
:inherited-members:
:show-inheritance:

{% block methods %}
{% if methods %}
.. rubric:: Methods

.. autosummary::

{% for item in methods %}
{%- if not item.startswith('_') or item in ['__call__'] %} ~{{ name }}.{{ item }}
{% endif %}
{%- endfor %}
{% endif %}
{% endblock %}

{% block attributes %}
{% if attributes %}
.. rubric:: Properties

.. autosummary::

{% for item in attributes %}
{%- if not item.startswith('_') or item in ['__call__'] %} ~{{ name }}.{{ item }}
{% endif %}
{%- endfor %}
{% endif %}
{% endblock %}

.. include:: {{fullname}}.examples

.. raw:: html

<div class="clearer"></div>
12 changes: 12 additions & 0 deletions docs/_templates/function.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
:mod:`{{module}}`.{{objname}}
{{ underline }}====================

.. currentmodule:: {{ module }}

.. autofunction:: {{ objname }}

.. include:: {{fullname}}.{{item}}examples

.. raw:: html

<div class='clearer'></div>
42 changes: 42 additions & 0 deletions docs/_templates/module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{{ fullname }}
{{ underline }}

.. automodule:: {{ fullname }}

{% block classes %}
{% if classes %}
.. rubric:: Classes

.. autosummary::
:toctree:
:template: class.rst
{% for item in classes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block functions %}
{% if functions %}
.. rubric:: Functions

.. autosummary::
:toctree:
:template: function.rst
{% for item in functions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block exceptions %}
{% if exceptions %}
.. rubric:: Exceptions

.. autosummary::
:toctree:
{% for item in exceptions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
73 changes: 73 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
API
===

.. _api_pipeline_ref:

:mod:`idconn.pipeline`: The main IDConn pipeline
--------------------------------------------------

.. automodule:: idconn.pipeline
:no-members:
:no-inherited-members:

.. currentmodule:: idconn

.. autosummary::
:toctree: generated/
:template: function.rst

pipeline.idconn_workflow

.. _api_connectivity_ref:

:mod:`idconn.connectivity`: Tools for computing connectivity matrices/graphs
----------------------------------------------------------------------------

.. automodule:: idconn.connectivity
:no-members:
:no-inherited-members:

.. currentmodule:: idconn

.. autosummary::
:toctree: generated/
:template: module.rst

connectivity.build_networks
connectivity.estimate_thresh

.. _api_data_ref:

:mod:`idconn.data`: Tools for arranging data and addressing missing data
------------------------------------------------------------------------

.. automodule:: idconn.data
:no-members:
:no-inherited-members:

.. currentmodule:: idconn

.. autosummary::
:toctree: generated/
:template: module.rst

data.iterative_imputation
data.missingness

.. _api_networking_ref:

:mod:`idconn.networking`: Tools for computing network topology / graph theoretic measures
-----------------------------------------------------------------------------------------

.. automodule:: idconn.networking
:no-members:
:no-inherited-members:

.. currentmodule:: idconn

.. autosummary::
:toctree: generated/
:template: module.rst

networking.graph_theory
networking.null_distribution
Loading

0 comments on commit d152666

Please sign in to comment.