nx-parallel


Namenx-parallel JSON
Version 0.1 PyPI version JSON
download
home_page
SummaryAn experimental parallel backend for NetworkX
upload_time2023-10-13 20:49:14
maintainer
docs_urlNone
author
requires_python>=3.11
licenseBSD-3-Clause
keywords algorithms networkx parallel
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## nx-parallel

nx-parallel is a NetworkX backend plugin that uses joblib and multiprocessing for parallelization. This project aims to provide parallelized implementations of various NetworkX functions to improve performance.

## Features

nx-parallel provides parallelized implementations for the following NetworkX functions:

```
├── centrality
│   ├── betweenness_centrality
│   ├── closeness_vitality
├── tournament
│   ├── is_reachable
├── efficiency_measures
│   ├── local_efficiency
```

![alt text](timing/heatmap_all_functions.png)

See the `/timing` folder for more heatmaps and code for heatmap generation!


### Development install

To setup a local development:

- Fork this repository.
- Clone the forked repository locally.
```
git clone git@github.com:<your_username>/networkx.git
```
- Create a fresh conda/mamba virtualenv and install the dependencies
```
pip install -e ".[developer]"
```
- Install pre-commit actions that will run the linters before making a commit
```
pre-commit install
```


## Usage

Here's an example of how to use nx-parallel:

```python
In [1]: import networkx as nx; import nx_parallel

In [2]: G = nx.path_graph(4)

In [3]: H = nx_parallel.ParallelGraph(G)

In [4]: nx.betweenness_centrality(H)
Out[4]: {0: 0.0, 1: 0.6666666666666666, 2: 0.6666666666666666, 3: 0.0}
```

## Testing

To run tests for the project, use the following command:

```
PYTHONPATH=. \
NETWORKX_GRAPH_CONVERT=parallel \
NETWORKX_TEST_BACKEND=parallel \
NETWORKX_FALLBACK_TO_NX=True \
    pytest --pyargs networkx "$@"
```

## Contributing

We'd love to have you contribute to nx-parallel! Here are some guidelines on how to do that:

- **Issues:** Feel free to open issues for any problems you face, or for new features you'd like to see implemented.
- **Pull requests:** If you'd like to implement a feature or fix a bug yourself, we'd be happy to review a pull request. Please make sure to explain the changes you made in the pull request description.

## Additional Information

This project is part of the larger NetworkX project. If you're interested in contributing to NetworkX, you can find more information in the [NetworkX contributing guidelines](https://github.com/networkx/networkx/blob/main/CONTRIBUTING.rst).

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "nx-parallel",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": "",
    "keywords": "algorithms,networkx,parallel",
    "author": "",
    "author_email": "NetworkX Devs <networkx-core@discuss.scientific-python.org>",
    "download_url": "https://files.pythonhosted.org/packages/23/93/4d4616df4d4207e1cf9337362a508490e01c76ee44b32513fb0263fcb014/nx_parallel-0.1.tar.gz",
    "platform": null,
    "description": "## nx-parallel\n\nnx-parallel is a NetworkX backend plugin that uses joblib and multiprocessing for parallelization. This project aims to provide parallelized implementations of various NetworkX functions to improve performance.\n\n## Features\n\nnx-parallel provides parallelized implementations for the following NetworkX functions:\n\n```\n\u251c\u2500\u2500 centrality\n\u2502   \u251c\u2500\u2500 betweenness_centrality\n\u2502   \u251c\u2500\u2500 closeness_vitality\n\u251c\u2500\u2500 tournament\n\u2502   \u251c\u2500\u2500 is_reachable\n\u251c\u2500\u2500 efficiency_measures\n\u2502   \u251c\u2500\u2500 local_efficiency\n```\n\n![alt text](timing/heatmap_all_functions.png)\n\nSee the `/timing` folder for more heatmaps and code for heatmap generation!\n\n\n### Development install\n\nTo setup a local development:\n\n- Fork this repository.\n- Clone the forked repository locally.\n```\ngit clone git@github.com:<your_username>/networkx.git\n```\n- Create a fresh conda/mamba virtualenv and install the dependencies\n```\npip install -e \".[developer]\"\n```\n- Install pre-commit actions that will run the linters before making a commit\n```\npre-commit install\n```\n\n\n## Usage\n\nHere's an example of how to use nx-parallel:\n\n```python\nIn [1]: import networkx as nx; import nx_parallel\n\nIn [2]: G = nx.path_graph(4)\n\nIn [3]: H = nx_parallel.ParallelGraph(G)\n\nIn [4]: nx.betweenness_centrality(H)\nOut[4]: {0: 0.0, 1: 0.6666666666666666, 2: 0.6666666666666666, 3: 0.0}\n```\n\n## Testing\n\nTo run tests for the project, use the following command:\n\n```\nPYTHONPATH=. \\\nNETWORKX_GRAPH_CONVERT=parallel \\\nNETWORKX_TEST_BACKEND=parallel \\\nNETWORKX_FALLBACK_TO_NX=True \\\n    pytest --pyargs networkx \"$@\"\n```\n\n## Contributing\n\nWe'd love to have you contribute to nx-parallel! Here are some guidelines on how to do that:\n\n- **Issues:** Feel free to open issues for any problems you face, or for new features you'd like to see implemented.\n- **Pull requests:** If you'd like to implement a feature or fix a bug yourself, we'd be happy to review a pull request. Please make sure to explain the changes you made in the pull request description.\n\n## Additional Information\n\nThis project is part of the larger NetworkX project. If you're interested in contributing to NetworkX, you can find more information in the [NetworkX contributing guidelines](https://github.com/networkx/networkx/blob/main/CONTRIBUTING.rst).\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "An experimental parallel backend for NetworkX",
    "version": "0.1",
    "project_urls": null,
    "split_keywords": [
        "algorithms",
        "networkx",
        "parallel"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "128f5e6bfc140070a7b4ddbbb5ad7d4f424065ffa414f0b575ad7bb3ccd43eae",
                "md5": "cf900f6729df2315b524afde89ee8345",
                "sha256": "91a04bd5fee55fb2fee0bc82ef4db23bd9670aab62bffdf468b88a4146f5d23a"
            },
            "downloads": -1,
            "filename": "nx_parallel-0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cf900f6729df2315b524afde89ee8345",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 10736,
            "upload_time": "2023-10-13T20:49:12",
            "upload_time_iso_8601": "2023-10-13T20:49:12.183442Z",
            "url": "https://files.pythonhosted.org/packages/12/8f/5e6bfc140070a7b4ddbbb5ad7d4f424065ffa414f0b575ad7bb3ccd43eae/nx_parallel-0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "23934d4616df4d4207e1cf9337362a508490e01c76ee44b32513fb0263fcb014",
                "md5": "8accc9d30917a6d0bad1628e27df8521",
                "sha256": "36652fb7e077f58c04ad5ba5ad9e86297ca1ce49f84327114d8994ca54a19f1c"
            },
            "downloads": -1,
            "filename": "nx_parallel-0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "8accc9d30917a6d0bad1628e27df8521",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 376720,
            "upload_time": "2023-10-13T20:49:14",
            "upload_time_iso_8601": "2023-10-13T20:49:14.094759Z",
            "url": "https://files.pythonhosted.org/packages/23/93/4d4616df4d4207e1cf9337362a508490e01c76ee44b32513fb0263fcb014/nx_parallel-0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-13 20:49:14",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "nx-parallel"
}
        
Elapsed time: 0.12141s