Skip to content

Commit

Permalink
Pull request #201: Release/v2.3.5
Browse files Browse the repository at this point in the history
Merge in HYP/hypernetx from release/v2.3.5 to master

* commit '5b6bb86ac4f43d9b522a3b636f01dff6b98383ec':
  bump: version 2.3.4 → 2.3.5
  Build multi-architecture Docker images to support Apple Silicon and Intel machines
  Update README
  Modify Makefile
  Adjust pylint settings
  Make subsection in LONG_DESCRIPTION
  Remove attestation step
  • Loading branch information
ryandanehy committed Jun 12, 2024
2 parents 7cba362 + 5b6bb86 commit 69821dd
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 63 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.3.4"
version = "2.3.5"
version_provider = "poetry"
version_files = [
"pyproject.toml",
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/publish-to-dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ jobs:
id: push
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
tags: hypernetx/hypernetx:latest
push: true

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: hypernetx/hypernetx
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
4 changes: 2 additions & 2 deletions LONG_DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _long_description:

HyperNetX
=================
=========

The HyperNetX library provides classes and methods for the analysis
and visualization of complex network data modeled as hypergraphs.
Expand All @@ -25,7 +25,7 @@ Documentation is available at: https://pnnl.github.io/HyperNetX
For questions and comments contact the developers directly at: hypernetx@pnnl.gov

HyperNetX 2.3
=============
~~~~~~~~~~~~~

HyperNetX 2.3. is the latest, stable release. The core library has been refactored to take better advantage
of Pandas Dataframes, improve readability and maintainability, address bugs, and make it easier to change.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ lint: pylint flake8

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

# Todo: fix flake8 errors and remove --exit-zero
.PHONY: flake8
Expand Down
109 changes: 62 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,63 +235,96 @@ After the container has started, access the HyperNetX Jupyter Notebooks by openi
[http://localhost:8888/tree](http://localhost:8888/tree)


Development
===========
# Development

Install an editable version
```
pip install -e .
```
As a developer, set up your environment using either the standard `pip` tool or [`Poetry`](https://python-poetry.org/).

## Using Pip

Install additional dependencies to support testing and jupyter notebooks:
### Setup virtual environment and install HNX

Create a virtual environement. Then install an editable version of HNX and also install additional dependencies to support testing and jupyter notebooks:
```
python -m venv venv-hnx
source venv-hnx/bin/activate
pip install -e .
pip install -r requirements.txt
```

You can also install all these requirements in one Make target:
As an alternative, you can also install all these requirements in one Make target:

```
make venv
source venv-hnx/bin/activate
make install
```

Poetry
======
### Setup pre-commit

Use the [pre-commit framework](https://pre-commit.com/) to automatically point out issues and resolve those issues before code review.
It is highly recommended to install pre-commit in your development environment so that issues with your code can be found before you submit a
pull request. More importantly, using pre-commit will automatically format your code changes so that they pass the CI build. For example, pre-commit will
automatically run the formatter Black on your code changes.

```shell
# Once installed, pre-commit will be triggered every time you make a commit in your environment
pre-commit install
```


## Using Poetry

This library uses [Poetry](https://python-poetry.org/docs/) to manage dependencies and packaging. Poetry can also be
used to manage your environment for development.

Prerequisites
-------------
### Prerequisites

* [Install Poetry](https://python-poetry.org/docs/#installation)


Configure Poetry
----------------
### Configure Poetry

[Configure your Poetry](https://python-poetry.org/docs/configuration/) to ensure that the virtual environment gets created in your project directory (this is not necessary but recommended for convenience):

[Configure your Poetry](https://python-poetry.org/docs/configuration/) to create the virtual environment in your project directory:
```
poetry config virtualenvs.in-project true
# check the poetry configuration
poetry config --list
```

Set up virtual environment
----------------------------
### Setup virtual environment and install HNX

Create and activate a virtual environment.

```
poetry shell
```

Install required dependencies and HyperNetX in editable mode.
Install HyperNetX in editable mode, the library's core/required dependencies, and the optional dependencies to support development.

```
poetry install
poetry install --with test,lint,docs,release,tutorials
```

Install support for testing
-----------------------------
Details about these dependencies are defined in [pyproject.toml](pyproject.toml).

### Setup Pre-commit

Use the [pre-commit framework](https://pre-commit.com/) to automatically point out issues and resolve those issues before code review.
It is highly recommended to install pre-commit in your development environment so that issues with your code can be found before you submit a
pull request. More importantly, using pre-commit will automatically format your code changes so that they pass the CI build. For example, pre-commit will
automatically run the formatter Black on your code changes.

```shell
# Once installed, pre-commit will be triggered every time you make a commit in your environment
pre-commit install
```

### Details about optional dependencies

#### Install support for testing


> ℹ️ **NOTE:** This project has pytest configuration contained in pyproject.toml. By default, pytest will use those configuration settings to run tests.
Expand All @@ -312,8 +345,7 @@ coverage html
open htmlcov/index.html
```

Install support for tutorials
-----------------------------
#### Install support for tutorials

```shell
poetry install --with tutorials
Expand All @@ -325,8 +357,8 @@ poetry shell
make tutorials
```

Code Quality
------------
#### Code Quality: Pylint, Black

HyperNetX uses a number of tools to maintain code quality:

* Pylint
Expand All @@ -341,8 +373,6 @@ poetry install --with lint
poetry shell
```

Pylint
------

[Pylint](https://pylint.pycqa.org/en/latest/index.html) is a static code analyzer for Python-based projects. From the [Pylint docs](https://pylint.pycqa.org/en/latest/index.html#what-is-pylint):

Expand All @@ -362,30 +392,14 @@ pylint hypernetx --output=pylint-results.txt

For more information on configuration, see https://pylint.pycqa.org/en/latest/user_guide/configuration/index.html

Black
-----
[Black](https://black.readthedocs.io/en/stable/) is a PEP 8 compliant formatter for Python-based project. This tool is highly opinionated about how Python should be formatted and will automagically reformat your code.


```shell
black hypernetx
```

Pre-commit
---------

Use the [pre-commit framework](https://pre-commit.com/) to automatically point out issues and resolve those issues before code review.
It is highly recommended to install pre-commit in your development environment so that issues with your code can be found before you submit a
pull request. More importantly, using pre-commit will automatically format your code changes so that they pass the CI build. For example, pre-commit will
automatically run the formatter Black on your code changes.

```shell
# Once installed, pre-commit will be triggered every time you make a commit in your environment
pre-commit install
```

Documentation
-------------
### Documentation

Build and view documentation locally:

Expand Down Expand Up @@ -422,13 +436,14 @@ The HTML pages are in docs/html.
Click on [http://127.0.0.1:8000/install.html](http://127.0.0.1:8000/install.html) to open the docs on your browser. Since this will auto-rebuild, every time
you change a document file, it will automatically render on your browser, allowing you to verify your document changes.

Testing the Docker Image
------------------------

## Developing and Testing the Docker Image

If you want to test the Docker image after making any source code changes, follow this workflow:

1. Make a change in the HNX codebase
2. Build image: `docker build --rm --tag hypernetx/hypernetx:latest`
2. Build image for multi-platforms (i.e.ARM64, x86): `docker build --platform linux/amd64,linux/arm64 --rm --tag hypernetx/hypernetx:latest .`
3. If you're having issues building, see https://docs.docker.com/desktop/containerd/
3. Test image: `docker run -it --rm -p 8888:8888 -v "${PWD}":/home/jovyan/work hypernetx/hypernetx:latest`
4. Open a browser to [http://localhost:8888/tree](http://localhost:8888/tree). Check that tutorials still work and/or open a notebook and test the changes that you made.
5. Once finished testing, kill the container using Ctrl-C
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import os


__version__ = "2.3.4"
__version__ = "2.3.5"


# If extensions (or modules to document with autodoc) are in another directory,
Expand Down
2 changes: 1 addition & 1 deletion hypernetx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
from hypernetx.utils import *
from hypernetx.utils.toys import *

__version__ = "2.3.4"
__version__ = "2.3.5"
2 changes: 1 addition & 1 deletion pylintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[MAIN]

# Specify a score threshold to be exceeded before program exits with error.
fail-under=7.00
# fail-under=

# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "hypernetx"
version = "2.3.4"
version = "2.3.5"
description = "HyperNetX is a Python library for the creation and study of hypergraphs."
authors = ["Brenda Praggastis <Brenda.Praggastis@pnnl.gov>", "Dustin Arendt <dustin.arendt@pnnl.gov>",
"Sinan Aksoy <sinan.aksoy@pnnl.gov>", "Emilie Purvine <Emilie.Purvine@pnnl.gov>",
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ basepython = python3.11
commands_pre =
poetry install --with lint
commands =
poetry run pylint --recursive=y --persistent=n hypernetx
poetry run pylint --recursive=y --exit-zero --persistent=n hypernetx
poetry run flake8 hypernetx --exit-zero
poetry run pre-commit install
poetry run pre-commit run --all-files
Expand Down

0 comments on commit 69821dd

Please sign in to comment.