Skip to content

Commit ad6667a

Browse files
InterdisciplinaryPhysicsTeampitmonticoneClaudMor
committed
Add format checking workflow
Co-Authored-By: Pietro Monticone <38562595+pitmonticone@users.noreply.github.com> Co-Authored-By: Claudio Moroni <43729990+ClaudMor@users.noreply.github.com>
1 parent 896981a commit ad6667a

26 files changed

+1887
-867
lines changed

.JuliaFormatter.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
style = "blue"

.github/workflows/CompatHelper.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CompatHelper
1+
name: Compat Helper
22
on:
33
schedule:
44
- cron: 0 0 * * *

.github/workflows/FormatCheck.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Format Check
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
- 'release-'
8+
tags: '*'
9+
pull_request:
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: julia-actions/setup-julia@latest
16+
with:
17+
version: 1
18+
- uses: actions/checkout@v1
19+
- name: Install JuliaFormatter
20+
run: |
21+
using Pkg
22+
Pkg.add("JuliaFormatter")
23+
shell: julia --color=yes {0}
24+
- name: Format code
25+
run: |
26+
using JuliaFormatter
27+
format("."; verbose=true)
28+
shell: julia --color=yes {0}
29+
- name: Suggest formatting changes
30+
uses: reviewdog/action-suggester@v1
31+
if: github.event_name == 'pull_request'
32+
with:
33+
tool_name: JuliaFormatter
34+
fail_on_error: true

.github/workflows/TagBot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: TagBot
1+
name: Tag Bot
22
on:
33
issue_comment:
44
types:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ docs/site/
2828
# committed for packages, but should be committed for applications that require a static
2929
# environment.
3030
Manifest.toml
31+
32+
# Formatting files
33+
formatter.jl

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
[![Build Status](https://github.com/InPhyT/MultilayerGraphs.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/InPhyT/MultilayerGraphs.jl/actions/workflows/CI.yml?query=branch%3Amain)
77
[![codecov](https://codecov.io/gh/InPhyT/MultilayerGraphs.jl/branch/main/graph/badge.svg?token=Z758JuxDJX)](https://codecov.io/gh/InPhyT/MultilayerGraphs.jl)
88
[![Coverage Status](https://coveralls.io/repos/github/InPhyT/MultilayerGraphs.jl/badge.svg?branch=main)](https://coveralls.io/github/InPhyT/MultilayerGraphs.jl?branch=main)
9+
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)
910
[![DOI](https://zenodo.org/badge/XXXXXXXXX.svg)](https://zenodo.org/badge/latestdoi/XXXXXXXXX)
1011

1112
<img align="right" width="215" height="215" src="https://github.com/InPhyT/MultilayerGraphs.jl/blob/main/docs/src/assets/logo.png?raw=true">

docs/make.jl

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
using MultilayerGraphs
22
using Documenter
33

4-
DocMeta.setdocmeta!(MultilayerGraphs, :DocTestSetup, :(using MultilayerGraphs); recursive=true)
4+
DocMeta.setdocmeta!(
5+
MultilayerGraphs, :DocTestSetup, :(using MultilayerGraphs); recursive=true
6+
)
57

68
makedocs(;
79
modules=[MultilayerGraphs],
@@ -13,14 +15,9 @@ makedocs(;
1315
canonical="https://InPhyT.github.io/MultilayerGraphs.jl",
1416
assets=String[],
1517
),
16-
pages=[
17-
"Home" => "index.md",
18-
"Internals" => "internals.md"
19-
],
18+
pages=["Home" => "index.md", "Internals" => "internals.md"],
2019
)
2120

2221
deploydocs(;
23-
repo="github.com/InPhyT/MultilayerGraphs.jl",
24-
devbranch="main",
25-
push_preview = true
22+
repo="github.com/InPhyT/MultilayerGraphs.jl", devbranch="main", push_preview=true
2623
)

docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ CurrentModule = MultilayerGraphs
2020

2121
**MultilayerGraphs.jl** implements the mathematical formulation of multilayer graphs proposed by [De Domenico et al. (2013)](https://doi.org/10.1103/PhysRevX.3.041022). It mainly revolves around two custom types, [`MultilayerGraph`](@ref) and [`MultilayerDiGraph`](@ref), encoding undirected and directed multilayer graphs respectively.
2222

23-
Roughly speaking, a multilayer graph is a collection of ***layers***, i.e. graphs whose vertices are representations of the same set of nodes, and ***interlayers***, i.e the [bipartite graphs](https://en.wikipedia.org/wiki/Bipartite_graph) whose vertices are those of any two layers and whose edges are those between vertices of the same two layers. See below for the distinction between ***nodes*** and ***vertices***.
23+
Roughly speaking, a multilayer graph is a collection of *layers*, i.e. graphs whose vertices are representations of the same set of nodes, and *interlayers*, i.e the [bipartite graphs](https://en.wikipedia.org/wiki/Bipartite_graph) whose vertices are those of any two layers and whose edges are those between vertices of the same two layers. See below for the distinction between ***nodes*** and ***vertices***.
2424

2525
[`MultilayerGraph`](@ref) and [`MultilayerDiGraph`](@ref) are fully-fledged [Graphs.jl](https://github.com/JuliaGraphs/Graphs.jl) extensions. Both structs are designed so that their layers and interlayers can be of any type (as long as they are Graphs.jl extensions themselves) and they need not be all of the same type. It is anyway required that all layers and interlayers of [`MultilayerGraph`](@ref) and [`MultilayerDiGraph`](@ref) are respectively undirected and directed. Directedness is checked via the `IsDirected` trait defined in Graphs.jl adopting [SimpleTraits.jl](https://github.com/mauro3/SimpleTraits.jl). Since the layers' and interlayers' graph types don't need to be the same, multilayer graph types are considered weighted graphs by default, and thus are assigned the trait `IsWeighted`.
2626

src/MultilayerGraphs.jl

Lines changed: 63 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,69 @@
11
module MultilayerGraphs
22

3-
export getindex, δ_Ω, tensoreig,
4-
AbstractMultilayerGraph,
5-
IsWeighted,
6-
MultilayerGraph, MultilayerDiGraph, MultilayerGraph_m, MultilayerGraph_mcsc, MultilayerGraph_csc,
7-
MultiplexGraph,
8-
AbstractVertex, AbstractMultilayerVertex, MultilayerVertex,
9-
AbstractMultilayerEdge, MultilayerEdge, MultilayerWeightedEdge,
10-
GraphOfGraphs,DiGraphOfGraphs,
11-
AbstractBipartiteGraph, SimpleBipartiteGraph, add_edge!,
12-
Layer,
13-
Interlayer, get_symmetric_interlayer,
14-
add_layer!,get_layer, specify_interlayer!, get_interlayer, get_subgraph,
15-
indegree, outdegree,degree,neighbors,
16-
edges, is_directed, eltype,edgetype, has_edge, has_vertex, inneighbors, ne, nv, nn, outneighbors,vertices, nodes,
17-
mean_degree, degree_second_moment,degree_variance, multilayer_global_clustering_coefficient, multilayer_weighted_global_clustering_coefficient, overlay_clustering_coefficient,eigenvector_centrality, eigenvector_centrality_2, modularity, von_neumann_entropy,
18-
get_projected_monoplex_graph, get_overlay_monoplex_graph, get_graph_of_layers,
19-
get_oom
3+
export getindex,
4+
δ_Ω,
5+
tensoreig,
6+
AbstractMultilayerGraph,
7+
IsWeighted,
8+
MultilayerGraph,
9+
MultilayerDiGraph,
10+
MultilayerGraph_m,
11+
MultilayerGraph_mcsc,
12+
MultilayerGraph_csc,
13+
MultiplexGraph,
14+
AbstractVertex,
15+
AbstractMultilayerVertex,
16+
MultilayerVertex,
17+
AbstractMultilayerEdge,
18+
MultilayerEdge,
19+
MultilayerWeightedEdge,
20+
GraphOfGraphs,
21+
DiGraphOfGraphs,
22+
AbstractBipartiteGraph,
23+
SimpleBipartiteGraph,
24+
add_edge!,
25+
Layer,
26+
Interlayer,
27+
get_symmetric_interlayer,
28+
add_layer!,
29+
get_layer,
30+
specify_interlayer!,
31+
get_interlayer,
32+
get_subgraph,
33+
indegree,
34+
outdegree,
35+
degree,
36+
neighbors,
37+
edges,
38+
is_directed,
39+
eltype,
40+
edgetype,
41+
has_edge,
42+
has_vertex,
43+
inneighbors,
44+
ne,
45+
nv,
46+
nn,
47+
outneighbors,
48+
vertices,
49+
nodes,
50+
mean_degree,
51+
degree_second_moment,
52+
degree_variance,
53+
multilayer_global_clustering_coefficient,
54+
multilayer_weighted_global_clustering_coefficient,
55+
overlay_clustering_coefficient,
56+
eigenvector_centrality,
57+
eigenvector_centrality_2,
58+
modularity,
59+
von_neumann_entropy,
60+
get_projected_monoplex_graph,
61+
get_overlay_monoplex_graph,
62+
get_graph_of_layers,
63+
get_oom
2064

2165
using Base, InteractiveUtils, IterTools, SimpleTraits
22-
using LinearAlgebra, Statistics, OMEinsum, TensorOperations
66+
using LinearAlgebra, Statistics, OMEinsum, TensorOperations
2367
using DataStructures, SparseArrays
2468
using Graphs, SimpleWeightedGraphs, MetaGraphs, SimpleValueGraphs
2569

@@ -36,4 +80,4 @@ include("abstractmultilayergraph.jl")
3680
include("multilayerdigraph.jl")
3781
include("multilayergraph.jl")
3882

39-
end
83+
end

0 commit comments

Comments
 (0)