Skip to content

Commit 6b61152

Browse files
authored
Merge pull request #47 from KrishnaswamyLab/dev
graphtools v1.4.0
2 parents 275c104 + 0c884ce commit 6b61152

File tree

20 files changed

+2003
-1348
lines changed

20 files changed

+2003
-1348
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
script:
1919
- pip install -U .[test]
20+
- if [ "$TRAVIS_PYTHON_VERSION" != "3.5" ]; then black . --check --diff; fi
2021
- python setup.py test
2122
- pip install -U .[doc]
2223
- cd doc; make html

CONTRIBUTING.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
Contributing to graphtools
3+
============================
4+
5+
There are many ways to contribute to `graphtools`, with the most common ones
6+
being contribution of code or documentation to the project. Improving the
7+
documentation is no less important than improving the library itself. If you
8+
find a typo in the documentation, or have made improvements, do not hesitate to
9+
submit a GitHub pull request.
10+
11+
But there are many other ways to help. In particular answering queries on the
12+
[issue tracker](https://github.com/KrishnaswamyLab/graphtools/issues),
13+
investigating bugs, and [reviewing other developers' pull
14+
requests](https://github.com/KrishnaswamyLab/graphtools/pulls)
15+
are very valuable contributions that decrease the burden on the project
16+
maintainers.
17+
18+
Another way to contribute is to report issues you're facing, and give a "thumbs
19+
up" on issues that others reported and that are relevant to you. It also helps
20+
us if you spread the word: reference the project from your blog and articles,
21+
link to it from your website, or simply star it in GitHub to say "I use it".
22+
23+
Code Style and Testing
24+
----------------------
25+
26+
`graphtools` is maintained at close to 100% code coverage. Contributors are encouraged to write tests for their code, but if you do not know how to do so, please do not feel discouraged from contributing code! Others can always help you test your contribution.
27+
28+
Code style is dictated by [`black`](https://pypi.org/project/black/#installation-and-usage). To automatically reformat your code when you run `git commit`, you can run `./autoblack.sh` in the root directory of this project to add a hook to your `git` repository.
29+
30+
Code of Conduct
31+
---------------
32+
33+
We abide by the principles of openness, respect, and consideration of others
34+
of the Python Software Foundation: https://www.python.org/psf/codeofconduct/.
35+
36+
Attribution
37+
---------------
38+
39+
This `CONTRIBUTING.md` was adapted from [scikit-learn](https://github.com/scikit-learn/scikit-learn/blob/master/CONTRIBUTING.md).

README.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ graphtools
2323
.. image:: https://img.shields.io/github/stars/KrishnaswamyLab/graphtools.svg?style=social&label=Stars
2424
:target: https://github.com/KrishnaswamyLab/graphtools/
2525
:alt: GitHub stars
26+
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
27+
:target: https://github.com/psf/black
28+
:alt: Code style: black
2629

2730
Tools for building and manipulating graphs in Python.
2831

autoblack.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
cat <<EOF >> .git/hooks/pre-commit
2+
#!/bin/sh
3+
4+
set -e
5+
6+
files=\$(git diff --staged --name-only --diff-filter=d -- "*.py")
7+
8+
for file in \$files; do
9+
black -q \$file
10+
git add \$file
11+
done
12+
EOF
13+
chmod +x .git/hooks/pre-commit
14+

doc/source/conf.py

Lines changed: 44 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
#
2020
import os
2121
import sys
22-
sys.path.insert(0, os.path.abspath('../..'))
22+
23+
root_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
24+
sys.path.insert(0, root_dir)
2325
# print(sys.path)
2426

2527
# -- General configuration ------------------------------------------------
@@ -31,40 +33,43 @@
3133
# Add any Sphinx extension module names here, as strings. They can be
3234
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3335
# ones.
34-
extensions = ['sphinx.ext.autodoc',
35-
'sphinx.ext.autosummary',
36-
'sphinx.ext.napoleon',
37-
'sphinx.ext.doctest',
38-
'sphinx.ext.coverage',
39-
'sphinx.ext.mathjax',
40-
'sphinx.ext.viewcode',
41-
'sphinxcontrib.bibtex']
36+
extensions = [
37+
"sphinx.ext.autodoc",
38+
"sphinx.ext.autosummary",
39+
"sphinx.ext.napoleon",
40+
"sphinx.ext.doctest",
41+
"sphinx.ext.coverage",
42+
"sphinx.ext.mathjax",
43+
"sphinx.ext.viewcode",
44+
"sphinxcontrib.bibtex",
45+
]
4246

4347
# Add any paths that contain templates here, relative to this directory.
44-
templates_path = ['ytemplates']
48+
templates_path = ["ytemplates"]
4549

4650
# The suffix(es) of source filenames.
4751
# You can specify multiple suffix as a list of string:
4852
#
4953
# source_suffix = ['.rst', '.md']
50-
source_suffix = '.rst'
54+
source_suffix = ".rst"
5155

5256
# The master toctree document.
53-
master_doc = 'index'
57+
master_doc = "index"
5458

5559
# General information about the project.
56-
project = 'graphtools'
57-
copyright = '2018 Krishnaswamy Lab, Yale University'
58-
author = 'Jay Stanley and Scott Gigante, Krishnaswamy Lab, Yale University'
60+
project = "graphtools"
61+
copyright = "2018 Krishnaswamy Lab, Yale University"
62+
author = "Scott Gigante and Jay Stanley, Yale University"
5963

6064
# The version info for the project you're documenting, acts as replacement for
6165
# |version| and |release|, also used in various other places throughout the
6266
# built documents.
6367
#
64-
# The short X.Y version.
65-
version = '0.1.3'
68+
version_py = os.path.join(root_dir, "graphtools", "version.py")
6669
# The full version, including alpha/beta/rc tags.
67-
release = '0.1.3'
70+
release = open(version_py).read().strip().split("=")[-1].replace('"', "").strip()
71+
# The short X.Y version.
72+
version = release.split("-")[0]
6873

6974
# The language for content autogenerated by Sphinx. Refer to documentation
7075
# for a list of supported languages.
@@ -79,7 +84,7 @@
7984
exclude_patterns = []
8085

8186
# The name of the Pygments (syntax highlighting) style to use.
82-
pygments_style = 'sphinx'
87+
pygments_style = "sphinx"
8388

8489
# If true, `todo` and `todoList` produce output, else they produce nothing.
8590
todo_include_todos = False
@@ -90,7 +95,7 @@
9095
# The theme to use for HTML and HTML Help pages. See the documentation for
9196
# a list of builtin themes.
9297
#
93-
html_theme = 'default'
98+
html_theme = "default"
9499

95100
# Theme options are theme-specific and customize the look and feel of a theme
96101
# further. For a list of options available for each theme, see the
@@ -101,13 +106,13 @@
101106
# Add any paths that contain custom static files (such as style sheets) here,
102107
# relative to this directory. They are copied after the builtin static files,
103108
# so a file named "default.css" will overwrite the builtin "default.css".
104-
html_static_path = ['ystatic']
109+
html_static_path = ["ystatic"]
105110

106111

107112
# -- Options for HTMLHelp output ------------------------------------------
108113

109114
# Output file base name for HTML help builder.
110-
htmlhelp_basename = 'graphtoolsdoc'
115+
htmlhelp_basename = "graphtoolsdoc"
111116

112117

113118
# -- Options for LaTeX output ---------------------------------------------
@@ -116,15 +121,12 @@
116121
# The paper size ('letterpaper' or 'a4paper').
117122
#
118123
# 'papersize': 'letterpaper',
119-
120124
# The font size ('10pt', '11pt' or '12pt').
121125
#
122126
# 'pointsize': '10pt',
123-
124127
# Additional stuff for the LaTeX preamble.
125128
#
126129
# 'preamble': '',
127-
128130
# Latex figure (float) alignment
129131
#
130132
# 'figure_align': 'htbp',
@@ -134,19 +136,21 @@
134136
# (source start file, target name, title,
135137
# author, documentclass [howto, manual, or own class]).
136138
latex_documents = [
137-
(master_doc, 'graphtools.tex', 'graphtools Documentation',
138-
'Jay Stanley and Scott Gigante, Krishnaswamy Lab, Yale University', 'manual'),
139+
(
140+
master_doc,
141+
"graphtools.tex",
142+
"graphtools Documentation",
143+
"Scott Gigante and Jay Stanley, Yale University",
144+
"manual",
145+
),
139146
]
140147

141148

142149
# -- Options for manual page output ---------------------------------------
143150

144151
# One entry per manual page. List of tuples
145152
# (source start file, name, description, authors, manual section).
146-
man_pages = [
147-
(master_doc, 'graphtools', 'graphtools Documentation',
148-
[author], 1)
149-
]
153+
man_pages = [(master_doc, "graphtools", "graphtools Documentation", [author], 1)]
150154

151155

152156
# -- Options for Texinfo output -------------------------------------------
@@ -155,7 +159,13 @@
155159
# (source start file, target name, title, author,
156160
# dir menu entry, description, category)
157161
texinfo_documents = [
158-
(master_doc, 'graphtools', 'graphtools Documentation',
159-
author, 'graphtools', 'One line description of project.',
160-
'Miscellaneous'),
162+
(
163+
master_doc,
164+
"graphtools",
165+
"graphtools Documentation",
166+
author,
167+
"graphtools",
168+
"One line description of project.",
169+
"Miscellaneous",
170+
),
161171
]

doc/source/index.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ graphtools
3030

3131
<a href="https://github.com/KrishnaswamyLab/graphtools/"><img src="https://img.shields.io/github/stars/KrishnaswamyLab/graphtools.svg?style=social&label=Stars" alt="GitHub stars"></a>
3232

33+
.. raw:: html
34+
35+
<a href="https://github.com/psf/black/"><img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black"></a>
36+
3337
Tools for building and manipulating graphs in Python.
3438

3539
.. toctree::
@@ -65,4 +69,4 @@ To use `graphtools` with `pygsp`, create a `graphtools.Graph` class with `use_py
6569
Help
6670
====
6771

68-
If you have any questions or require assistance using graphtools, please contact us at https://krishnaswamylab.org/get-help
72+
If you have any questions or require assistance using graphtools, please contact us at https://krishnaswamylab.org/get-help

0 commit comments

Comments
 (0)