-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
262 changed files
with
27,162 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
name: Bug report | ||
about: Report a bug with LightGraphs | ||
title: "[BUG]" | ||
labels: bug | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Description of bug** | ||
Describe the bug clearly and concisely. | ||
|
||
|
||
**How to reproduce** | ||
Detail steps to reproduce the behavior. | ||
|
||
|
||
**Expected behavior** | ||
Describe what you expected to happen. | ||
|
||
|
||
**Actual behavior** | ||
Describe what actually happened. | ||
|
||
|
||
**Code demonstrating bug** | ||
If applicable, provide a minimal working example of the bug. | ||
|
||
|
||
**Version information** | ||
- output from `versioninfo()` surrounded by backticks (``) | ||
- output from `] status LightGraphs` surrounded by backticks (``) | ||
|
||
|
||
**Additional context** | ||
Add any other context about the problem here. |
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,17 @@ | ||
# Number of days of inactivity before an issue becomes stale | ||
daysUntilStale: 60 | ||
# Number of days of inactivity before a stale issue is closed | ||
daysUntilClose: 7 | ||
# Issues with these labels will never be considered stale | ||
exemptLabels: | ||
- pinned | ||
- security | ||
# Label to use when marking an issue as stale | ||
staleLabel: wontfix | ||
# Comment to post when marking an issue as stale. Set to `false` to disable | ||
markComment: > | ||
This issue has been automatically marked as stale because it has not had | ||
recent activity. It will be closed if no further activity occurs. Thank you | ||
for your contributions. | ||
# Comment to post when closing a stale issue. Set to `false` to disable | ||
closeComment: false |
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,16 @@ | ||
name: CompatHelper | ||
on: | ||
schedule: | ||
- cron: '00 00 * * *' | ||
workflow_dispatch: | ||
jobs: | ||
CompatHelper: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Pkg.add("CompatHelper") | ||
run: julia -e 'using Pkg; Pkg.add("CompatHelper")' | ||
- name: CompatHelper.main() | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }} # optional | ||
run: julia -e 'using CompatHelper; CompatHelper.main()' |
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,26 @@ | ||
name: CI-nightly | ||
on: | ||
push: | ||
branches: [stable] | ||
tags: [v*] | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
name: Julia nightly - ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: julia-actions/setup-julia@v1 | ||
with: | ||
version: nightly | ||
arch: x64 | ||
- uses: julia-actions/julia-buildpkg@latest | ||
# remove this after 2.0 | ||
- name: test package | ||
run: julia --color=yes --project -e 'using Pkg; Pkg.test(coverage=true, julia_args=["--depwarn=no"])' | ||
continue-on-error: true |
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,30 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: [stable] | ||
tags: [v*] | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
name: Julia ${{ matrix.julia-version }} - ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
julia-version: [1] | ||
os: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: julia-actions/setup-julia@v1 | ||
with: | ||
version: ${{ matrix.julia-version }} | ||
arch: x64 | ||
- uses: julia-actions/julia-buildpkg@latest | ||
# remove this after 2.0 | ||
- name: test package | ||
run: julia --color=yes --project -e 'using Pkg; Pkg.test(coverage=true, julia_args=["--depwarn=no"])' | ||
# uncomment after 2.0 | ||
# - uses: julia-actions/julia-runtest@latest | ||
- uses: julia-actions/julia-uploadcodecov@latest | ||
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
if: ${{ matrix.julia-version == '1' && matrix.os =='ubuntu-latest' }} |
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,21 @@ | ||
name: Documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: '*' | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: julia-actions/setup-julia@latest | ||
- name: Install dependencies | ||
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' | ||
- name: Build and deploy | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token | ||
run: julia --project=docs/ docs/make.jl |
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,10 @@ | ||
.DS_Store | ||
*.jl.cov | ||
*.jl.mem | ||
.vscode | ||
docs/build/ | ||
docs/site/ | ||
benchmark/.results/* | ||
benchmark/.tune.jld | ||
*.cov | ||
Manifest.toml |
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,27 @@ | ||
{ | ||
"description": "LightGraphs: An Optimized Graphs Package for the Julia Programming Language", | ||
"license": "BSD-2-Clause", | ||
"title": "JuliaGraphs/LightGraphs.jl", | ||
"upload_type": "software", | ||
"publication_date": "2017-09-16", | ||
"creators": [ | ||
{ | ||
"name": "Seth Bromberger" | ||
}, | ||
{ | ||
"name": "other contributors" | ||
}], | ||
"access_right": "open", | ||
"related_identifiers": [ | ||
{ | ||
"scheme": "url", | ||
"identifier": "https://github.com/JuliaGraphs/LightGraphs.jl/tree/v0.10.5", | ||
"relation": "isSupplementTo" | ||
}, | ||
{ | ||
"scheme": "doi", | ||
"identifier": "10.5281/zenodo.889971", | ||
"relation": "isPartOf" | ||
} | ||
] | ||
} |
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,7 @@ | ||
@misc{Bromberger17, | ||
author = {Seth Bromberger, James Fairbanks, and other contributors}, | ||
title = {JuliaGraphs/LightGraphs.jl: an optimized graphs package for the Julia programming language}, | ||
year = 2017, | ||
doi = {10.5281/zenodo.889971}, | ||
url = {https://doi.org/10.5281/zenodo.889971} | ||
} |
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,99 @@ | ||
# Contributor Guide | ||
|
||
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. | ||
|
||
## Bug reports | ||
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. | ||
|
||
Please include version numbers of all relevant libraries and Julia itself. | ||
|
||
## Development guidelines | ||
|
||
- Correctness is a necessary requirement; efficiency is desirable. Once you have a correct implementation, make a PR so we can help improve performance. | ||
- PRs should contain one logical enhancement to the codebase. | ||
- Squash commits in a PR. | ||
- Open an issue to discuss a feature before you start coding (this maximizes the likelihood of patch acceptance). | ||
- Minimize dependencies on external packages, and avoid introducing new dependencies. In general, | ||
|
||
- PRs introducing dependencies on Julia Base or the packages in the Julia Standard Library are ok. | ||
- PRs introducing dependencies on third-party non-core "leaf" packages (no subdependencies except for Julia Base / Standard Library packages) are less ok. | ||
- 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). | ||
|
||
- Put type assertions on all function arguments where conflict may arise (use abstract types, `Union`, or `Any` if necessary). | ||
- 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). | ||
- Take steps to ensure that code works correctly and efficiently on disconnected graphs. | ||
- 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. | ||
- 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). | ||
- Write code to reuse memory wherever possible. For example: | ||
```julia | ||
function f(g, v) | ||
storage = Vector{Int}(undef, nv(g)) | ||
# some code operating on storage, g, and v. | ||
for i in 1:nv(g) | ||
storage[i] = v-i | ||
end | ||
return sum(storage) | ||
end | ||
``` | ||
should be rewritten as two functions | ||
```julia | ||
function f(g::AbstractGraph, v::Integer) | ||
storage = Vector{Int}(undef, nv(g)) | ||
return f!(g, v, storage) | ||
end | ||
|
||
function f!(g::AbstractGraph, v::Integer, storage::AbstractVector{Int}) | ||
# some code operating on storage, g, and v. | ||
for i in 1:nv(g) | ||
storage[i] = v-i | ||
end | ||
return sum(storage) | ||
end | ||
``` | ||
This gives users the option of reusing memory and improving performance. | ||
|
||
### Minimizing use of internal struct fields | ||
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. | ||
|
||
## Git usage | ||
|
||
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). | ||
|
||
Locate the section for your github remote in the `.git/config` file. It looks like this: | ||
|
||
``` | ||
[remote "origin"] | ||
fetch = +refs/heads/*:refs/remotes/origin/* | ||
url = [email protected]:JuliaGraphs/LightGraphs.jl.git | ||
``` | ||
|
||
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: | ||
|
||
``` | ||
[remote "origin"] | ||
fetch = +refs/heads/*:refs/remotes/origin/* | ||
url = [email protected]:JuliaGraphs/LightGraphs.jl.git | ||
fetch = +refs/pull/*/head:refs/remotes/origin/pr/* | ||
``` | ||
|
||
Now fetch all the pull requests: | ||
|
||
``` | ||
$ git fetch origin | ||
From github.com:JuliaGraphs/LightGraphs.jl | ||
* [new ref] refs/pull/1000/head -> origin/pr/1000 | ||
* [new ref] refs/pull/1002/head -> origin/pr/1002 | ||
* [new ref] refs/pull/1004/head -> origin/pr/1004 | ||
* [new ref] refs/pull/1009/head -> origin/pr/1009 | ||
... | ||
``` | ||
|
||
To check out a particular pull request: | ||
|
||
``` | ||
$ git checkout pr/999 | ||
Branch pr/999 set up to track remote branch pr/999 from origin. | ||
Switched to a new branch 'pr/999' | ||
``` | ||
|
||
Now you can test a PR by running `git fetch && git checkout pr/PRNUMBER && julia -e 'Pkg.test("LightGraphs")'` |
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,82 @@ | ||
The LightGraphs.jl package is licensed under the Simplified "2-clause" BSD | ||
License: | ||
> Copyright (c) 2015: Seth Bromberger and other 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. | ||
> | ||
> 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 | ||
> OWNER 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. | ||
LightGraphs uses code derived from and/or inspired by the following packages: | ||
|
||
NetworkX: | ||
> Copyright (C) 2004-2012, NetworkX Developers | ||
> Aric Hagberg <[email protected]> | ||
> Dan Schult <[email protected]> | ||
> Pieter Swart <[email protected]> | ||
> All rights reserved. | ||
> | ||
> Redistribution and use in source and binary forms, with or without | ||
> modification, are permitted provided that the following conditions are | ||
> met: | ||
> | ||
> * Redistributions of source code must retain the above copyright | ||
> notice, this list of conditions and the following disclaimer. | ||
> | ||
> * Redistributions in binary form must reproduce the above | ||
> with the distribution. | ||
> | ||
> * Neither the name of the NetworkX Developers 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 | ||
> OWNER 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. | ||
Graphs.jl: | ||
> Copyright (c) 2012: John Myles White and other contributors. | ||
> Permission is hereby granted, free of charge, to any person obtaining a copy | ||
> of this software and associated documentation files (the "Software"), to deal | ||
> in the Software without restriction, including without limitation the rights | ||
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
> copies of the Software, and to permit persons to whom the Software is | ||
> furnished to do so, subject to the following conditions: | ||
> | ||
> The above copyright notice and this permission notice shall be included in | ||
> all copies or substantial portions of the Software. | ||
> | ||
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
> SOFTWARE. |
Oops, something went wrong.