Skip to content
Snippets Groups Projects
Commit 76c78b07 authored by Seseke, David's avatar Seseke, David :floppy_disk:
Browse files

Init

parents
No related branches found
No related tags found
No related merge requests found
.DS_Store
.idea
*.log
tmp/
*.py[cod]
*.egg
build
htmlcov
# We do not need the PNG files
*.png
# The .venv can be ignored
.venv/
import networkx as nx
import matplotlib.pyplot as plt
G = nx.watts_strogatz_graph(40, 3, 0.7, seed=12)
pos = nx.forceatlas2_layout(G)
fig = plt.figure()
nx.draw(G, pos, ax=fig.add_subplot())
fig.savefig("graph.png")
repro.md 0 → 100644
# Simple repository for reproducability: Python
This is a repository that runs a small test script using a network
library. See the corresponding publication under XYZ.
## Structure
The repository contains the `main.py` which runs the main script and the
`test.py` which is used for testing the install. Any data is contained
inside the data directory and will be automatically loaded by the
installation script.
## Installation
1. Download the repository:
``` shell
git clone https://<the-repository>/some/path.git
```
2. Move into the directory of the cloned folder.
3. Create the virtual environment.
``` shell
python -m venv .venv
```
4. Activate the environment:
- Linux & Mac
``` shell
source .venv/bin/activate
```
- Windows (cmd.exe):
``` shell
.venv/Scripts/activate.bat
```
- Windows (Powershell)
``` shell
.venv/Scripts/activate.ps1
```
5. Install the requirements with pip:
``` shell
pip install -r ./requirements.txt
```
6. Run the test script to test the environment:
``` shell
python ./test.py
```
## Data
No data is required for running this script.
## Run the main script
Ensure, that you successfully completed the installation process. After this the command should run succesfully:
``` shell
python ./main.py
```
The successfull run should produce a `graph.png` in the current directory containing a simple graph.
contourpy==1.3.1
cycler==0.12.1
fonttools==4.55.6
kiwisolver==1.4.8
matplotlib==3.10.0
networkx==3.4.2
numpy==2.2.2
packaging==24.2
pillow==11.1.0
pyparsing==3.2.1
python-dateutil==2.9.0.post0
six==1.17.0
import networkx as nx
import matplotlib.pyplot as plt
G = nx.watts_strogatz_graph(10, 3, 0.7, seed=12)
pos = nx.spring_layout(G)
fig = plt.figure()
nx.draw(G, pos, ax=fig.add_subplot())
fig.savefig("test_graph.png")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment