Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new type encoding #592

Merged
merged 6 commits into from
Sep 8, 2024
Merged

new type encoding #592

merged 6 commits into from
Sep 8, 2024

Conversation

JonasIsensee
Copy link
Collaborator

@JonasIsensee JonasIsensee commented Sep 7, 2024

closes #36
closes #175
closes #401

Copy link

codecov bot commented Sep 7, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 16 lines in your changes missing coverage. Please review.

Project coverage is 85.18%. Comparing base (e21fc87) to head (64822dc).
Report is 8 commits behind head on dev.

Files with missing lines Patch % Lines
src/data/reconstructing_datatypes.jl 93.33% 7 Missing ⚠️
src/committed_datatype_introspection.jl 0.00% 3 Missing ⚠️
src/data/writing_datatypes.jl 92.30% 2 Missing ⚠️
src/datasets.jl 80.00% 2 Missing ⚠️
src/datatypes.jl 92.85% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #592      +/-   ##
==========================================
- Coverage   85.26%   85.18%   -0.09%     
==========================================
  Files          36       36              
  Lines        4438     4387      -51     
==========================================
- Hits         3784     3737      -47     
+ Misses        654      650       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JonasIsensee JonasIsensee merged commit e9de41f into dev Sep 8, 2024
12 of 13 checks passed
@ChrisRackauckas
Copy link
Contributor

https://buildkite.com/julialang/diffeqdocs-dot-jl/builds/223#0191d1f5-c702-45da-963a-a962086318cc/1645-3461

This seems to have a bug? Is it tested on types that have more parameters than fields?

@JonasIsensee
Copy link
Collaborator Author

JonasIsensee commented Sep 8, 2024

It seems that I cannot access the logs you linked.

The tests cover quite a range of structs and type signatures in general.
If there's something that's missing, I'm try to fix it and add it to the tests.

@ChrisRackauckas
Copy link
Contributor

Debug: Evaluating @example block:
  |using OrdinaryDiffEq, DataFrames
  | │ f_2dlinear = (du, u, p, t) -> du .= 1.01u;
  | │ tspan = (0.0, 1.0)
  | │ prob = ODEProblem(f_2dlinear, rand(2, 2), tspan);
  | │ sol = solve(prob, Euler(); dt = 1 // 2^(4));
  | │ df = DataFrame(sol)
  | └ @ Documenter ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/Documenter/C1XEF/src/expander_pipeline.jl:737
  | ┌ Debug: Evaluating @example block:
  | │ f = ODEFunction(f_2dlinear, syms = [:a, :b, :c, :d])
  | │ prob = ODEProblem(f, rand(2, 2), (0.0, 1.0));
  | │ sol = solve(prob, Euler(); dt = 1 // 2^(4));
  | │ df = DataFrame(sol)
  | └ @ Documenter ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/Documenter/C1XEF/src/expander_pipeline.jl:737
  | ┌ Debug: Evaluating @example block:
  |using CSV
  | │ CSV.write("out.csv", df)
  | └ @ Documenter ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/Documenter/C1XEF/src/expander_pipeline.jl:737
  | ┌ Debug: Evaluating @example block:
  | │ sol = solve(prob, Euler(); dt = 1 // 2^(4))
  |using JLD2
  |@save "out.jld2" sol
  | └ @ Documenter ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/Documenter/C1XEF/src/expander_pipeline.jl:737
  | ┌ Debug: Evaluating @example block:
  |# New session
  |using JLD2
  |using OrdinaryDiffEq
  | │ JLD2.@load "out.jld2" sol
  | └ @ Documenter ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/Documenter/C1XEF/src/expander_pipeline.jl:737
  | ┌ Error: failed to run `@example` block in src/features/io.md:54-59
  |```@example IO
  | │ # New session
  | │ using JLD2
  | │ using OrdinaryDiffEq
  | │ JLD2.@load "out.jld2" sol
  | │ ```
  | │   exception =
  | │    NamedTuple names and field types must have matching lengths
  | │    Stacktrace:
  | │      [1] reconstruct_compound(f::JLD2.JLDFile{JLD2.MmapIO}, T::String, dt::JLD2.CompoundDatatype, field_datatypes::OrderedCollections.OrderedDict{String, JLD2.RelOffset})
  | │        @ JLD2 ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/JLD2/vAW4N/src/data/reconstructing_datatypes.jl:617
  | │      [2] constructrr(f::JLD2.JLDFile{JLD2.MmapIO}, unk::Type{JLD2.UnknownType{ODEFunction, Tuple{true, SciMLBase.FullSpecialize, JLD2.UnknownType{Symbol("Main.__atexample__named__IO.#1#2"), Tuple{}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, SymbolicIndexingInterface.SymbolCache{Dict{Symbol, Int64}, Nothing, Nothing, Nothing, Dict{Any, Any}}, Nothing, Nothing}}}, dt::JLD2.CompoundDatatype, attrs::Vector{JLD2.ReadAttribute})
  | │        @ JLD2 ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/JLD2/vAW4N/src/data/reconstructing_datatypes.jl:575
  | │      [3] jltype(f::JLD2.JLDFile{JLD2.MmapIO}, sdt::JLD2.CommittedDatatype)
  | │        @ JLD2 ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/JLD2/vAW4N/src/data/reconstructing_datatypes.jl:115
  | │      [4] types_from_refs(f::JLD2.JLDFile{JLD2.MmapIO}, ptr::Ptr{Nothing})
  | │        @ JLD2 ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/JLD2/vAW4N/src/data/reconstructing_datatypes.jl:331
  | │      [5] jlconvert(rr::JLD2.ReadRepresentation{DataType, JLD2.OnDiskRepresentation{(0, 16), Tuple{String, Vector{Any}}, Tuple{JLD2.Vlen{String}, JLD2.Vlen{JLD2.RelOffset}}, 32}()}, f::JLD2.JLDFile{JLD2.MmapIO}, ptr::Ptr{Nothing}, header_offset::JLD2.RelOffset)
  | │        @ JLD2 ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/JLD2/vAW4N/src/data/reconstructing_datatypes.jl:347
  | │      [6] read_scalar(f::JLD2.JLDFile{JLD2.MmapIO}, rr::Any, header_offset::JLD2.RelOffset)
  | │        @ JLD2 ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/JLD2/vAW4N/src/dataio.jl:37
  | │      [7] read_data(f::JLD2.JLDFile{JLD2.MmapIO}, rr::Any, read_dataspace::Tuple{JLD2.ReadDataspace, JLD2.RelOffset, JLD2.DataLayout, JLD2.FilterPipeline}, attributes::Vector{JLD2.ReadAttribute})
  | │        @ JLD2 ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/JLD2/vAW4N/src/datasets.jl:98
  | │      [8] read_data(f::JLD2.JLDFile{JLD2.MmapIO}, dataspace::JLD2.ReadDataspace, dt::JLD2.H5Datatype, layout::JLD2.DataLayout, filters::JLD2.FilterPipeline, header_offset::JLD2.RelOffset, attributes::Vector{JLD2.ReadAttribute})
  | │        @ JLD2 ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/JLD2/vAW4N/src/datasets.jl:86
  | │      [9] load_dataset(f::JLD2.JLDFile{JLD2.MmapIO}, offset::JLD2.RelOffset)
  | │        @ JLD2 ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/JLD2/vAW4N/src/datasets.jl:50
  | │     [10] types_from_refs(f::JLD2.JLDFile{JLD2.MmapIO}, ptr::Ptr{Nothing})
  | │        @ JLD2 ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/JLD2/vAW4N/src/data/reconstructing_datatypes.jl:331
  | │     [11] jlconvert(rr::JLD2.ReadRepresentation{DataType, JLD2.OnDiskRepresentation{(0, 16), Tuple{String, Vector{Any}}, Tuple{JLD2.Vlen{String}, JLD2.Vlen{JLD2.RelOffset}}, 32}()}, f::JLD2.JLDFile{JLD2.MmapIO}, ptr::Ptr{Nothing}, header_offset::JLD2.RelOffset)
  | │        @ JLD2 ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/JLD2/vAW4N/src/data/reconstructing_datatypes.jl:347
  | │     [12] read_scalar(f::JLD2.JLDFile{JLD2.MmapIO}, rr::Any, header_offset::JLD2.RelOffset)
  | │        @ JLD2 ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/JLD2/vAW4N/src/dataio.jl:37
  | │     [13] read_data(f::JLD2.JLDFile{JLD2.MmapIO}, rr::Any, read_dataspace::Tuple{JLD2.ReadDataspace, JLD2.RelOffset, JLD2.DataLayout, JLD2.FilterPipeline}, attributes::Nothing)
  | │        @ JLD2 ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/JLD2/vAW4N/src/datasets.jl:98
  | │     [14] read_data(f::JLD2.JLDFile{JLD2.MmapIO}, dataspace::JLD2.ReadDataspace, dt::JLD2.H5Datatype, layout::JLD2.DataLayout, filters::JLD2.FilterPipeline, header_offset::JLD2.RelOffset, attributes::Nothing)
  | │        @ JLD2 ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/JLD2/vAW4N/src/datasets.jl:86
  | │     [15] read_data (repeats 2 times)
  | │        @ ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/JLD2/vAW4N/src/datasets.jl:69 [inlined]
  | │     [16] read_attr_data
  | │        @ ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/JLD2/vAW4N/src/attributes.jl:91 [inlined]
  | │     [17] jltype(f::JLD2.JLDFile{JLD2.MmapIO}, sdt::JLD2.SharedDatatype)
  | │        @ JLD2 ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/JLD2/vAW4N/src/data/reconstructing_datatypes.jl:98
  | │     [18] read_data(f::JLD2.JLDFile{JLD2.MmapIO}, dataspace::JLD2.ReadDataspace, dt::JLD2.H5Datatype, layout::JLD2.DataLayout, filters::JLD2.FilterPipeline, header_offset::JLD2.RelOffset, attributes::Vector{JLD2.ReadAttribute})
  | │        @ JLD2 ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/JLD2/vAW4N/src/datasets.jl:69
  | │     [19] load_dataset(f::JLD2.JLDFile{JLD2.MmapIO}, offset::JLD2.RelOffset)
  | │        @ JLD2 ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/JLD2/vAW4N/src/datasets.jl:50
  | │     [20] getindex(g::JLD2.Group{JLD2.JLDFile{JLD2.MmapIO}}, name::String)
  | │        @ JLD2 ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/JLD2/vAW4N/src/groups.jl:99
  | │     [21] read
  | │        @ ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/JLD2/vAW4N/src/JLD2.jl:368 [inlined]
  | │     [22] (::Main.__atexample__named__IO.var"#3#4")(f::JLD2.JLDFile{JLD2.MmapIO})
  | │        @ Main.__atexample__named__IO ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/JLD2/vAW4N/src/loadsave.jl:153
  | │     [23] jldopen(f::Function, args::String; kws::@Kwargs{})
  | │        @ JLD2 ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/JLD2/vAW4N/src/loadsave.jl:4
  | │     [24] jldopen(f::Function, args::String)
  | │        @ JLD2 ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/JLD2/vAW4N/src/loadsave.jl:1
  | │     [25] top-level scope
  | │        @ io.md:152
  | │     [26] eval
  | │        @ ./boot.jl:385 [inlined]
  | │     [27] #60
  | │        @ ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/Documenter/C1XEF/src/expander_pipeline.jl:754 [inlined]
  | │     [28] cd(f::Documenter.var"#60#62"{Module, Expr}, dir::String)
  | │        @ Base.Filesystem ./file.jl:112
  | │     [29] (::Documenter.var"#59#61"{Documenter.Page, Module, Expr})()
  | │        @ Documenter ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/Documenter/C1XEF/src/expander_pipeline.jl:753
  | │     [30] (::IOCapture.var"#5#9"{DataType, Documenter.var"#59#61"{Documenter.Page, Module, Expr}, IOContext{Base.PipeEndpoint}, IOContext{Base.PipeEndpoint}, Base.TTY, Base.TTY})()
  | │        @ IOCapture ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/IOCapture/Y5rEA/src/IOCapture.jl:170
  | │     [31] with_logstate(f::Function, logstate::Any)
  | │        @ Base.CoreLogging ./logging.jl:515
  | │     [32] with_logger
  | │        @ ./logging.jl:627 [inlined]
  | │     [33] capture(f::Documenter.var"#59#61"{Documenter.Page, Module, Expr}; rethrow::Type, color::Bool, passthrough::Bool, capture_buffer::IOBuffer, io_context::Vector{Any})
  | │        @ IOCapture ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/IOCapture/Y5rEA/src/IOCapture.jl:167
  | │     [34] runner(::Type{Documenter.Expanders.ExampleBlocks}, node::MarkdownAST.Node{Nothing}, page::Documenter.Page, doc::Documenter.Document)
  | │        @ Documenter ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/Documenter/C1XEF/src/expander_pipeline.jl:752
  | └ @ Documenter ~/.cache/julia-buildkite-plugin/depots/0185fce3-4489-413a-a934-123dd653ef61/packages/Documenter/C1XEF/src/utilities/utilities.jl:44
 

<br class="Apple-interchange-newline">

@JonasIsensee
Copy link
Collaborator Author

Thank you, I found the issue.
Two methods were not covered by tests and, hence, were missed while updating.
I'll tag a patch with new tests and the fix today.

@ChrisRackauckas
Copy link
Contributor

Thanks!

@JonasIsensee
Copy link
Collaborator Author

Bugfix along with new tests is merged and I pinged the registrator for v0.5.1
The example from your stacktrace works locally but I used a different file for tests to avoid adding OrdinaryDiffEq as a test-dep.

I hope, your pipelines will run with this.
If not, please be patient with me,
building representative tests to cover the space of all possible structs and type signatures is never a finished task.

@ChrisRackauckas
Copy link
Contributor

Confirmed that fixes our use case.

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