Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sztal committed Mar 4, 2022
0 parents commit 0246b14
Show file tree
Hide file tree
Showing 79 changed files with 16,091 additions and 0 deletions.
114 changes: 114 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Sandbox folders
_sandbox/**
_notebooks/**

# IDEs
.vscode

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports / benchmarks / profiling
prof/
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
.benchmarks

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

# virtualenv
.venv
venv/
ENV/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# VIM
**/*.swp
10 changes: 10 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Authors
-------

**Development Lead**

* Szymon Talaga <[email protected]>

**Contributors**

None yet. Why not be the first?
111 changes: 111 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
============
Contributing
============

Contributions are welcome, and they are greatly appreciated! Every
little bit helps, and credit will always be given.

You can contribute in many ways:

Types of Contributions
----------------------

Report Bugs
~~~~~~~~~~~

Report bugs at https://github.com/sztal/pathcensus/issues.

If you are reporting a bug, please include:

* Your operating system name and version.
* Any details about your local setup that might be helpful in troubleshooting.
* Detailed steps to reproduce the bug.

Fix Bugs
~~~~~~~~

Look through the GitHub issues for bugs. Anything tagged with "bug"
is open to whoever wants to implement it.

Implement Features
~~~~~~~~~~~~~~~~~~

Look through the GitHub issues for features. Anything tagged with "feature"
is open to whoever wants to implement it.

Write Documentation
~~~~~~~~~~~~~~~~~~~

Path census could always use more documentation, whether as part of the
official Path census docs, in docstrings, or even on the web in blog posts,
articles, and such.

Submit Feedback
~~~~~~~~~~~~~~~

The best way to send feedback is to file an issue at https://github.com/sztal/pathcensus/issues.

If you are proposing a feature:

* Explain in detail how it would work.
* Keep the scope as narrow as possible, to make it easier to implement.
* Remember that this is a volunteer-driven project, and that contributions
are welcome :)

Get Started!
------------

Ready to contribute? Here's how to set up `pathcensus` for
local development.

1. Fork_ the `pathcensus` repo on GitHub.
2. Clone your fork locally::

$ git clone [email protected]:your_name_here/pathcensus.git

3. Create a branch for local development::

$ git checkout -b name-of-your-bugfix-or-feature

Now you can make your changes locally.

4. When you're done making changes, check that your changes pass style and unit
tests, including testing other Python versions with tox::

$ make test-all

You may first need to run ``pip install -r requirements-tests.txt``
and then ``pip install tox``.

5. Commit your changes and push your branch to GitHub::

$ git add .
$ git commit -m "Your detailed description of your changes."
$ git push origin name-of-your-bugfix-or-feature

6. Submit a pull request through the GitHub website.

.. _Fork: https://github.com/sztal/pathcensus/fork

Pull Request Guidelines
-----------------------

Before you submit a pull request, check that it meets these guidelines:

1. The pull request should include tests.
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
3. The pull request should work for Python 3.8+
and must pass all tests when running ``make test-all``.


Tips
----

To run a subset of tests::

$ pytest test/unweighted/test_pathcensus.py

This will run all tests for the unweighted calculations of path census
and structural coefficients.
9 changes: 9 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. :changelog:
History
-------

0.1 (2022-06-01)
++++++++++++++++++

* First release on PyPI.
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2021 Szymon Talaga

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include AUTHORS.rst
include HISTORY.rst
include LICENSE
include README.rst
72 changes: 72 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
.PHONY: help clean clean-pyc clean-build clean-test lint test test-all coverage docs release sdist

help:
@echo "clean - remove auxiliary files/artifacts"
@echo "clean-build - remove build artifacts"
@echo "clean-pyc - remove Python file artifacts"
@echo "clean-test - remove testing artifacts"
@echo "lint - check style with flake8"
@echo "test - run tests quickly with the default Python"
@echo "test-all - run tests on every Python version with tox"
@echo "coverage - compute code coverage quickly with the default Python"
@echo "cov-report - display coverage report"
@echo "docs - generate Sphinx HTML documentation, including API docs"
@echo "release - package and upload a release"
@echo "sdist - package"

clean: clean-build clean-py clean-test

clean-build:
rm -fr build/
rm -fr dist/
find . -name '*.egg-info' -exec rm -rf {} +
find . -name '*.eggs' -exec rm -rf {} +

clean-py:
find . -name '__pycache__' -exec rm -rf {} +
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*.nbc' -exec rm -f {} +
find . -name '*.nbi' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +

clean-test:
find . -name '.benchmarks' -exec rm -rf {} +
find . -name '.pytest_cache' -exec rm -rf {} +
find . -name '.tox' -exec rm -rf {} +

lint:
pytest --pylint -m pylint

test:
pytest

test-all:
tox

cov-run:
coverage run --source pathcensus setup.py test

cov-report:
coverage report --omit=pathcensus/core/*.py
coverage html --omit=pathcensus/core/*.py
xdg-open htmlcov/index.html || open htmlcov/index.html

coverage: cov-run cov-report

docs:
rm -f docs/pathcensus.rst
rm -f docs/modules.rst
sphinx-apidoc -o docs/ pathcensus
$(MAKE) -C docs clean
$(MAKE) -C docs html
xdg-open docs/_build/html/index.html || open docs/_build/html/index.html

release: clean
python setup.py sdist upload
python setup.py bdist_wheel upload

sdist: clean
python setup.py sdist
python setup.py bdist_wheel upload
ls -l dist
Loading

0 comments on commit 0246b14

Please sign in to comment.