Closed juanfung closed 5 years ago
This commit 1c48ac7ba67fd6c7e4d4d950b4f93a96fe5c5e22 imports package StatsModels
and drops usage of package Debug
(see https://github.com/juanfung/scpd/issues/2)
Type declarations fixed by: 20221fc28395d7629c53dc94097d58350f5655a1
TODO: typealias
seems to be deprecated, with no alternative given in v0.7 (instead, this error: "syntax: extra token TypeAliasName after end of expression").
Documentation suggests aliasing via simple assignment, i.e., TypeAliasName = ...
. Check this works and update CausalMixtures.jl
.
typealias
replaced by simple assignment =
by 82a1cd82f1cb356ecb1d40b6017925e8169d790b
After above commits, the following warnings and errors remain when loading CausalMixtures.jl
:
┌ Warning: Deprecated syntax
parametric method syntax sumbw{T <: Associative}(b::Base.ValueIterator{T},; i::Int64 = 1)
around /home/juanfung/Dropbox/Projects/School choice/scpd/Analyze/CausalMixtures/src/CausalMixtures.jl:160. │ Usesumbw(b::Base.ValueIterator{T},; i::Int64 = 1) where T <: Associative
instead. └ @ ~/Dropbox/Projects/School choice/scpd/Analyze/CausalMixtures/src/CausalMixtures.jl:160 WARNING: importing deprecated binding Base.Associative into CausalMixtures. WARNING: Base.Associative is deprecated, use AbstractDict instead. likely near /home/juanfung/Dropbox/Projects/School choice/scpd/Analyze/CausalMixtures/src/CausalMixtures.jl:159 WARNING: Base.Associative is deprecated, use AbstractDict instead. likely near /home/juanfung/Dropbox/Projects/School choice/scpd/Analyze/CausalMixtures/src/CausalMixtures.jl:159 WARNING: Base.Associative is deprecated, use AbstractDict instead. likely near /home/juanfung/Dropbox/Projects/School choice/scpd/Analyze/CausalMixtures/src/CausalMixtures.jl:159 WARNING: importing deprecated binding Base.LinSpace into CausalMixtures. WARNING: Base.LinSpace is deprecated, use LinRange instead. likely near /home/juanfung/Dropbox/Projects/School choice/scpd/Analyze/CausalMixtures/src/CausalMixtures.jl:296 WARNING: Base.LinSpace is deprecated, use LinRange instead. likely near /home/juanfung/Dropbox/Projects/School choice/scpd/Analyze/CausalMixtures/src/CausalMixtures.jl:296 WARNING: Base.LinSpace is deprecated, use LinRange instead. likely near /home/juanfung/Dropbox/Projects/School choice/scpd/Analyze/CausalMixtures/src/CausalMixtures.jl:296 ERROR: LoadError: cannot define function PPD; it already has a value
TODO:
sumbw
Base.Associative
with AbstractDict
Base.LinSpace
with LinRange
PPD
, which is an alias for PosteriorPredictive
. Should constructor be defined before aliasing?This commit fixes aliasing problem with PPD
d5e8990aaf16ebfdf38c46f16da02e666cebaa91
Works as expected; ie, calling CausalMixtures.PPD()
creates default instance of PosteriorPredictive
This commit 4d6975aff74db5346b5bd364c953c8fd504a8dbd addresses deprecation warnings for use of Base.Associative
, Base.LinSpace
, and (not noted above) @printf
. For the latter, must explicitly load module Printf
.
Now, all that remains:
julia> include("CausalMixtures.jl")
WARNING: replacing module CausalMixtures. ┌ Warning: Deprecated syntax
parametric method syntax sumbw{T <: AbstractDict}(b::Base.ValueIterator{T},; i::Int64 = 1)
around /home/juanfung/Dropbox/Projects/School choice/scpd/Analyze/CausalMixtures/src/CausalMixtures.jl:160. │ Usesumbw(b::Base.ValueIterator{T},; i::Int64 = 1) where T <: AbstractDict
instead. └ @ ~/Dropbox/Projects/School choice/scpd/Analyze/CausalMixtures/src/CausalMixtures.jl:160 ┌ Warning: Deprecated syntax(j == 1)?
at /home/juanfung/Dropbox/Projects/School choice/scpd/Analyze/CausalMixtures/src/sampler_functions.jl:412. │ Use(j == 1) ?
instead. └ @ ~/Dropbox/Projects/School choice/scpd/Analyze/CausalMixtures/src/sampler_functions.jl:412 Main.CausalMixtures
This commit 5b5eb3bd380381bc5cc91021a079d99a5cbb237b fixes remaining deprecation warnings!
julia> include("CausalMixtures.jl")
WARNING: replacing module CausalMixtures. Main.CausalMixtures
Closing issue because loading module CausalMixtures.jl
in julia v0.7 does not cause any errors or deprecation warnings.
TODO: Check the code works on toy example, causal-sims.jl
.
Update 2018-01-08: updates for julia 0.7 should also work for julia 1.0
Original code written for julia 0.4.
Major changes in julia 0.6 (current stable) to be incorporated:
Formula
,ModelFrame
, andModelMatrix
are no longer part of theDataFrames
package; they are now part of theStatsModels
packagenew way
mutable struct MyType ...
old way
immutable IType ...
new way
struct IType ...