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

AnyFrameModule error #644

Closed
MilesCranmer opened this issue Jul 1, 2024 · 3 comments
Closed

AnyFrameModule error #644

MilesCranmer opened this issue Jul 1, 2024 · 3 comments

Comments

@MilesCranmer
Copy link
Contributor

MilesCranmer commented Jul 1, 2024

When running with

JET.test_package(
    DynamicExpressions;
    target_defined_modules=true,
    ignored_modules=(
        JET.AnyFrameModule(
            DynamicExpressions.NonDifferentiableDeclarationsModule
        ),
    ),
)

in an attempt to ignore #642, I get the issue:

Error During Test at /Users/mcranmer/.julia/packages/JET/6kXRQ/src/JET.jl:1053
  Test threw exception
  Expression: (JET.report_package)(DynamicExpressions; toplevel_logger = nothing, target_defined_modules = true, ignored_modules = (AnyFrameModule(DynamicExpressions.NonDifferentiableDeclarationsModule),))
  `JET.match_module(::NonDifferentiableDeclarationsModule, ::InferenceErrorReport)` is not implemented
  Stacktrace:
    [1] error(s::LazyString)
      @ Base ./error.jl:35
    [2] match_module(x::String, report::JET.InferenceErrorReport)
      @ JET ~/.julia/packages/JET/6kXRQ/src/JET.jl:533
    [3] (::JET.var"#93#97"{JET.MethodErrorReport})(m::String)
      @ JET ~/.julia/packages/JET/6kXRQ/src/JET.jl:544
...

This seems like an issue because I would have assumed that AnyFrameModule would have been automatically implemented? So I am not sure why it requires the custom match_module definition.


Note also that DynamicExpressions.NonDifferentiableDeclarationsModule is a submodule. But, it should still get caught:

julia> DE.NonDifferentiableDeclarationsModule |> typeof
Module

so I'm confused...

@MilesCranmer
Copy link
Contributor Author

Actually it looks like any package might not work?

julia> JET.test_package(
           DynamicExpressions;
           ignored_modules=[DynamicExpressions]
       )
Error During Test at /Users/mcranmer/.julia/packages/JET/6kXRQ/src/JET.jl:1053
  Test threw exception
  Expression: (JET.report_package)(DynamicExpressions; toplevel_logger = nothing, ignored_modules = Module[DynamicExpressions])
  `JET.match_module(::NonDifferentiableDeclarationsModule, ::InferenceErrorReport)` is not implemented
  Stacktrace:
    [1] error(s::LazyString)
      @ Base ./error.jl:35
    [2] match_module(x::String, report::JET.InferenceErrorReport)
      @ JET ~/.julia/packages/JET/6kXRQ/src/JET.jl:533
    [3] (::JET.var"#93#97"{JET.MethodErrorReport})(m::String)
      @ JET ~/.julia/packages/JET/6kXRQ/src/JET.jl:544
    [4] _any
      @ ./reduce.jl:1220 [inlined]
    [5] any
      @ ./reducedim.jl:1020 [inlined]
    [6] #92
      @ ~/.julia/packages/JET/6kXRQ/src/JET.jl:544 [inlined]
    [7] filter(f::JET.var"#92#96"{JET.ReportConfig{Nothing, Vector{String}}}, a::Vector{JET.InferenceErrorReport})
      @ Base ./array.jl:2675
    [8] configured_reports

is something converting it to a string?

Also related (maybe repeat of) #570

@MilesCranmer
Copy link
Contributor Author

Argh. Nevermind, sorry. It's because I had it in the .JET.toml file and it wasn't converting the specified ignored_modules to Module type.

@aviatesk
Copy link
Owner

aviatesk commented Jul 1, 2024

As explained in the note on the JET configuration documentation, please note that configurations specified in .JET.toml are overridden by those specified as keyword arguments.
What complicates the issue is likely the fact that ignored_modules used in the patterns like above does not work properly (i.e. report_package(A::Module; ignored_modules=(A::Module,)). This is because [test|report]_package virtualizes the module context of the package being analyzed. I plan to fix this issue soon along with #628 and other related issues.

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

No branches or pull requests

2 participants