Skip to content

Commit

Permalink
Merge branch 'pnnl:master' into networkx3-support-develop
Browse files Browse the repository at this point in the history
  • Loading branch information
wlruys authored Mar 4, 2024
2 parents ef0e0b1 + 706d842 commit 5765eca
Show file tree
Hide file tree
Showing 56 changed files with 17,914 additions and 696 deletions.
2 changes: 1 addition & 1 deletion .cz.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.commitizen]
name = "cz_conventional_commits"
version = "2.0.5"
version = "2.2.0"
version_files = [
"setup.py",
"docs/source/conf.py",
Expand Down
11 changes: 11 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[flake8]
max-line-length=120
extend-ignore = E203
exclude =
.git,
__pycache__,
docs/source/conf.py,
old,
build,
dist
max-complexity = 10
28 changes: 0 additions & 28 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,3 @@ repos:
- id: trailing-whitespace
exclude: ^(docs/|hypernetx.egg-info/|setup.cfg)
- id: check-merge-conflict

- repo: https://github.com/psf/black
rev: 22.6.0
hooks:
- id: black
exclude: ^(docs/|hypernetx.egg-info/)

# TODO: Uncomment once typing issues have been resolved and mypy has been
# correctly configured
#- repo: https://github.com/pre-commit/mirrors-mypy
# rev: v0.910-1
# hooks:
# - id: mypy
# exclude: (?x)(docs/|tests/)
# args: [--no-strict-optional, --ignore-missing-imports]

- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
args:
[
"--rcfile=.pylintrc",
"--exit-zero" # Always return a 0 (non-error) status code, even if lint errors are found. This is primarily useful in continuous integration scripts.
]
13 changes: 0 additions & 13 deletions .pylintrc

This file was deleted.

70 changes: 52 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,73 @@
# Contributor orientation
# Contributing to HyperNetX

If you have ideas for improving this project, we would love to hear from you!
## Code of Conduct

## Orientation
We want this community to be friendly and respectful to each other. Please read [the full text](CODE_OF_CONDUCT.md) so that you can understand what actions will and will not be tolerated.

## Requirements

- Python >=3.8,<3.12

## Our Development Process

### Development workflow

> **Working on your first pull request?** You can learn how from this *free* series: [How to Contribute to an Open Source Project on GitHub](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project).
1. Fork the repo and create your branch from the `develop` branch. Here's a guide on [how to fork a repository](https://help.github.com/articles/fork-a-repo/).
1. Create a Python virtual environment. For convenience, our Makefile provides a target called 'venv' that will create a virtual environment for you. Run the following command: `make venv`
1. Activate the virtual environment. If you used the Makefile target in the previous step, activate the virtual environment by the running the following command: `source venv-hnx/bin/activate`
1. Install the library in development mode: `pip install -e .`
1. Install testing dependencies: `pip install -e .['testing'] `
1. Do the changes you want and ensure all tests pass by running `python -m pytest` before sending a pull request.

### Commit message convention

Ensure that commit messages begin with a verb and are in the present tense. Write meaningful commit messages that concisely describes the changes in a commit.
Read this blog post, [How to Write a Git Commit Message](https://cbea.ms/git-commit/) for some guidance.

### Linting and tests

We use `pylint` and `black` for linting and formatting the code, and `pytest` for testing.

We have included a pre-commit config file that can be used to install pre-commit hooks that will lint your code changes every time you create a commit.
To install pre-commit, you must first install the testing dependencies: `pip install -e .['testing']`. Then run: `pre-commit install`.

Once installed, every time you create a new commit, the linters and formatters will run on the changed code. It is highly recommended to use these `pre-commit` hooks
because these same hooks are run in our CI/CD pipelines on every pull request. Catching pre-commit issues early will prevent CI/CD pipeline issues on your pull request.

### Sending a pull request

- Prefer small pull requests focused on one change.
- Verify that and all tests are passing.
- Verify all in-code documentation is correct (it will be used to generate API documentation).

The world of open source is wide; it can be a lot to take in! If this is your first time working with an open source project, then welcome! If you're an experienced contributor, then welcome back! Either way, this online resource might help you [get oriented, or bursh up](https://opensource.guide/how-to-contribute/) on the process.

## Report an issue, bug, or feature request

Here are the [steps to creating an issue on github](https://docs.github.com/en/issues/tracking-your-work-with-issues/quickstart). When reporting a bug,
Here are the [steps to creating an issue on GitHub](https://docs.github.com/en/issues/tracking-your-work-with-issues/quickstart). When reporting a bug,

- search for related issues on Github. You might be able to get answer without the hassle of creating an issue
- search for related issues on GitHub. You might be able to get answer without the hassle of creating an issue
- describe the current behavior and explain which behavior you expected to see instead and why. At this point you can also tell which alternatives do not work for you.
- (if applicable) provide error messages
- (if applicable) provide a step by step description of the problem; if possible include code that others can use to reproduce it
- You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux.
- provide clear, specific title
- provide a clear, specific title
- include details on your setup (operating system, python version, etc.)
- use the most recent version of this library and the source language (e.g. Rust); that fixes a lot of problems
- use the most recent version of this library and the source language (e.g. Python); that fixes a lot of problems
- here are [more details on getting the most out of issue reporting!](https://marker.io/blog/how-to-write-bug-report)

## Contribute new code

Here is a [step-by-step guide to writing new code, and submiting it to the project](https://docs.github.com/en/get-started/quickstart/contributing-to-projects)
## Start a Discussion

The more you know about a software library, the easier it is to get started writing code. The best way to learn about this project is its the documentation! See `README.md` to get started.
If you want a forum to collaborate and discuss topics or questions in more depth, feel free to start a discussion on our
[Github Discussions page](https://github.com/pnnl/HyperNetX/discussions). GitHub Discussions is a collaborative
communication forum for the community. Community members can ask and answer questions, share updates, have open-ended
conversations, and follow along on decisions affecting the community's way of working.


## Where can I go for help?

If you're stuck or don't know where to begin, then you're in good company -- we've all been there! We're here to help, and we'd love to hear from you:

- open a issue report on Github
- email us at <[email protected]>

# Code of conduct

Our shared values as software developers guide us in our day-to-day interactions and decision-making. Our open source projects are no exception. Trust, respect, collaboration and transparency are core values we believe should live and breathe within our projects. Our community welcomes participants from around the world with different experiences, unique perspectives, and great ideas to share. Our [code of conduct](CODE_OF_CONDUCT) describes these values, and our standards for contributing.
- open an issue report on [GitHub](https://github.com/pnnl/HyperNetX/issues)
- email us at [[email protected]](mailto:[email protected])
48 changes: 25 additions & 23 deletions LICENSE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,29 @@ License

HyperNetX

Copyright © 2023, Battelle Memorial Institute

Battelle Memorial Institute (hereinafter Battelle) hereby grants permission
to any person or entity lawfully obtaining a copy of this software and associated
documentation files (hereinafter “the Software”) to redistribute and use the
Software in source and binary forms, with or without modification. Such person
or entity may use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and may permit others to do so, subject to the
following conditions:

- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other
- Other than as used herein, neither the name Battelle Memorial Institute or Battelle may be used in any form whatsoever without the express written consent of Battelle.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
Copyright 2018, 2023, Battelle Memorial Institute

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without specific
prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL BATTELLE OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4 changes: 2 additions & 2 deletions LONG_DESCRIPTION.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ Hypernets project as part of its High Performance Data Analytics (HPDA) program.
PNNL is operated by Battelle Memorial Institute under Contract DE-ACO5-76RL01830.

* Principal Developer and Designer: Brenda Praggastis
* Development Team: Madelyn Shapiro, Mark Bonicillo
* Development Team: Audun Myers, Mark Bonicillo
* Visualization: Dustin Arendt, Ji Young Yun
* Principal Investigator: Cliff Joslyn
* Program Manager: Brian Kritzstein
* Principal Contributors (Design, Theory, Code): Sinan Aksoy, Dustin Arendt, Mark Bonicillo, Helen Jenne, Cliff Joslyn, Nicholas Landry, Audun Myers, Christopher Potvin, Brenda Praggastis, Emilie Purvine, Greg Roek, Madelyn Shapiro, Mirah Shi, Francois Theberge, Ji Young Yun
* Principal Contributors (Design, Theory, Code): Sinan Aksoy, Dustin Arendt, Mark Bonicillo, Helen Jenne, Cliff Joslyn, Nicholas Landry, Audun Myers, Christopher Potvin, Brenda Praggastis, Emilie Purvine, Greg Roek, Mirah Shi, Francois Theberge, Ji Young Yun

The code in this repository is intended to support researchers modeling data
as hypergraphs. We have a growing community of users and contributors.
Expand Down
88 changes: 67 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,82 +4,128 @@ VENV = venv-hnx
PYTHON3 = python3


## Test
## Lint

test: test-deps
@$(PYTHON3) -m tox
.PHONY: lint
lint: pylint flake8 mypy

.PHONY: pylint
pylint:
@$(PYTHON3) -m pylint --recursive=y --persistent=n --verbose hypernetx

.PHONY: mypy
mypy:
@$(PYTHON3) -m mypy hypernetx || true

.PHONY: flake8
flake8:
@$(PYTHON3) -m flake8 hypernetx --exit-zero

.PHONY: format
format:
@$(PYTHON3) -m black hypernetx


## Tests

test-ci: test-deps
.PHONY: pre-commit
pre-commit:
pre-commit install
pre-commit run --all-files
@$(PYTHON3) -m tox

test-ci-github: test-deps
@$(PYTHON3) -m pip install 'pytest-github-actions-annotate-failures>=0.1.7'
.PHONY: test
test:
coverage run --source=hypernetx -m pytest
coverage report -m

.PHONY: test-ci
test-ci:
@$(PYTHON3) -m tox

.PHONY: test, test-ci, test-ci-github
.PHONY: test-ci-stash
test-ci-stash: lint-deps lint pre-commit test-deps test-ci


.PHONY: test-ci-github
test-ci-github: lint-deps lint pre-commit ci-github-deps test-deps test-ci


## Continuous Deployment
## Assumes that scripts are run on a container or test server VM

### Publish to PyPi

.PHONY: publish-deps
publish-deps:
@$(PYTHON3) -m pip install -e .'[packaging]' --use-pep517
@$(PYTHON3) -m pip install -e .[packaging] --use-pep517

.PHONY: build-dist
build-dist: publish-deps clean
@$(PYTHON3) -m build --wheel --sdist
@$(PYTHON3) -m twine check dist/*

## Assumes the following environment variables are set: TWINE_USERNAME, TWINE_PASSWORD, TWINE_REPOSITORY_URL,
## See https://twine.readthedocs.io/en/stable/#environment-variables
.PHONY: publish-to-pypi
publish-to-pypi: publish-deps build-dist
@echo "Publishing to PyPi"
$(PYTHON3) -m twine upload dist/*

.PHONY: build-dist publish-to-pypi publish-deps

### Update version

.PHONY: version-deps
version-deps:
@$(PYTHON3) -m pip install .'[releases]' --use-pep517
@$(PYTHON3) -m pip install .[releases] --use-pep517

.PHONY: version-deps

### Documentation

.PHONY: docs-deps
docs-deps:
@$(PYTHON3) -m pip install .'[documentation]' --use-pep517
@$(PYTHON3) -m pip install .[documentation] --use-pep517

.PHONY: docs-deps

## Tutorials

.PHONY: tutorial-deps
tutorial-deps:
@$(PYTHON3) -m pip install .'[tutorials]' .'[widget]' --use-pep517
@$(PYTHON3) -m pip install .[tutorials] .[widget] --use-pep517

.PHONY: tutorials
tutorials:
jupyter notebook tutorials



## Environment

.PHONY: clean-venv
clean-venv:
rm -rf $(VENV)

.PHONY: clean
clean:
rm -rf .out .pytest_cache .tox *.egg-info dist build

.PHONY: venv
venv: clean-venv
@$(PYTHON3) -m venv $(VENV);

.PHONY: github-ci-deps
ci-github-deps:
@$(PYTHON3) -m pip install 'pytest-github-actions-annotate-failures>=0.1.7'

.PHONY: lint-deps
lint-deps:
@$(PYTHON3) -m pip install .[lint] --use-pep517

.PHONY: format-deps
format-deps:
@$(PYTHON3) -m pip install .[format] --use-pep517

.PHONY: test-deps
test-deps:
@$(PYTHON3) -m pip install .'[testing]' --use-pep517
@$(PYTHON3) -m pip install .[testing] --use-pep517

.PHONY: all-deps
all-deps:
@$(PYTHON3) -m pip install -e .'[all]' --use-pep517

.PHONY: clean clean-venv venv all-deps test-deps
@$(PYTHON3) -m pip install .[all] --use-pep517
Loading

0 comments on commit 5765eca

Please sign in to comment.