Skip to content

Commit

Permalink
Merge branch 'main' into johnson-core
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanIsCoding authored Dec 17, 2024
2 parents c6fcc6e + 6bc3933 commit d7bc7c9
Show file tree
Hide file tree
Showing 98 changed files with 948 additions and 267 deletions.
8 changes: 8 additions & 0 deletions .github/.mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pull_request_rules:
- name: backport
conditions:
- label=stable-backport-potential
actions:
backport:
branches:
- stable/0.15
4 changes: 3 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- run: pip install -U ruff==0.6.8 black~=24.8
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
components: rustfmt, clippy
- name: Test Build
run: cargo build
- name: Rust Format
Expand All @@ -46,6 +46,8 @@ jobs:
run: pushd rustworkx-core && cargo test && popd
- name: rustworkx-core Docs
run: pushd rustworkx-core && cargo doc && popd
env:
RUSTDOCFLAGS: '-D warnings'
- uses: actions/upload-artifact@v4
with:
name: rustworkx_core_docs
Expand Down
33 changes: 0 additions & 33 deletions .mergify.yml

This file was deleted.

4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ cargo doc --open
### Type Annotations
If you have added new methods, functions, or classes, and/or changed any
signatures, type anotations for Python are required to be included in a pull
signatures, type annotations for Python are required to be included in a pull
request. Type annotations are added using type
[stub files](https://typing.readthedocs.io/en/latest/source/stubs.html) which
provide type annotations to python tooling which use type annotations. The stub
Expand Down Expand Up @@ -523,7 +523,7 @@ primary exception to this is adding support for new python versions. If a new
python version is released backporting that feature change with that new support
is an acceptable backport.
In rustworkx at least until the 1.0 release we only maintaing a single stable
In rustworkx at least until the 1.0 release we only maintain a single stable
branch at a time for the most recent minor version release.
#### Backporting procedure
Expand Down
55 changes: 45 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
smallvec = { version = "1.0", features = ["union"] }
rustworkx-core = { path = "rustworkx-core", version = "=0.16.0" }
flate2 = "1.0.35"

[dependencies.pyo3]
version = "0.22.6"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ it just as it would if there was a prebuilt binary available.
> [!NOTE]
> To build from source you will need to ensure you have pip >=19.0.0
installed, which supports PEP-517, or that you have manually installed
`setuptools-rust` prior to running `pip install rustworkx`. If you recieve an
`setuptools-rust` prior to running `pip install rustworkx`. If you receive an
error about `setuptools-rust` not being found you should upgrade pip with
`pip install -U pip` or manually install `setuptools-rust` with
`pip install setuptools-rust` and try again.
Expand Down
3 changes: 3 additions & 0 deletions docs/source/api/algorithm_functions/centrality.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ Centrality
:toctree: ../../apiref

rustworkx.betweenness_centrality
rustworkx.degree_centrality
rustworkx.edge_betweenness_centrality
rustworkx.eigenvector_centrality
rustworkx.katz_centrality
rustworkx.closeness_centrality
rustworkx.in_degree_centrality
rustworkx.out_degree_centrality
10 changes: 10 additions & 0 deletions docs/source/api/algorithm_functions/dominance.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _dominance:

Dominance
=========

.. autosummary::
:toctree: ../../apiref

rustworkx.immediate_dominators
rustworkx.dominance_frontiers
1 change: 1 addition & 0 deletions docs/source/api/algorithm_functions/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Algorithm Functions
coloring
connectivity_and_cycles
dag_algorithms
dominance
graph_operations
isomorphism
link_analysis
Expand Down
2 changes: 1 addition & 1 deletion docs/source/benchmarks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Rustworkx Comparison Benchmarks With Other Libraries
****************************************************

rustworkx is competitive against other popular graph libraries for Python. We compared rustworkx to the igraph, graph-tools and NetworkIt libraries `in a benchmark consisting of four tasks available on Github for reproducibility <https://github.com/mtreinish/retworkx-comparison-benchmarks>`__. We report the results from a machine with an Intel(R) i9-9900K CPU at 3.60GHz with eight cores, 16 theads, and 32GB of RAM avaialble.
rustworkx is competitive against other popular graph libraries for Python. We compared rustworkx to the igraph, graph-tools and NetworkIt libraries `in a benchmark consisting of four tasks available on Github for reproducibility <https://github.com/mtreinish/retworkx-comparison-benchmarks>`__. We report the results from a machine with an Intel(R) i9-9900K CPU at 3.60GHz with eight cores, 16 threads, and 32GB of RAM available.

Graph Creation
==============
Expand Down
4 changes: 2 additions & 2 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ just as it would if there was a prebuilt binary available.

To build from source you will need to ensure you have pip >=19.0.0
installed, which supports PEP-517, or that you have manually installed
setuptools-rust prior to running pip install rustworkx. If you recieve an
setuptools-rust prior to running pip install rustworkx. If you receive an
error about ``setuptools-rust`` not being found you should upgrade pip with
``pip install -U pip`` or manually install ``setuptools-rust`` with:
``pip install setuptools-rust`` and try again.

.. _platform-suppport:
.. _platform-support:

Platform Support
================
Expand Down
4 changes: 2 additions & 2 deletions docs/source/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ New Features

- A new method, :meth:`~rustworkx.PyDiGraph.remove_node_retain_edges`, has been
added to the :class:`~rustworkx.PyDiGraph` class. This method can be used to
remove a node and add edges from its predecesors to its successors.
remove a node and add edges from its predecessors to its successors.
- Two new methods, :meth:`~rustworkx.PyGraph.edge_list` and
:meth:`~rustworkx.PyGraph.weighted_edge_list`, for getting a list of tuples
with the edge source and target (with or without edge weights) have been
Expand All @@ -285,7 +285,7 @@ New Features
edge list file and will read that file and generate a new object from the
contents.
- Two new methods, :meth:`~rustworkx.PyGraph.extend_from_edge_list` and
:meth:`~rustworkx.PyGraoh.extend_from_weighted_edge_list` has been added
:meth:`~rustworkx.PyGraph.extend_from_weighted_edge_list` has been added
to :class:`~rustworkx.PyGraph` and :class:`~rustworkx.PyDiGraph`
(:meth:`~rustworkx.PyDiGraph.extend_from_edge_list` and
:meth:`~rustworkx.PyDiGraph.extend_from_weighted_edge_list`). This method
Expand Down
4 changes: 2 additions & 2 deletions docs/source/tutorial/betweenness_centrality.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ To start we need to generate a graph:
mpl_draw(graph)


Calculate the Betweeness Centrality
-----------------------------------
Calculate the Betweenness Centrality
------------------------------------

The :func:`~rustworkx.betweenness_centrality` function can be used to calculate
the betweenness centrality for each node in the graph.
Expand Down
4 changes: 2 additions & 2 deletions docs/source/tutorial/dags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs. For example:
Above we define a DAG with 6 jobs and dependency relationship between these
jobs. Now if we run the :func:`~rustworkx.topological_sort` function on the
graph it will return a linear order to execute the jobs that will respect
the dependency releationship.
the dependency relationship.

.. jupyter-execute::

Expand Down Expand Up @@ -151,7 +151,7 @@ computation. A quantum circuit is represented graphically like:
The specifics of this circuit aren't important here beyond the fact that
we have 2 qubits, ``q_0`` and ``q_1``, 2 classical bits, ``c_0`` and ``c_1``,
and a series of operations on those qubits with a depedency ordering. The last
and a series of operations on those qubits with a dependency ordering. The last
operation on each qubit is a measurement on ``q_0`` that is stored in ``c_0``
and ``q_1`` that is stored in ``c_1``.

Expand Down
8 changes: 8 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"black~=24.8",
"ruff~=0.6",
"setuptools-rust",
"typos~=1.28",
]

stubs_deps = [
Expand Down Expand Up @@ -45,6 +46,7 @@ def test_with_version(session):
@nox.session(python=["3"])
def lint(session):
black(session)
typos(session)
session.install(*lint_deps)
session.run("ruff", "check", "rustworkx", "retworkx", "setup.py")
session.run("cargo", "fmt", "--all", "--", "--check", external=True)
Expand All @@ -69,6 +71,12 @@ def black(session):
session.install(*[d for d in lint_deps if "black" in d])
session.run("black", "rustworkx", "tests", "retworkx", *session.posargs)

@nox.session(python=["3"])
def typos(session):
session.install(*[d for d in lint_deps if "typos" in d])
session.run("typos", "--exclude", "releasenotes")
session.run("typos", "--no-check-filenames", "releasenotes")

@nox.session(python=["3"])
def stubs(session):
install_rustworkx(session)
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ extend-exclude = ["doc"]
"rustworkx/__init__.py" = ["F405", "F403"]
"*.pyi" = ["F403", "F405", "PYI001", "PYI002"]

[tool.typos.default]
extend-ignore-words-re = [
"[Ss]toer",
]

[tool.cibuildwheel]
manylinux-x86_64-image = "manylinux2014"
manylinux-i686-image = "manylinux2014"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ features:
Added a new method, :meth:`~rustworkx.PyGraph.incident_edge_index_map`, to the
:class:`~rustworkx.PyGraph` and :class:`~rustworkx.PyDiGraph` class. This
method returns a mapping of edge indices for edges incident to a provided node
to the endoint and weight tuple for that edge index. For example:
to the endpoint and weight tuple for that edge index. For example:
.. jupyter-execute::
Expand Down
2 changes: 1 addition & 1 deletion releasenotes/notes/0.11/fix-dispatch-3596ef110cc68338.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ fixes:
- |
Fixed an oversight in the :func:`~rustworkx.union` function where
user-defined values for the ``merge_nodes`` and ``merge_edges`` arguments
were being ingored.
were being ignored.
Loading

0 comments on commit d7bc7c9

Please sign in to comment.