-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAINT: Added LICENSE and updated README (#59)
* Added LICENSE and updated README * some small fixes * small change * changed license * bug fix * updated testing docs * fixed docs
- Loading branch information
1 parent
4600630
commit 969941b
Showing
4 changed files
with
95 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ To set the local development environment: | |
- Clone the forked repository locally. | ||
|
||
```.sh | ||
git clone [email protected]:<your_username>/networkx.git | ||
git clone [email protected]:<your_username>/nx-parallel.git | ||
``` | ||
|
||
- Create a fresh conda/mamba virtualenv ([learn more](https:/networkx/networkx/blob/main/CONTRIBUTING.rst#development-workflow)) | ||
|
@@ -55,7 +55,13 @@ git push origin <branch_name> | |
|
||
## Testing nx-parallel | ||
|
||
The following command runs all the tests in networkx with a `ParallelGraph` object and for algorithms not in nx-parallel, it falls back to networkx's sequential implementations. This is to ensure that the parallel implementation follows the same API as networkx's. | ||
Firstly, install the dependencies for testing: | ||
|
||
```.sh | ||
pip install -e ".[test]" | ||
``` | ||
|
||
Then run the following command that executes all the tests in networkx's test suite with a `ParallelGraph` object and for algorithms not in nx-parallel, it falls back to networkx's sequential implementations. This is to ensure that the parallel backend follows the same API as networkx's. | ||
|
||
```.sh | ||
PYTHONPATH=. \ | ||
|
@@ -64,7 +70,9 @@ NETWORKX_FALLBACK_TO_NX=True \ | |
pytest --pyargs networkx "$@" | ||
``` | ||
|
||
For running additional tests: | ||
Ref. [NetworkX Backend testing docs](https://networkx.org/documentation/latest/reference/backends.html#testing-the-custom-backend) to know about testing mechanisms in networkx. | ||
|
||
For running additional tests specific to nx-parallel, you can run the following command: | ||
|
||
```.sh | ||
pytest nx_parallel | ||
|
@@ -116,7 +124,7 @@ The default chunking in nx-parallel is done by first determining the number of a | |
- The algorithm that you are considering to add to nx-parallel should be in the main networkx repository and it should have the `_dispatchable` decorator. If not, you can consider adding a sequential implementation in networkx first. | ||
- check-list for adding a new function: | ||
- [ ] Add the parallel implementation(make sure API doesn't break), the file structure should be the same as that in networkx. | ||
- [ ] add the function to the `Dispatcher` class in [interface.py](https:/networkx/nx-parallel/blob/main/nx_parallel/interface.py) (take care of the `name` parameter in `_dispatchable` (ref. [docs](https://networkx.org/documentation/latest/reference/generated/networkx.utils.backends._dispatchable.html#dispatchable))) | ||
- [ ] add the function to the `Dispatcher` class in [interface.py](https:/networkx/nx-parallel/blob/main/nx_parallel/interface.py) (take care of the `name` parameter in `_dispatchable` (ref. [docs](https://networkx.org/documentation/latest/reference/backends.html))) | ||
- [ ] update the `__init__.py` files accordingly | ||
- [ ] docstring following the above format | ||
- [ ] run the [timing script](https:/networkx/nx-parallel/blob/main/timing/timing_individual_function.py) to get the performance heatmap | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
BSD 3-Clause License | ||
|
||
Copyright (c) 2024, [Contributors of nx-parallel](https:/networkx/nx-parallel/graphs/contributors) | ||
|
||
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 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters