diff --git a/releasenotes/notes/add-in-out-edge-indices-functions-fc1ce122ff761ad6.yaml b/releasenotes/notes/0.17/add-in-out-edge-indices-functions-fc1ce122ff761ad6.yaml similarity index 100% rename from releasenotes/notes/add-in-out-edge-indices-functions-fc1ce122ff761ad6.yaml rename to releasenotes/notes/0.17/add-in-out-edge-indices-functions-fc1ce122ff761ad6.yaml diff --git a/releasenotes/notes/add-local-complementation-f79b3b05769814cc.yaml b/releasenotes/notes/0.17/add-local-complementation-f79b3b05769814cc.yaml similarity index 100% rename from releasenotes/notes/add-local-complementation-f79b3b05769814cc.yaml rename to releasenotes/notes/0.17/add-local-complementation-f79b3b05769814cc.yaml diff --git a/releasenotes/notes/add-method-find-successor-node-by-edge-2c14e3f96c61fc8d.yaml b/releasenotes/notes/0.17/add-method-find-successor-node-by-edge-2c14e3f96c61fc8d.yaml similarity index 100% rename from releasenotes/notes/add-method-find-successor-node-by-edge-2c14e3f96c61fc8d.yaml rename to releasenotes/notes/0.17/add-method-find-successor-node-by-edge-2c14e3f96c61fc8d.yaml diff --git a/releasenotes/notes/add-method-is-strongly-connected-4f2918fa15b46d8f.yaml b/releasenotes/notes/0.17/add-method-is-strongly-connected-4f2918fa15b46d8f.yaml similarity index 100% rename from releasenotes/notes/add-method-is-strongly-connected-4f2918fa15b46d8f.yaml rename to releasenotes/notes/0.17/add-method-is-strongly-connected-4f2918fa15b46d8f.yaml diff --git a/releasenotes/notes/barabasi_albert_seeding-a43b3374caa2a978.yaml b/releasenotes/notes/0.17/barabasi_albert_seeding-a43b3374caa2a978.yaml similarity index 100% rename from releasenotes/notes/barabasi_albert_seeding-a43b3374caa2a978.yaml rename to releasenotes/notes/0.17/barabasi_albert_seeding-a43b3374caa2a978.yaml diff --git a/releasenotes/notes/bump-msrv-179-b3732d9b786dc265.yaml b/releasenotes/notes/0.17/bump-msrv-179-b3732d9b786dc265.yaml similarity index 100% rename from releasenotes/notes/bump-msrv-179-b3732d9b786dc265.yaml rename to releasenotes/notes/0.17/bump-msrv-179-b3732d9b786dc265.yaml diff --git a/releasenotes/notes/bump-petgraph-79f354e3dce1aa14.yaml b/releasenotes/notes/0.17/bump-petgraph-79f354e3dce1aa14.yaml similarity index 100% rename from releasenotes/notes/bump-petgraph-79f354e3dce1aa14.yaml rename to releasenotes/notes/0.17/bump-petgraph-79f354e3dce1aa14.yaml diff --git a/releasenotes/notes/condensation-undirected-support-apr2025.yaml b/releasenotes/notes/0.17/condensation-undirected-support-apr2025.yaml similarity index 100% rename from releasenotes/notes/condensation-undirected-support-apr2025.yaml rename to releasenotes/notes/0.17/condensation-undirected-support-apr2025.yaml diff --git a/releasenotes/notes/expose-all-simple-path-multiple-targets-767f818daeeb5a41.yaml b/releasenotes/notes/0.17/expose-all-simple-path-multiple-targets-767f818daeeb5a41.yaml similarity index 100% rename from releasenotes/notes/expose-all-simple-path-multiple-targets-767f818daeeb5a41.yaml rename to releasenotes/notes/0.17/expose-all-simple-path-multiple-targets-767f818daeeb5a41.yaml diff --git a/releasenotes/notes/expose-can-contract-without-cycle-bd82ec1e5fd87bc7.yaml b/releasenotes/notes/0.17/expose-can-contract-without-cycle-bd82ec1e5fd87bc7.yaml similarity index 100% rename from releasenotes/notes/expose-can-contract-without-cycle-bd82ec1e5fd87bc7.yaml rename to releasenotes/notes/0.17/expose-can-contract-without-cycle-bd82ec1e5fd87bc7.yaml diff --git a/releasenotes/notes/farewell-retworkx-be18546ac0b0cbc2.yaml b/releasenotes/notes/0.17/farewell-retworkx-be18546ac0b0cbc2.yaml similarity index 100% rename from releasenotes/notes/farewell-retworkx-be18546ac0b0cbc2.yaml rename to releasenotes/notes/0.17/farewell-retworkx-be18546ac0b0cbc2.yaml diff --git a/releasenotes/notes/fix-ancestors-panic-3c64b9b43bb0551a.yaml b/releasenotes/notes/0.17/fix-ancestors-panic-3c64b9b43bb0551a.yaml similarity index 100% rename from releasenotes/notes/fix-ancestors-panic-3c64b9b43bb0551a.yaml rename to releasenotes/notes/0.17/fix-ancestors-panic-3c64b9b43bb0551a.yaml diff --git a/releasenotes/notes/fix-search-panic-fd54b704f7ee2101.yaml b/releasenotes/notes/0.17/fix-search-panic-fd54b704f7ee2101.yaml similarity index 100% rename from releasenotes/notes/fix-search-panic-fd54b704f7ee2101.yaml rename to releasenotes/notes/0.17/fix-search-panic-fd54b704f7ee2101.yaml diff --git a/releasenotes/notes/newman-weighted-closeness-centrality-d4dba79712e9ac42.yaml b/releasenotes/notes/0.17/newman-weighted-closeness-centrality-d4dba79712e9ac42.yaml similarity index 100% rename from releasenotes/notes/newman-weighted-closeness-centrality-d4dba79712e9ac42.yaml rename to releasenotes/notes/0.17/newman-weighted-closeness-centrality-d4dba79712e9ac42.yaml diff --git a/releasenotes/notes/parallel-closeness-centrality-5165f62e370181eb.yaml b/releasenotes/notes/0.17/parallel-closeness-centrality-5165f62e370181eb.yaml similarity index 100% rename from releasenotes/notes/parallel-closeness-centrality-5165f62e370181eb.yaml rename to releasenotes/notes/0.17/parallel-closeness-centrality-5165f62e370181eb.yaml diff --git a/releasenotes/notes/port-transitivity-c69b72f813e68693.yaml b/releasenotes/notes/0.17/port-transitivity-c69b72f813e68693.yaml similarity index 100% rename from releasenotes/notes/port-transitivity-c69b72f813e68693.yaml rename to releasenotes/notes/0.17/port-transitivity-c69b72f813e68693.yaml diff --git a/releasenotes/notes/0.17/prepare-0.17-b242552a1301d816.yaml b/releasenotes/notes/0.17/prepare-0.17-b242552a1301d816.yaml new file mode 100644 index 0000000000..7e93ec8506 --- /dev/null +++ b/releasenotes/notes/0.17/prepare-0.17-b242552a1301d816.yaml @@ -0,0 +1,17 @@ +--- +prelude: > + This is a new Rustworkx release with bug fixes and new features to + the library. The highlights of this release are: + + * Enhanced documentation and tests + * Support for writing GraphML files + * A new method for weighted closeness closeness + + This release uses the `Python Stable ABI `__, + and will be compatible with all versions from Python 3.9 onwards. The published + binaries have been tested with Python 3.9 to 3.13, although they will likely + work with future versions like 3.14. + + A special shoutout goes to Miroslav Šedivý, Etienne Wodey, Krishn Parasar, and Barak Katzir + for their pull requests and GitHub issues! Although not documented in individual + entries, we appreciate your work helping us improve our documentation, type annotations, and tests. \ No newline at end of file diff --git a/releasenotes/notes/pyodide-support-2172f2313b06f10d.yaml b/releasenotes/notes/0.17/pyodide-support-2172f2313b06f10d.yaml similarity index 100% rename from releasenotes/notes/pyodide-support-2172f2313b06f10d.yaml rename to releasenotes/notes/0.17/pyodide-support-2172f2313b06f10d.yaml diff --git a/releasenotes/notes/single_source_all_shortest_paths-cd23a45f973a5aba.yaml b/releasenotes/notes/0.17/single_source_all_shortest_paths-cd23a45f973a5aba.yaml similarity index 100% rename from releasenotes/notes/single_source_all_shortest_paths-cd23a45f973a5aba.yaml rename to releasenotes/notes/0.17/single_source_all_shortest_paths-cd23a45f973a5aba.yaml diff --git a/releasenotes/notes/subgraph-with-nodemap-a6ed3bb9bbbe93cd.yaml b/releasenotes/notes/0.17/subgraph-with-nodemap-a6ed3bb9bbbe93cd.yaml similarity index 100% rename from releasenotes/notes/subgraph-with-nodemap-a6ed3bb9bbbe93cd.yaml rename to releasenotes/notes/0.17/subgraph-with-nodemap-a6ed3bb9bbbe93cd.yaml diff --git a/releasenotes/notes/tier-changes-4843ec0d3cd63acb.yaml b/releasenotes/notes/0.17/tier-changes-4843ec0d3cd63acb.yaml similarity index 100% rename from releasenotes/notes/tier-changes-4843ec0d3cd63acb.yaml rename to releasenotes/notes/0.17/tier-changes-4843ec0d3cd63acb.yaml diff --git a/releasenotes/notes/write_graphml-624c10b6f7592ee1.yaml b/releasenotes/notes/0.17/write_graphml-624c10b6f7592ee1.yaml similarity index 100% rename from releasenotes/notes/write_graphml-624c10b6f7592ee1.yaml rename to releasenotes/notes/0.17/write_graphml-624c10b6f7592ee1.yaml diff --git a/rustworkx/__init__.py b/rustworkx/__init__.py index e9452f8428..72507525a8 100644 --- a/rustworkx/__init__.py +++ b/rustworkx/__init__.py @@ -2283,5 +2283,31 @@ def single_source_all_shortest_paths( @_rustworkx_dispatch def write_graphml(graph, path, /, keys=None, compression=None): - """ """ + """Write a graph to a file in GraphML format. + + GraphML is a comprehensive and easy-to-use file format for graphs. It consists + of a language core to describe the structural properties of a graph and a flexible + extension mechanism to add application-specific data. + + For more information see: + http://graphml.graphdrawing.org/ + + .. note:: + + This implementation does not support mixed graphs (directed and undirected edges together), + hyperedges, nested graphs, or ports. + + .. note:: + + GraphML attributes with `graph` domain are written from the graph's attrs field. + + :param graph: The graph to write to the file. This can be a + :class:`~rustworkx.PyGraph` or :class:`~rustworkx.PyDiGraph`. + :param path: The path of the output file to write. + :param keys: Optional list of key definitions for GraphML attributes. + If not specified, keys will be inferred from the graph data. + :param compression: Optional compression format for the output file. + If not specified, no compression is applied. + :raises RuntimeError: when an error is encountered while writing the GraphML file. + """ raise TypeError(f"Invalid Input Type {type(graph)} for graph") diff --git a/src/graphml.rs b/src/graphml.rs index 5c347ca679..59543a5510 100644 --- a/src/graphml.rs +++ b/src/graphml.rs @@ -1289,7 +1289,32 @@ impl KeySpec { } } -/// Write a graph to a file in GraphML format given the list of key definitions. +/// Write a graph to a file in GraphML format. +/// +/// GraphML is a comprehensive and easy-to-use file format for graphs. It consists +/// of a language core to describe the structural properties of a graph and a flexible +/// extension mechanism to add application-specific data. +/// +/// For more information see: +/// http://graphml.graphdrawing.org/ +/// +/// .. note:: +/// +/// This implementation does not support mixed graphs (directed and undirected edges together), +/// hyperedges, nested graphs, or ports. +/// +/// .. note:: +/// +/// GraphML attributes with `graph` domain are written from :attr:`~.PyGraph.attrs` field. +/// +/// :param PyGraph graph: The graph to write to the file. +/// :param str path: The path of the output file to write. +/// :param Optional[list[GraphMLKey]] keys: Optional list of key definitions for GraphML attributes. +/// If None, keys will be inferred from the graph data. +/// :param Optional[str] compression: Optional compression format for the output file. +/// If None, no compression is applied. +/// +/// :raises RuntimeError: when an error is encountered while writing the GraphML file. #[pyfunction] #[pyo3(signature=(graph, path, keys=None, compression=None),text_signature = "(graph, path, /, keys=None, compression=None)")] pub fn graph_write_graphml( @@ -1306,7 +1331,32 @@ pub fn graph_write_graphml( Ok(()) } -/// Write a digraph to a file in GraphML format given the list of key definitions. +/// Write a graph to a file in GraphML format. +/// +/// GraphML is a comprehensive and easy-to-use file format for graphs. It consists +/// of a language core to describe the structural properties of a graph and a flexible +/// extension mechanism to add application-specific data. +/// +/// For more information see: +/// http://graphml.graphdrawing.org/ +/// +/// .. note:: +/// +/// This implementation does not support mixed graphs (directed and undirected edges together), +/// hyperedges, nested graphs, or ports. +/// +/// .. note:: +/// +/// GraphML attributes with `graph` domain are written from :attr:`~.PyGraph.attrs` field. +/// +/// :param PyDiGraph graph: The graph to write to the file. +/// :param str path: The path of the output file to write. +/// :param Optional[list[GraphMLKey]] keys: Optional list of key definitions for GraphML attributes. +/// If None, keys will be inferred from the graph data. +/// :param Optional[str] compression: Optional compression format for the output file. +/// If None, no compression is applied. +/// +/// :raises RuntimeError: when an error is encountered while writing the GraphML file. #[pyfunction] #[pyo3(signature=(graph, path, keys=None, compression=None),text_signature = "(graph, path, /, keys=None, compression=None)")] pub fn digraph_write_graphml(