From 05e73cf40269f853766472ddcc5f8c3c9d61d376 Mon Sep 17 00:00:00 2001 From: timkittel <19408882+timkittel@users.noreply.github.com> Date: Mon, 11 Mar 2019 10:22:24 +0100 Subject: [PATCH 1/4] added update to get most recent subpackages --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b481b42..33c80c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,8 @@ env: before_script: - julia -e 'using Pkg; Pkg.add(PackageSpec(name="MbedTLS", version="0.6.6")); - Pkg.pin(PackageSpec(name="MbedTLS", version="0.6.6"));' + Pkg.pin(PackageSpec(name="MbedTLS", version="0.6.6")); + Pkg.update();' script: - if [ $JULIA_COVERAGE_VERSION == $TRAVIS_JULIA_VERSION ]; then export PUSH_COVERAGE=true; else export PUSH_COVERAGE=false; fi From 1eccdb956c4268ac239a02f86e96d6abbaca6cf5 Mon Sep 17 00:00:00 2001 From: timkittel <19408882+timkittel@users.noreply.github.com> Date: Mon, 11 Mar 2019 10:31:26 +0100 Subject: [PATCH 2/4] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82e0550..9a00697 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,3 +9,4 @@ * ![enhancement](https://img.shields.io/badge/PD-enhancement-%23a2eeef.svg) [fixing node docs](https://github.com/JuliaEnergy/PowerDynBase.jl/pull/46) * ![miscellaneous](https://img.shields.io/badge/PD-miscellaneous-lightgrey.svg) [add Sabine Auer to AUTHORS](https://github.com/JuliaEnergy/PowerDynBase.jl/pull/45) * ![bugfix](https://img.shields.io/badge/PD-bugfix-%23d73a4a.svg) [temporarily pin MbedTLS version to 0.6.6 to fix travis ci issue](https://github.com/JuliaEnergy/PowerDynBase.jl/pull/49) +* ![bugfix](https://img.shields.io/badge/PD-bugfix-%23d73a4a.svg) [adding and package update before the tests in travis to ensure the latest packges are used](https://github.com/JuliaEnergy/PowerDynBase.jl/pull/50) From 56fbbde7d905372b63998827f81655fcc070623c Mon Sep 17 00:00:00 2001 From: timkittel <19408882+timkittel@users.noreply.github.com> Date: Mon, 11 Mar 2019 14:02:26 +0100 Subject: [PATCH 3/4] corrected typo to make ci pass --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a00697..71d6a9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,4 +9,4 @@ * ![enhancement](https://img.shields.io/badge/PD-enhancement-%23a2eeef.svg) [fixing node docs](https://github.com/JuliaEnergy/PowerDynBase.jl/pull/46) * ![miscellaneous](https://img.shields.io/badge/PD-miscellaneous-lightgrey.svg) [add Sabine Auer to AUTHORS](https://github.com/JuliaEnergy/PowerDynBase.jl/pull/45) * ![bugfix](https://img.shields.io/badge/PD-bugfix-%23d73a4a.svg) [temporarily pin MbedTLS version to 0.6.6 to fix travis ci issue](https://github.com/JuliaEnergy/PowerDynBase.jl/pull/49) -* ![bugfix](https://img.shields.io/badge/PD-bugfix-%23d73a4a.svg) [adding and package update before the tests in travis to ensure the latest packges are used](https://github.com/JuliaEnergy/PowerDynBase.jl/pull/50) +* ![bugfix](https://img.shields.io/badge/PD-bugfix-%23d73a4a.svg) [adding a package update before the tests in travis to ensure the latest packges are used](https://github.com/JuliaEnergy/PowerDynBase.jl/pull/50) From f5d51af7975de89ce7ea6d24f8772cf4aed34302 Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 11 Mar 2019 14:55:41 +0100 Subject: [PATCH 4/4] inbetween, States.jl still missing --- Project.toml | 3 ++- src/DEVariables.jl | 3 --- src/NetwirkRHSs.jl | 3 --- src/NodeDynamicsBase.jl | 7 ------- test/dynamicnodemacro.jl | 6 ++++++ test/outputanderrors.jl | 2 +- test/testing_base.jl | 2 +- 7 files changed, 10 insertions(+), 16 deletions(-) diff --git a/Project.toml b/Project.toml index 4bdbe6a..53ff9cb 100644 --- a/Project.toml +++ b/Project.toml @@ -18,6 +18,7 @@ SymPy = ">=0.8" Crayons = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f" SymPy = "24249f21-da20-56a4-8eb1-6a02cf4ae2e6" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" +Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb" [targets] -test = ["Test", "SymPy", "Crayons"] +test = ["Test", "SymPy", "Crayons", "Suppressor"] diff --git a/src/DEVariables.jl b/src/DEVariables.jl index a5e018e..991dd77 100644 --- a/src/DEVariables.jl +++ b/src/DEVariables.jl @@ -4,9 +4,6 @@ import Base: length, view, @__doc__ using MacroTools -issymbol(::Symbol) = true -issymbol(::Any) = false - """ abstract type AbstractDEVariable end diff --git a/src/NetwirkRHSs.jl b/src/NetwirkRHSs.jl index 951ecb1..2d47f17 100644 --- a/src/NetwirkRHSs.jl +++ b/src/NetwirkRHSs.jl @@ -1,9 +1,6 @@ # (C) 2018 Potsdam Institute for Climate Impact Research, authors and contributors (see AUTHORS file) # Licensed under GNU GPL v3 (see LICENSE file) -"Get the total number of internal variables for an array of node dynamics." -total_nint(nodes::AbstractVector{<:AbstractNodeDynamics}) = sum(nint, nodes) - """ Get the total number of dynamic variables for an array of node dynamics. diff --git a/src/NodeDynamicsBase.jl b/src/NodeDynamicsBase.jl index 1dbaad9..7cf16a7 100644 --- a/src/NodeDynamicsBase.jl +++ b/src/NodeDynamicsBase.jl @@ -61,9 +61,6 @@ function (dyn::OrdinaryNodeDynamics)(n, u::ODEVariable, i, nothing end -"Identify each subtype of [`AbstractNodeDynamics`](@ref) with its corresponding subtype of [`AbstractDEVariable`](@ref)" -getDEVariableType(::Type{Val{OrdinaryNodeDynamics}}) = ODEVariable - "Get number of internal arguments of the node." nint(dyn::OrdinaryNodeDynamics) = dyn.n_int @@ -129,8 +126,6 @@ OrdinaryNodeDynamicsWithMass(;rhs::Function, n_int, m_u, m_int, parameters) = Or m_u, m_int) (dyn::OrdinaryNodeDynamicsWithMass)(args...;kwargs...) = dyn.ode_dynamics(args...;kwargs...) -getDEVariableType(::Type{Val{OrdinaryNodeDynamicsWithMass}}) = ODEVariable - nint(dyn::OrdinaryNodeDynamicsWithMass) = nint(dyn.ode_dynamics) OrdinaryNodeDynamics(n::OrdinaryNodeDynamicsWithMass) = n.ode_dynamics @@ -177,8 +172,6 @@ function (dyn::AlgebraicNodeDynamics)(i, u::DAEVariable, i_c, nothing end -getDEVariableType(::Type{Val{AlgebraicNodeDynamics}}) = DAEVariable - nint(dyn::AlgebraicNodeDynamics) = dyn.n_int parametersof(n::AlgebraicNodeDynamics) = n.parameters diff --git a/test/dynamicnodemacro.jl b/test/dynamicnodemacro.jl index 5dc75f7..5e48707 100644 --- a/test/dynamicnodemacro.jl +++ b/test/dynamicnodemacro.jl @@ -93,3 +93,9 @@ full_macro_return_test = quote $(symbolsof_fct_test) end |> rlr |> rsb @test full_macro_return == full_macro_return_test + +struct UnknownDynamicsWithMass{N <: AbstractNodeParameters} <: PowerDynBase.AbstractNodeDynamics{N} end +@test_throws PowerDynBase.NodeDynamicsError PowerDynBase.cndfunction_builder!(Val{UnknownDynamicsWithMass}) +@test_throws PowerDynBase.NodeDynamicsError PowerDynBase.generate_symbolsof_fct(Val{UnknownDynamicsWithMass}, nothing, nothing) + +@test_nowarn @suppress showdefinition(SwingEq) diff --git a/test/outputanderrors.jl b/test/outputanderrors.jl index 6839991..4129fa5 100644 --- a/test/outputanderrors.jl +++ b/test/outputanderrors.jl @@ -3,7 +3,7 @@ include("testing_base.jl") using Crayons struct DummyNodeDynamics{N <: PowerDynBase.AbstractNodeParameters} <: PowerDynBase.AbstractNodeDynamics{N} end -let +@suppress_out let println(Crayon(foreground = :light_gray), "OUTPUT TESTS:") @test_nowarn println(PQAlgebraic) @test_nowarn println(SwingEq) diff --git a/test/testing_base.jl b/test/testing_base.jl index 16576fd..53e6e92 100644 --- a/test/testing_base.jl +++ b/test/testing_base.jl @@ -9,9 +9,9 @@ begin using Test using Random random_seed = 1234 - @show random_seed Random.seed!(random_seed) using LinearAlgebra + using Suppressor end begin