diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index f46370a..e1eb6a8 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -3,13 +3,13 @@ name: Deploy Docs # Controls when the action will run. Triggers the workflow on push or pull request # events but only for the master branch on: - workflow_dispatch: - push: + workflow_dispatch: + pull_request: branches: - master + main env: diff --git a/README.md b/README.md index c5edc45..bb56af6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # DAGs.jl -[![Unit Tests](https://github.com/Juice-jl/DAGs.jl/workflows/Unit%20Tests/badge.svg)](https://github.com/Juice-jl/DAGs.jl/actions?query=workflow%3A%22Unit+Tests%22+branch%3Amain) [![codecov](https://codecov.io/gh/Juice-jl/DAGs.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/Juice-jl/DAGs.jl) +[![Unit Tests](https://github.com/Juice-jl/DAGs.jl/workflows/Unit%20Tests/badge.svg)](https://github.com/Juice-jl/DAGs.jl/actions?query=workflow%3A%22Unit+Tests%22+branch%3Amain) [![codecov](https://codecov.io/gh/Juice-jl/DAGs.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/Juice-jl/DAGs.jl) [![](https://img.shields.io/badge/docs-dev-blue.svg)](https://juice-jl.github.io/DAGs.jl/dev/) Infrastructure to work with Directed Acyclic Graphs in Julia diff --git a/docs/make.jl b/docs/make.jl index 2836ca6..3f4b451 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -14,7 +14,7 @@ pages = [ format = Documenter.HTML( prettyurls = !("local" in ARGS), - canonical = "https://github.com/Juice-jl/DAGs.jl/stable/", + canonical = "https://juice-jl.github.io/DAGs.jl/stable/", assets = ["assets/favicon.ico"], analytics = "UA-136089579-2", highlights = ["yaml"], @@ -41,7 +41,7 @@ deploydocs( target = "build", repo = "github.com/Juice-jl/DAGs.jl.git", branch = "gh-pages", - devbranch = "master", + devbranch = "main", devurl = "dev", versions = ["stable" => "v^", "v#.#"], -) \ No newline at end of file +) diff --git a/src/graphs.jl b/src/graphs.jl index 45c5fe9..8a8f8cd 100644 --- a/src/graphs.jl +++ b/src/graphs.jl @@ -286,7 +286,9 @@ function num_parents(root::DAG) count[root] = 0 foreach(root) do n if isinner(n) - count[n] = get(count,n,0) + 1 + for c in children(n) + count[c] = get(count, c, 0) + 1 + end end end count diff --git a/test/graphs_test.jl b/test/graphs_test.jl index b78b1ec..66a0e82 100644 --- a/test/graphs_test.jl +++ b/test/graphs_test.jl @@ -100,6 +100,10 @@ module TestNodes @test left_most_descendent(r) == l1 @test right_most_descendent(r) == l2 + np = num_parents(r) + @test np[r] == 0 + @test np[l1] == 2 + @test np[j1] == 1 end end \ No newline at end of file