Skip to content

Conversation

goggle
Copy link
Contributor

@goggle goggle commented Jun 27, 2019

This PR is the continuation of #61.
In a first step, I have enumerated all the tutorial files in tutorials/, html/, notebook/, pdf/, script/ as suggested in #60.
The second commit rebuilds all the tutorials that could be built without unintended Weave.jl warnings/errors.

The following tutorials could not be built without errors, so I will add them in seperate commits to this PR, and we can figure out what to do:

  • introduction/05-formatting_plots
  • models/03-diffeqbio_I_introduction
  • models/04-diffeqbio_II_networkproperties
  • models/06-pendulum_bayesian_interface
  • models/07-outer_solar_system
  • ode_extras/ModelingToolkit
  • type_handling/01-number_types
  • type_handling/03-unitful

@goggle
Copy link
Contributor Author

goggle commented Jun 27, 2019

There is an error in the build of introduction/05-formatting_plots:

The line

plot(sol,vars=(:x,:y,:z))

fails with this error:

ERROR: MethodError: no method matching pointer(::Symbol)
Closest candidates are:
  pointer(!Matched::String) at strings/string.jl:81
  pointer(!Matched::String, !Matched::Integer) at strings/string.jl:82
  pointer(!Matched::SubString{String}) at strings/substring.jl:104
  ...

@goggle
Copy link
Contributor Author

goggle commented Jun 27, 2019

There are errors in the build of ode_extras/01-ModelingToolkit:

The line

using PuMaS

fails:

ERROR: ArgumentError: Package PuMaS not found in current path:
- Run `import Pkg; Pkg.add("PuMaS")` to install the PuMaS package.

Trying to install PuMaS leads to errors as well:

import Pkg; Pkg.add("PuMaS")
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
ERROR: The following package names could not be resolved:
 * PuMaS (not found in project, manifest or registry)
Please specify by known `name=uuid`.
Stacktrace:
 [1] #ensure_resolved at ./none:0 [inlined]
 [2] #add_or_develop#17(::Symbol, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /build/julia/src/julia-1.1.1/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:54
 [3] #add_or_develop at ./none:0 [inlined]
 [4] #add_or_develop#16 at /build/julia/src/julia-1.1.1/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:36 [inlined]
 [5] #add_or_develop at ./none:0 [inlined]
 [6] #add_or_develop#13 at /build/julia/src/julia-1.1.1/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:34 [inlined]
 [7] #add_or_develop at ./none:0 [inlined]
 [8] #add_or_develop#12(::Base.Iterators.Pairs{Symbol,Symbol,Tuple{Symbol},NamedTuple{(:mode,),Tuple{Symbol}}}, ::Function, ::String) at /build/julia/src/julia-1.1.1/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:33
 [9] #add_or_develop at ./none:0 [inlined]
 [10] #add#22 at /build/julia/src/julia-1.1.1/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:64 [inlined]
 [11] add(::String) at /build/julia/src/julia-1.1.1/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:64
 [12] top-level scope at none:0

@goggle
Copy link
Contributor Author

goggle commented Jun 27, 2019

There are errors in the build of type_handling/01-number_types:

The code

using DecFP
prob_ode_decfplinear = ODEProblem(f,Dec128(1)/Dec128(2),(Dec128(0.0),Dec128(1.0)),Dec128(1.01))
sol =solve(prob_ode_decfplinear,Tsit5())

fails:

ERROR: StackOverflowError:

The code

using Decimals
prob_ode_decimallinear = ODEProblem(f,[decimal("1.0")]./[decimal("2.0")],(0//1,1//1),decimal(1.01))
sol =solve(prob_ode_decimallinear,RK4(),dt=1/2^(6)) #Fails

fails as well, although it seems to be known (comment #Fails):

ERROR: MethodError: Decimals.Decimal(::Rational{Int64}) is ambiguous. Candidates:
  (::Type{T})(x::Rational{S}) where {S, T<:AbstractFloat} in Base at rational.jl:92
  Decimals.Decimal(num::Real) in Decimals at /home/alex/.julia/packages/Decimals/Qfcas/src/decimal.jl:13
Possible fix, define
  Decimals.Decimal(::Rational{S})

@goggle
Copy link
Contributor Author

goggle commented Jun 27, 2019

There are errors in type_handling/03-unitful:

The code

t + sqrt(t)

fails:

ERROR: DimensionError: 1.0 s and 1.0 s^1/2 are not dimensionally compatible.

The code

using DifferentialEquations
f = (y,p,t) -> 0.5*y
u0 = 1.5u"N"
prob = ODEProblem(f,u0,(0.0u"s",1.0u"s"))
sol = solve(prob,Tsit5())

fails:

ERROR: DimensionError: N s^-1 and 0.75 N are not dimensionally compatible.

Keep the old PDF, because the PDF fails to build.
@goggle
Copy link
Contributor Author

goggle commented Jun 27, 2019

Only the PDF fails to build for models/03-diffeqbio_I_introduction:

I get this LaTeX error:

! Undefined control sequence.
<argument>  \require 
                     {mhchem} \ce { \varnothing &->[\frac {\alpha \cdot K^{n...
l.188 \end{align*}

Keep the old PDF because the PDF fails to build.
@goggle
Copy link
Contributor Author

goggle commented Jun 27, 2019

The PDF fails to build for models/04-diffeqbio_II_networkproperties:

I get this LaTeX error:

! Undefined control sequence.
<argument>  \require 
                     {mhchem} \ce { \varnothing &->[\frac {\alpha \cdot K^{n...
l.175 \end{align*}

Furthermore, the line

addjumps!(rn, build_regular_jumps=false, minimal_jumps=true)

fails:

ERROR: MethodError: Cannot `convert` an object of type Tuple{} to an object of type Tuple{Union{Float64, Int64, Expr, Symbol},Vararg{Union{Float64, Int64, Expr, Symbol},N} where N}
Closest candidates are:
  convert(::Type{T<:Tuple{Any,Vararg{Any,N} where N}}, !Matched::T<:Tuple{Any,Vararg{Any,N} where N}) where T<:Tuple{Any,Vararg{Any,N} where N} at essentials.jl:274
  convert(::Type{T<:Tuple{Any,Vararg{Any,N} where N}}, !Matched::Tuple{Any,Vararg{Any,N} where N}) where T<:Tuple{Any,Vararg{Any,N} where N} at essentials.jl:275
  convert(::Type{T<:Tuple}, !Matched::CartesianIndex) where T<:Tuple at multidimensional.jl:130
  ...

Keep the old PDF because it fails to build.
@goggle
Copy link
Contributor Author

goggle commented Jun 27, 2019

The PDF fails to build for models/06-pendulum_bayesian_inference:

LaTeX Warning: File `https://user-images.githubusercontent.com/1814174/59942945
-059c1680-942f-11e9-991c-2025e6e4ccd3.jpg' not found on input line 139.


! Package pdftex.def Error: File `https://user-images.githubusercontent.com/181
4174/59942945-059c1680-942f-11e9-991c-2025e6e4ccd3.jpg' not found: using draft 
setting.

See the pdftex.def package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.139 ...059c1680-942f-11e9-991c-2025e6e4ccd3.jpg}

Furthermore, I needed to add the line using StatsPlots before building, otherwise it would give me errors.

@goggle
Copy link
Contributor Author

goggle commented Jun 27, 2019

Only the PDF fails to build for models/07-outer_solar_system.

I get this LaTeX error:

! Undefined control sequence.
<argument> \minus 
                  
l.129 ...95912208286 \cdot 10^{\ensuremath{\minus}
                                                  4}$.

@goggle
Copy link
Contributor Author

goggle commented Jun 27, 2019

All the issues with the rebuild have been put in separate commits/comments.

How can we further proceed? I will be back on Monday.

@goggle goggle marked this pull request as ready for review June 27, 2019 16:09
@ChrisRackauckas
Copy link
Member

The TeX issues should get upstreamed. I was just concerned about finish before so I forgot to. I ran into the same ones.

Furthermore, I needed to add the line using StatsPlots before building, otherwise it would give me errors.

Oh no! Thanks for catching that.

There is an error in the build of introduction/05-formatting_plots:

that sounds like a genuine bug :(. Should get an issue.

There are errors in the build of type_handling/01-number_types:

I think that section is marked as "will fail" IIRC.

There are errors in type_handling/03-unitful:

Those are supposed to fail IIRC

The PDF fails to build for models/04-diffeqbio_II_networkproperties:

This should get an issue.

@ChrisRackauckas
Copy link
Member

Better than before, so IMO let's merge and keep improving :)

@ChrisRackauckas ChrisRackauckas merged commit 9cfc760 into SciML:master Jun 28, 2019
@ChrisRackauckas
Copy link
Member

The README links might need an update

@goggle
Copy link
Contributor Author

goggle commented Jul 1, 2019

The TeX issues should get upstreamed. I was just concerned about finish before so I forgot to. I ran into the same ones.

@ChrisRackauckas By getting upstreamed you mean these issues should get reported to the Weave.jl project?

@ChrisRackauckas
Copy link
Member

Yes

@goggle
Copy link
Contributor Author

goggle commented Jul 2, 2019

One of the PDF issues has been fixed in #63.
Another one has been reported upstream here: JunoLab/Weave.jl#226

The hopefully last one arises from the option mathjax=true when calling the latexify method. This option adds something like \require{mhchem} to the resulting LaTeX code, which fails when compiled to a PDF, but is probably needed for the conversion to HTML. I'm not sure what to do here...

@ChrisRackauckas
Copy link
Member

I think that block can be set to be selectively added only when html or something like that

@goggle
Copy link
Contributor Author

goggle commented Jul 4, 2019

I did not have any success fixing the LaTeX issues in models/03-diffeqbio_I_introduction.jmd and models/04-diffeqbio_II_networkproperties.jmd. They are caused by code like

x = latexify(repressilator; env=:chemical, starred=true, mathjax=true); 
display("text/latex", "$x"); 

where mathjax=true leads to a \require{mhchem} in the resulting .tex file. This then fails to compile with latex.

I tried to change that skip parameter, but without success. I couldn't find any documentation about it neither...

And I'm not sure, if this is not something that should be fixed by Weave.jl.

I have opened an issue ticket JunoLab/Weave.jl#228 about expected failures. This would allow us to indicate the code which is expected to fail, without generating a warning by Weave.jl.

What about the issue with ode_extras/01-ModelingToolkit where I am not able to install PuMaS? Does this package not exist anymore?

@ChrisRackauckas
Copy link
Member

You don't need PuMaS for that tutorial. That was an accident. It's a private repo.

@goggle
Copy link
Contributor Author

goggle commented Jul 4, 2019

So should I simply remove this last section Use Case: PuMaS.jl from the tutorial and rebuild?

@ChrisRackauckas
Copy link
Member

Yup, that was just from a presentation

@goggle
Copy link
Contributor Author

goggle commented Jul 5, 2019

The remaining LaTeX issue has been reported to Weave.jl here: JunoLab/Weave.jl#229

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants