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

Issues with intertypes tests #86

Closed
p-stokes opened this issue Dec 3, 2023 · 2 comments
Closed

Issues with intertypes tests #86

p-stokes opened this issue Dec 3, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@p-stokes
Copy link
Contributor

p-stokes commented Dec 3, 2023

There appear to be a couple issues with the intertypes tests, reading back in the simpleast schema in line 48 and loading the wgraph intertypes module in line 64.

line 48 gives the following error

julia> simpleast_schema = JSONSchema.Schema(read("simpleast_schema.json", String))
ERROR: missing property 'Term' in Dict{String, Any}("IfThenElse" => Dict{String, Any}("properties" => Dict{String, Any}("tag" => Dict{String, Any}("const" => "IfThenElse"), "ifcase" => Dict{String, Any}("\$ref" => "#/\$defs/Term"), "elsecase" => Dict{String, Any}("\$ref" => "#/\$defs/Term"), "thencase" => Dict{String, Any}("\$ref" => "#/\$defs/Term")), "required" => Any["ifcase", "thencase", "elsecase"], "type" => "object"), "Constant" => Dict{String, Any}("properties" => Dict{String, Any}("tag" => Dict{String, Any}("const" => "Constant"), "val" => Dict{String, Any}("\$ref" => "#/\$defs/Const")), "required" => Any["val"], "type" => "object"), "ConstInt" => Dict{String, Any}("properties" => Dict{String, Any}("tag" => Dict{String, Any}("const" => "ConstInt"), "val" => Dict{String, Any}("minimum" => -2147483648, "\$comment" => "I32", "type" => "integer", "maximum" => 2147483647)), "required" => Any["val"], "type" => "object"), "Assignment" => Dict{String, Any}("properties" => Dict{String, Any}("rhs" => Dict{String, Any}("\$ref" => "#/\$defs/Term"), "lhs" => Dict{String, Any}("\$comment" => "Str", "type" => "string")), "required" => Any["lhs", "rhs"], "type" => "object"), "ConstStr" => Dict{String, Any}("properties" => Dict{String, Any}("tag" => Dict{String, Any}("const" => "ConstStr"), "val" => Dict{String, Any}("\$comment" => "Str", "type" => "string")), "required" => Any["val"], "type" => "object"), "ConstBool" => Dict{String, Any}("properties" => Dict{String, Any}("tag" => Dict{String, Any}("const" => "ConstBool"), "val" => Dict{String, Any}("\$comment" => "Boolean", "type" => "boolean")), "required" => Any["val"], "type" => "object"), "Plus" => Dict{String, Any}("properties" => Dict{String, Any}("tag" => Dict{String, Any}("const" => "Plus"), "terms" => Dict{String, Any}("items" => Dict{String, Any}("\$ref" => "#/\$defs/Term"), "type" => "array")), "required" => Any["terms"], "type" => "object")).
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] _recurse_get_element(schema::Dict{String, Any}, element::String)
    @ JSONSchema ~/.julia/packages/JSONSchema/D9t8p/src/schema.jl:53
  [3] get_element(schema::Dict{String, Any}, path::String)
    @ JSONSchema ~/.julia/packages/JSONSchema/D9t8p/src/schema.jl:40
  [4] find_ref(uri::URIs.URI, id_map::Dict{String, Any}, path::String, parent_dir::String)
    @ JSONSchema ~/.julia/packages/JSONSchema/D9t8p/src/schema.jl:0
  [5] resolve_refs!(schema::Dict{String, Any}, uri::URIs.URI, id_map::Dict{String, Any}, parent_dir::String)
    @ JSONSchema ~/.julia/packages/JSONSchema/D9t8p/src/schema.jl:156
  [6] resolve_refs!(schema::Dict{String, Any}, uri::URIs.URI, id_map::Dict{String, Any}, parent_dir::String) (repeats 4 times)
    @ JSONSchema ~/.julia/packages/JSONSchema/D9t8p/src/schema.jl:158
  [7] JSONSchema.Schema(schema::Dict{String, Any}; parent_dir::String, parentFileDirectory::Nothing)
    @ JSONSchema ~/.julia/packages/JSONSchema/D9t8p/src/schema.jl:245
  [8] JSONSchema.Schema(schema::Dict{String, Any})
    @ JSONSchema ~/.julia/packages/JSONSchema/D9t8p/src/schema.jl:232
  [9] JSONSchema.Schema(schema::String; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ JSONSchema ~/.julia/packages/JSONSchema/D9t8p/src/schema.jl:278
 [10] JSONSchema.Schema(schema::String)
    @ JSONSchema ~/.julia/packages/JSONSchema/D9t8p/src/schema.jl:278
 [11] top-level scope
    @ REPL[23]:1

line 64 gives the following error

julia> @intertypes "wgraph.it" module wgraph end
ERROR: UndefVarError: `defined_types` not defined
Stacktrace:
 [1] parse_intertype_decl(e::Expr; mod::ACSets.InterTypes.InterTypeModule)
   @ ACSets.InterTypes ~/.julia/packages/ACSets/nwyXW/src/intertypes/julia.jl:88
 [2] (::ACSets.InterTypes.var"#parse#42"{ACSets.InterTypes.InterTypeModule})(in::Expr)
   @ ACSets.InterTypes ~/.julia/packages/ACSets/nwyXW/src/intertypes/julia.jl:167
 [3] include_string(mapexpr::ACSets.InterTypes.var"#parse#42"{ACSets.InterTypes.InterTypeModule}, mod::Module, code::String, filename::String)
   @ Base ./loading.jl:1860
 [4] _include(mapexpr::Function, mod::Module, _path::String)
   @ Base ./loading.jl:1924
 [5] include(mapexpr::Function, mod::Module, _path::String)
   @ Base ./Base.jl:458
 [6] include(mapexpr::Function, x::String)
   @ Main.wgraph ./REPL[30]:1
 [7] include_intertypes(into::Module, file::String, imports::Vector{Any})
   @ ACSets.InterTypes ~/.julia/packages/ACSets/nwyXW/src/intertypes/julia.jl:190
 [8] top-level scope
   @ REPL[30]:1
@p-stokes p-stokes added the bug Something isn't working label Dec 3, 2023
@jpfairbanks
Copy link
Member

I was able to run the tests locally on main with Julia 1.9.2 with current versions. What is the MWE that reproduces this bug along with the Pkg.status output?

@epatters epatters changed the title issues with intertypes tests Issues with intertypes tests Dec 4, 2023
@p-stokes
Copy link
Contributor Author

p-stokes commented Dec 5, 2023

I think there was a version bump. It works for me now. I'll mark it resolved.

@p-stokes p-stokes closed this as completed Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants