Skip to content

Commit

Permalink
Fix deprecated dataframes stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
briochemc committed Jul 19, 2019
1 parent eaf9cd8 commit 2861718
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Parameters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Example: TODO
Note for future edit of the docs: Don't repeat yourself between add and new param functions
"""
function add_parameter!(t::DataFrame, args...; kwargs...)
if any(t[:symbol] .== args[1])
if any(t[!,:symbol] .== args[1])
error("Parameter $(args[1]) already exists! (Maybe delete it first?)")
else
push!(t, new_parameter(args...; kwargs...))
Expand All @@ -71,7 +71,7 @@ export add_parameter!

delete_parameter!(t::DataFrame, i) = deleterows!(t, i)
function delete_parameter!(t::DataFrame, s::Symbol)
i = findfirst(t[:symbol] .== s)
i = findfirst(t[!,:symbol] .== s)
if i isa Nothing
error("Parameter $s does not exist in that table.")
else
Expand Down Expand Up @@ -125,21 +125,21 @@ function initialize_Parameters_type(t, PName="Parameters")
"""
)
end
symbols = t[:symbol]
optimizables = t[:optimizable]
symbols = t[!,:symbol]
optimizables = t[!,:optimizable]
m = length(optimizables)
m_all = size(t, 1)
optsymbols = symbols[optimizables]
schema = [(Symbol(x),Symbol(y)) for (x,y) in zip(symbols, optimizables)]
Parameters = Symbol(PName)
eval( :(@make_struct $Parameters $schema))

printunits = t[:printunit]
baseunits = t[:unit]
values = t[:value]
printunits = t[!,:printunit]
baseunits = t[!,:unit]
values = t[!,:value]

μs =for (μ, opt) in zip(t[:mean_obs], optimizables) if opt]
σ²s = [σ² for (σ², opt) in zip(t[:variance_obs], optimizables) if opt]
μs =for (μ, opt) in zip(t[!,:mean_obs], optimizables) if opt]
σ²s = [σ² for (σ², opt) in zip(t[!,:variance_obs], optimizables) if opt]

@eval begin
# Printing functionality
Expand Down

2 comments on commit 2861718

@briochemc
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/2131

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.6 -m "<description of version>" 2861718f49361e8901a13e0bc282801402cf0cfd
git push origin v0.2.6

Please sign in to comment.