Skip to content

Commit 0c8e9c1

Browse files
authored
Merge pull request #38 from Schefflera-Arboricola/styling_fixes
MAINT : styling fixes
2 parents ff625b8 + 60b319a commit 0c8e9c1

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,41 @@ nx-parallel provides parallelized implementations for the following NetworkX fun
1818

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

21-
2221
### Development install
2322

2423
To setup a local development:
2524

2625
- Fork this repository.
2726
- Clone the forked repository locally.
27+
2828
```
2929
git clone [email protected]:<your_username>/networkx.git
3030
```
31+
3132
- Create a fresh conda/mamba virtualenv and install the dependencies
33+
3234
```
3335
pip install -e ".[developer]"
3436
```
37+
3538
- Install pre-commit actions that will run the linters before making a commit
39+
3640
```
3741
pre-commit install
3842
```
3943

40-
4144
## Usage
4245

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

4548
```python
46-
In [1]: import networkx as nx; import nx_parallel
47-
48-
In [2]: G = nx.path_graph(4)
49-
50-
In [3]: H = nx_parallel.ParallelGraph(G)
49+
import networkx as nx
50+
import nx_parallel
5151

52-
In [4]: nx.betweenness_centrality(H)
53-
Out[4]: {0: 0.0, 1: 0.6666666666666666, 2: 0.6666666666666666, 3: 0.0}
52+
G = nx.path_graph(4)
53+
H = nx_parallel.ParallelGraph(G)
54+
nx.betweenness_centrality(H)
55+
# output : {0: 0.0, 1: 0.6666666666666666, 2: 0.6666666666666666, 3: 0.0}
5456
```
5557

5658
## Testing

benchmarks/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
1. clone this repo
44
2. `cd benchmarks`
55
3. If you are working on a different branch then update the `branches` in the `asv.conf.json` file.
6-
4. `asv run` will run the benchmarks on the last commit
7-
- or use `asv continuous base_commit_hash test_commit_hash` to run the benchmark to compare two commits
8-
- or `asv run -b <benchmark_file_name> -k <benchmark_name>` to run a particular benchmark.
9-
- if you are running benchmarks for the first time, you will be asked to enter your machine information after this command.
6+
4. `asv run` will run the benchmarks on the last commit
7+
- or use `asv continuous base_commit_hash test_commit_hash` to run the benchmark to compare two commits
8+
- or `asv run -b <benchmark_file_name> -k <benchmark_name>` to run a particular benchmark.
9+
- if you are running benchmarks for the first time, you will be asked to enter your machine information after this command.
1010
5. `asv publish` will create a `html` folder with the results
1111
6. `asv preview` will host the results locally at http://127.0.0.1:8080/
1212

1313
<hr>
1414

1515
## Structure of benchmarks
1616

17-
* Each `bench_` file corresponds to a folder/file in the [networkx/algorithms](https://github.com/networkx/networkx/tree/main/networkx/algorithms) directory in NetworkX
18-
* Each class inside a `bench_` file corresponds to every file in a folder(one class if it’s a file) in networkx/algorithms
19-
* The class name corresponds to the file name and the `x` in `bench_x` corresponds to the folder name(class name and `x` are the same if it’s a file in networkx/algorithms)
20-
* Each `time_` function corresponds to each function in the file.
21-
* For other folders in [networkx/networkx](https://github.com/networkx/networkx/tree/main/networkx) like `generators`, `classes`, `linalg`, `utils` etc. we can have different `bench_` files for each of them having different classes corresponding to different files in each of these folders.
22-
* For example: `bench_centrality.py` corresponds to `networkx/algorithms/centrality` folder in NetworkX and the `Betweenness` class inside it corresponds to the `betweenness.py` file in `networkx/algorithms/centrality` folder in NetworkX. And the `time_betweenness_centrality` function corresponds to the `betweenness_centrality` function.
17+
- Each `bench_` file corresponds to a folder/file in the [networkx/algorithms](https://github.com/networkx/networkx/tree/main/networkx/algorithms) directory in NetworkX
18+
- Each class inside a `bench_` file corresponds to every file in a folder(one class if it’s a file) in networkx/algorithms
19+
- The class name corresponds to the file name and the `x` in `bench_x` corresponds to the folder name(class name and `x` are the same if it’s a file in networkx/algorithms)
20+
- Each `time_` function corresponds to each function in the file.
21+
- For other folders in [networkx/networkx](https://github.com/networkx/networkx/tree/main/networkx) like `generators`, `classes`, `linalg`, `utils` etc. we can have different `bench_` files for each of them having different classes corresponding to different files in each of these folders.
22+
- For example: `bench_centrality.py` corresponds to `networkx/algorithms/centrality` folder in NetworkX and the `Betweenness` class inside it corresponds to the `betweenness.py` file in `networkx/algorithms/centrality` folder in NetworkX. And the `time_betweenness_centrality` function corresponds to the `betweenness_centrality` function.

0 commit comments

Comments
 (0)