Skip to content

Commit

Permalink
Add format checking workflow
Browse files Browse the repository at this point in the history
Co-Authored-By: Pietro Monticone <[email protected]>
Co-Authored-By: Claudio Moroni <[email protected]>
  • Loading branch information
3 people committed Aug 18, 2022
1 parent 896981a commit ad6667a
Show file tree
Hide file tree
Showing 26 changed files with 1,887 additions and 867 deletions.
1 change: 1 addition & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
style = "blue"
2 changes: 1 addition & 1 deletion .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CompatHelper
name: Compat Helper
on:
schedule:
- cron: 0 0 * * *
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/FormatCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Format Check

on:
push:
branches:
- 'main'
- 'release-'
tags: '*'
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: julia-actions/setup-julia@latest
with:
version: 1
- uses: actions/checkout@v1
- name: Install JuliaFormatter
run: |
using Pkg
Pkg.add("JuliaFormatter")
shell: julia --color=yes {0}
- name: Format code
run: |
using JuliaFormatter
format("."; verbose=true)
shell: julia --color=yes {0}
- name: Suggest formatting changes
uses: reviewdog/action-suggester@v1
if: github.event_name == 'pull_request'
with:
tool_name: JuliaFormatter
fail_on_error: true
2 changes: 1 addition & 1 deletion .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: TagBot
name: Tag Bot
on:
issue_comment:
types:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ docs/site/
# committed for packages, but should be committed for applications that require a static
# environment.
Manifest.toml

# Formatting files
formatter.jl
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
[![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)
[![codecov](https://codecov.io/gh/InPhyT/MultilayerGraphs.jl/branch/main/graph/badge.svg?token=Z758JuxDJX)](https://codecov.io/gh/InPhyT/MultilayerGraphs.jl)
[![Coverage Status](https://coveralls.io/repos/github/InPhyT/MultilayerGraphs.jl/badge.svg?branch=main)](https://coveralls.io/github/InPhyT/MultilayerGraphs.jl?branch=main)
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)
[![DOI](https://zenodo.org/badge/XXXXXXXXX.svg)](https://zenodo.org/badge/latestdoi/XXXXXXXXX)

<img align="right" width="215" height="215" src="https://github.com/InPhyT/MultilayerGraphs.jl/blob/main/docs/src/assets/logo.png?raw=true">
Expand Down
13 changes: 5 additions & 8 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using MultilayerGraphs
using Documenter

DocMeta.setdocmeta!(MultilayerGraphs, :DocTestSetup, :(using MultilayerGraphs); recursive=true)
DocMeta.setdocmeta!(
MultilayerGraphs, :DocTestSetup, :(using MultilayerGraphs); recursive=true
)

makedocs(;
modules=[MultilayerGraphs],
Expand All @@ -13,14 +15,9 @@ makedocs(;
canonical="https://InPhyT.github.io/MultilayerGraphs.jl",
assets=String[],
),
pages=[
"Home" => "index.md",
"Internals" => "internals.md"
],
pages=["Home" => "index.md", "Internals" => "internals.md"],
)

deploydocs(;
repo="github.com/InPhyT/MultilayerGraphs.jl",
devbranch="main",
push_preview = true
repo="github.com/InPhyT/MultilayerGraphs.jl", devbranch="main", push_preview=true
)
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ CurrentModule = MultilayerGraphs

**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.

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***.
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***.

[`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`.

Expand Down
82 changes: 63 additions & 19 deletions src/MultilayerGraphs.jl
Original file line number Diff line number Diff line change
@@ -1,25 +1,69 @@
module MultilayerGraphs

export getindex, δ_Ω, tensoreig,
AbstractMultilayerGraph,
IsWeighted,
MultilayerGraph, MultilayerDiGraph, MultilayerGraph_m, MultilayerGraph_mcsc, MultilayerGraph_csc,
MultiplexGraph,
AbstractVertex, AbstractMultilayerVertex, MultilayerVertex,
AbstractMultilayerEdge, MultilayerEdge, MultilayerWeightedEdge,
GraphOfGraphs,DiGraphOfGraphs,
AbstractBipartiteGraph, SimpleBipartiteGraph, add_edge!,
Layer,
Interlayer, get_symmetric_interlayer,
add_layer!,get_layer, specify_interlayer!, get_interlayer, get_subgraph,
indegree, outdegree,degree,neighbors,
edges, is_directed, eltype,edgetype, has_edge, has_vertex, inneighbors, ne, nv, nn, outneighbors,vertices, nodes,
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,
get_projected_monoplex_graph, get_overlay_monoplex_graph, get_graph_of_layers,
get_oom
export getindex,
δ_Ω,
tensoreig,
AbstractMultilayerGraph,
IsWeighted,
MultilayerGraph,
MultilayerDiGraph,
MultilayerGraph_m,
MultilayerGraph_mcsc,
MultilayerGraph_csc,
MultiplexGraph,
AbstractVertex,
AbstractMultilayerVertex,
MultilayerVertex,
AbstractMultilayerEdge,
MultilayerEdge,
MultilayerWeightedEdge,
GraphOfGraphs,
DiGraphOfGraphs,
AbstractBipartiteGraph,
SimpleBipartiteGraph,
add_edge!,
Layer,
Interlayer,
get_symmetric_interlayer,
add_layer!,
get_layer,
specify_interlayer!,
get_interlayer,
get_subgraph,
indegree,
outdegree,
degree,
neighbors,
edges,
is_directed,
eltype,
edgetype,
has_edge,
has_vertex,
inneighbors,
ne,
nv,
nn,
outneighbors,
vertices,
nodes,
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,
get_projected_monoplex_graph,
get_overlay_monoplex_graph,
get_graph_of_layers,
get_oom

using Base, InteractiveUtils, IterTools, SimpleTraits
using LinearAlgebra, Statistics, OMEinsum, TensorOperations
using LinearAlgebra, Statistics, OMEinsum, TensorOperations
using DataStructures, SparseArrays
using Graphs, SimpleWeightedGraphs, MetaGraphs, SimpleValueGraphs

Expand All @@ -36,4 +80,4 @@ include("abstractmultilayergraph.jl")
include("multilayerdigraph.jl")
include("multilayergraph.jl")

end
end
Loading

0 comments on commit ad6667a

Please sign in to comment.