diff --git a/.github/workflows/Lint.yml b/.github/workflows/Lint.yml index b1d1376..2497f4e 100644 --- a/.github/workflows/Lint.yml +++ b/.github/workflows/Lint.yml @@ -27,7 +27,7 @@ jobs: - name: Use Julia cache uses: julia-actions/cache@v2 - name: Install JuliaFormatter.jl - run: julia -e 'using Pkg; pkg"add JuliaFormatter"' + run: julia -e 'using Pkg; pkg"add JuliaFormatter@1"' - name: Setup Python uses: actions/setup-python@v5 with: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8210811..f26f644 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: language: fail files: "\\.rej$" - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: check-json - id: check-toml @@ -26,7 +26,7 @@ repos: - id: check-merge-conflict args: [--assume-in-merge] - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.41.0 + rev: v0.45.0 hooks: - id: markdownlint-fix - repo: https://github.com/citation-file-format/cffconvert @@ -40,10 +40,10 @@ repos: types_or: [yaml, json] exclude: ".copier-answers.yml" - repo: https://github.com/adrienverge/yamllint - rev: v1.35.1 + rev: v1.37.1 hooks: - id: yamllint - repo: https://github.com/domluna/JuliaFormatter.jl - rev: v1.0.60 + rev: v1.0.62 hooks: - id: julia-formatter diff --git a/Project.toml b/Project.toml index 3b31238..9b4714d 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "GraphDynamicalSystems" uuid = "13529e2e-ed53-56b1-bd6f-420b01fca819" authors = ["Reuben Gardos Reid <5456207+ReubenJ@users.noreply.github.com>"] -version = "0.2.0" +version = "0.0.2" [deps] AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" diff --git a/src/boolean_networks.jl b/src/boolean_networks.jl index 38ad43d..81155c9 100644 --- a/src/boolean_networks.jl +++ b/src/boolean_networks.jl @@ -6,7 +6,7 @@ module BooleanNetworks using DocStringExtensions using MetaGraphsNext: MetaGraph, add_edge!, SimpleDiGraph, nv, labels -using DynamicalSystemsBase: ArbitrarySteppable, current_parameters +using DynamicalSystemsBase: ArbitrarySteppable, current_parameters, initial_state using SoleLogics: Formula, Atom, diff --git a/src/qualitative_networks.jl b/src/qualitative_networks.jl index a35487f..f4bb2f8 100644 --- a/src/qualitative_networks.jl +++ b/src/qualitative_networks.jl @@ -241,10 +241,9 @@ end Interpret target functions from a [`QualitativeNetwork`](@ref). """ -function interpret(e::Union{Expr,Symbol,Int,Atom}, qn::QN) +function interpret(e::Union{Expr,Symbol,Int}, qn::QN) @match e begin ::Symbol => get_state(qn, e) - ::Atom => get_state(qn, Symbol(value(e))) ::Int => e :($v1 + $v2) => interpret(v1, qn) + interpret(v2, qn) :($v1 - $v2) => interpret(v1, qn) - interpret(v2, qn) @@ -257,6 +256,7 @@ function interpret(e::Union{Expr,Symbol,Int,Atom}, qn::QN) _ => error("Unhandled Expr in `interpret`: $e") end end +interpret(e::Atom, qn::QN) = get_state(qn, Symbol(value(e))) """ $(TYPEDSIGNATURES)