Skip to content

Commit

Permalink
Remove unused set_variable_names, adapt tests and add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
lbenet committed Oct 16, 2019
1 parent d0377c9 commit 3039fb0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ isapprox
isfinite
displayBigO
use_show_default
set_taylor1_varname
```

## Internals
Expand Down
11 changes: 6 additions & 5 deletions src/parameters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ end

const _params_Taylor1_ = ParamsTaylor1("t")

"""
set_taylor1_varname(var::String)
Change the displayed variable for `Taylor1` objects.
"""
set_taylor1_varname(var::String) = _params_Taylor1_.var_name = strip(var)


Expand Down Expand Up @@ -63,11 +68,7 @@ function lookupvar(s::Symbol)
return ind
end

function set_variable_names(varnames::Vector{T}) where {T<:AbstractString}
_params_TaylorN_.variable_names = varnames
_params_TaylorN_.variable_symbols = Symbol.(varnames)
nothing
end

"""
get_variables(T::Type, [order::Int=get_order()])
Expand Down
2 changes: 1 addition & 1 deletion test/manyvariables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ eeuler = Base.MathConstants.e
@test iterate(x, 7) == nothing

@test x.order == 6
@test TaylorSeries.set_variable_names(["x","y"]) == nothing
@test TaylorSeries.name_taylorNvar(1) == " x"
@test TaylorSeries._params_TaylorN_.variable_names == ["x","y"]
@test TaylorSeries._params_TaylorN_.variable_symbols == [:x, :y]
@test get_variable_symbols() == [:x, :y]
Expand Down

0 comments on commit 3039fb0

Please sign in to comment.