Skip to content

Commit 9a25019

Browse files
This merge commit joins the Graphs.jl and LightGraphs.jl histories
It has two parents: 1. A commit that deletes all content from Graphs.jl 2. The last LightGraphs.jl commit imported to the Graphs.jl repo
2 parents 7877a6f + 57ec9bb commit 9a25019

File tree

262 files changed

+27162
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

262 files changed

+27162
-0
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Bug report
3+
about: Report a bug with LightGraphs
4+
title: "[BUG]"
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Description of bug**
11+
Describe the bug clearly and concisely.
12+
13+
14+
**How to reproduce**
15+
Detail steps to reproduce the behavior.
16+
17+
18+
**Expected behavior**
19+
Describe what you expected to happen.
20+
21+
22+
**Actual behavior**
23+
Describe what actually happened.
24+
25+
26+
**Code demonstrating bug**
27+
If applicable, provide a minimal working example of the bug.
28+
29+
30+
**Version information**
31+
- output from `versioninfo()` surrounded by backticks (``)
32+
- output from `] status LightGraphs` surrounded by backticks (``)
33+
34+
35+
**Additional context**
36+
Add any other context about the problem here.

.github/stale.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Number of days of inactivity before an issue becomes stale
2+
daysUntilStale: 60
3+
# Number of days of inactivity before a stale issue is closed
4+
daysUntilClose: 7
5+
# Issues with these labels will never be considered stale
6+
exemptLabels:
7+
- pinned
8+
- security
9+
# Label to use when marking an issue as stale
10+
staleLabel: wontfix
11+
# Comment to post when marking an issue as stale. Set to `false` to disable
12+
markComment: >
13+
This issue has been automatically marked as stale because it has not had
14+
recent activity. It will be closed if no further activity occurs. Thank you
15+
for your contributions.
16+
# Comment to post when closing a stale issue. Set to `false` to disable
17+
closeComment: false

.github/workflows/CompatHelper.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: CompatHelper
2+
on:
3+
schedule:
4+
- cron: '00 00 * * *'
5+
workflow_dispatch:
6+
jobs:
7+
CompatHelper:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Pkg.add("CompatHelper")
11+
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
12+
- name: CompatHelper.main()
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }} # optional
16+
run: julia -e 'using CompatHelper; CompatHelper.main()'

.github/workflows/ci-nightly.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CI-nightly
2+
on:
3+
push:
4+
branches: [stable]
5+
tags: [v*]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
name: Julia nightly - ${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ubuntu-latest]
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: julia-actions/setup-julia@v1
19+
with:
20+
version: nightly
21+
arch: x64
22+
- uses: julia-actions/julia-buildpkg@latest
23+
# remove this after 2.0
24+
- name: test package
25+
run: julia --color=yes --project -e 'using Pkg; Pkg.test(coverage=true, julia_args=["--depwarn=no"])'
26+
continue-on-error: true

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
on:
3+
push:
4+
branches: [stable]
5+
tags: [v*]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
name: Julia ${{ matrix.julia-version }} - ${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
julia-version: [1]
15+
os: [ubuntu-latest]
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: julia-actions/setup-julia@v1
19+
with:
20+
version: ${{ matrix.julia-version }}
21+
arch: x64
22+
- uses: julia-actions/julia-buildpkg@latest
23+
# remove this after 2.0
24+
- name: test package
25+
run: julia --color=yes --project -e 'using Pkg; Pkg.test(coverage=true, julia_args=["--depwarn=no"])'
26+
# uncomment after 2.0
27+
# - uses: julia-actions/julia-runtest@latest
28+
- uses: julia-actions/julia-uploadcodecov@latest
29+
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
30+
if: ${{ matrix.julia-version == '1' && matrix.os =='ubuntu-latest' }}

.github/workflows/documenter.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags: '*'
8+
pull_request:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: julia-actions/setup-julia@latest
16+
- name: Install dependencies
17+
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
18+
- name: Build and deploy
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
21+
run: julia --project=docs/ docs/make.jl

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.DS_Store
2+
*.jl.cov
3+
*.jl.mem
4+
.vscode
5+
docs/build/
6+
docs/site/
7+
benchmark/.results/*
8+
benchmark/.tune.jld
9+
*.cov
10+
Manifest.toml

.zenodo.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"description": "LightGraphs: An Optimized Graphs Package for the Julia Programming Language",
3+
"license": "BSD-2-Clause",
4+
"title": "JuliaGraphs/LightGraphs.jl",
5+
"upload_type": "software",
6+
"publication_date": "2017-09-16",
7+
"creators": [
8+
{
9+
"name": "Seth Bromberger"
10+
},
11+
{
12+
"name": "other contributors"
13+
}],
14+
"access_right": "open",
15+
"related_identifiers": [
16+
{
17+
"scheme": "url",
18+
"identifier": "https://github.com/JuliaGraphs/LightGraphs.jl/tree/v0.10.5",
19+
"relation": "isSupplementTo"
20+
},
21+
{
22+
"scheme": "doi",
23+
"identifier": "10.5281/zenodo.889971",
24+
"relation": "isPartOf"
25+
}
26+
]
27+
}

CITATION.bib

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@misc{Bromberger17,
2+
author = {Seth Bromberger, James Fairbanks, and other contributors},
3+
title = {JuliaGraphs/LightGraphs.jl: an optimized graphs package for the Julia programming language},
4+
year = 2017,
5+
doi = {10.5281/zenodo.889971},
6+
url = {https://doi.org/10.5281/zenodo.889971}
7+
}

CONTRIBUTING.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Contributor Guide
2+
3+
We welcome all possible contributors and ask that you read these guidelines before starting to work on this project. Following these guidelines will reduce friction and improve the speed at which your code gets merged.
4+
5+
## Bug reports
6+
If you notice code that crashes, is incorrect, or is too slow, please file a bug report. The report should be raised as a github issue with a minimal working example that reproduces the condition. The example should include any data needed. If the problem is incorrectness, then please post the correct result along with an incorrect result.
7+
8+
Please include version numbers of all relevant libraries and Julia itself.
9+
10+
## Development guidelines
11+
12+
- Correctness is a necessary requirement; efficiency is desirable. Once you have a correct implementation, make a PR so we can help improve performance.
13+
- PRs should contain one logical enhancement to the codebase.
14+
- Squash commits in a PR.
15+
- Open an issue to discuss a feature before you start coding (this maximizes the likelihood of patch acceptance).
16+
- Minimize dependencies on external packages, and avoid introducing new dependencies. In general,
17+
18+
- PRs introducing dependencies on Julia Base or the packages in the Julia Standard Library are ok.
19+
- PRs introducing dependencies on third-party non-core "leaf" packages (no subdependencies except for Julia Base / Standard Library packages) are less ok.
20+
- PRs introducing dependencies on third-party non-core non-leaf packages (that is, third-party packages that have dependencies on one or more other third-party packages) require strict scrutiny and will likely not be accepted without some compelling reason (urgent bugfix or much-needed functionality).
21+
22+
- Put type assertions on all function arguments where conflict may arise (use abstract types, `Union`, or `Any` if necessary).
23+
- If the algorithm was presented in a paper, include a reference to the paper (_e.g._, a proper academic citation along with an eprint link).
24+
- Take steps to ensure that code works correctly and efficiently on disconnected graphs.
25+
- We can accept code that does not work for directed graphs as long as it comes with an explanation of what it would take to make it work for directed graphs.
26+
- Prefer the short circuiting conditional over `if`/`else` when convenient, and where state is not explicitly being mutated (*e.g.*, `condition && error("message")` is good; `condition && i += 1` is not).
27+
- Write code to reuse memory wherever possible. For example:
28+
```julia
29+
function f(g, v)
30+
storage = Vector{Int}(undef, nv(g))
31+
# some code operating on storage, g, and v.
32+
for i in 1:nv(g)
33+
storage[i] = v-i
34+
end
35+
return sum(storage)
36+
end
37+
```
38+
should be rewritten as two functions
39+
```julia
40+
function f(g::AbstractGraph, v::Integer)
41+
storage = Vector{Int}(undef, nv(g))
42+
return f!(g, v, storage)
43+
end
44+
45+
function f!(g::AbstractGraph, v::Integer, storage::AbstractVector{Int})
46+
# some code operating on storage, g, and v.
47+
for i in 1:nv(g)
48+
storage[i] = v-i
49+
end
50+
return sum(storage)
51+
end
52+
```
53+
This gives users the option of reusing memory and improving performance.
54+
55+
### Minimizing use of internal struct fields
56+
Since LightGraphs supports multiple implementations of the graph datastructure using the `AbstractGraph` [type](https://juliagraphs.github.io/LightGraphs.jl/latest/types.html#AbstractGraph-Type-1), you should refrain from using the internal fields of structs such as `fadjlist`. Instead, you should use the functions provided in the api. Code that is instrumental to defining a concrete graph type can use the internal structure of that type for example graph generators in `/src/StaticGraphs/generators/staticgraphs.jl` use the `fadjlist` field in order to construct graphs efficiently.
57+
58+
## Git usage
59+
60+
In order to make it easier for you to review Pull Requests (PRs), you can add this to your git config file, which should be located at `$HOME/.julia/dev/LightGraphs/.git/config`. Follow the instructions [here](https://gist.github.com/piscisaureus/3342247).
61+
62+
Locate the section for your github remote in the `.git/config` file. It looks like this:
63+
64+
```
65+
[remote "origin"]
66+
fetch = +refs/heads/*:refs/remotes/origin/*
67+
url = [email protected]:JuliaGraphs/LightGraphs.jl.git
68+
```
69+
70+
Now add the line `fetch = +refs/pull/*/head:refs/remotes/origin/pr/*` to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
71+
72+
```
73+
[remote "origin"]
74+
fetch = +refs/heads/*:refs/remotes/origin/*
75+
url = [email protected]:JuliaGraphs/LightGraphs.jl.git
76+
fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
77+
```
78+
79+
Now fetch all the pull requests:
80+
81+
```
82+
$ git fetch origin
83+
From github.com:JuliaGraphs/LightGraphs.jl
84+
* [new ref] refs/pull/1000/head -> origin/pr/1000
85+
* [new ref] refs/pull/1002/head -> origin/pr/1002
86+
* [new ref] refs/pull/1004/head -> origin/pr/1004
87+
* [new ref] refs/pull/1009/head -> origin/pr/1009
88+
...
89+
```
90+
91+
To check out a particular pull request:
92+
93+
```
94+
$ git checkout pr/999
95+
Branch pr/999 set up to track remote branch pr/999 from origin.
96+
Switched to a new branch 'pr/999'
97+
```
98+
99+
Now you can test a PR by running `git fetch && git checkout pr/PRNUMBER && julia -e 'Pkg.test("LightGraphs")'`

0 commit comments

Comments
 (0)