You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By some spooky action at a distance, introducing a NaN-valued parameter into a dict_list changes the behaviour of @onlyif restrictions, even if they shouldn't depend on that parameter at all:
Minimal Working Example
Versions: DrWatson v2.9.1 and Julia v1.7.1
I've had a quick look at the dict_list code and spotted the problem: the last pass on the trial parameter combinations filters out all combinations that are subsets of other parameter combinations. Normally, this should remove the extra entry in the MWE since it only differs from the last entry by the missing dependent parameter, however, since NaN != NaN, Dict(:a => NaN, :c => false) is technically not a subset of Dict(:a => NaN, :b => 2, :c => false) and the comparison in dict_list.jl#92 fails.
My initial idea for a fix is to replace the trials[k] == _trials[k] with trials[k] == _trials[k] || trials[k] === _trials[k], since the === catches the NaNs, but the == is still necessary to catch mutable objects of equal value. Note that I have not thought this through at all, there may well be some edge case which breaks this.
The text was updated successfully, but these errors were encountered:
sounds good, maybe open a PR with the === check? Also cc @JonasIsensee maybe he knows more. actually, I don't remember anymore who contribute the @onlyif macro...
By some spooky action at a distance, introducing a
NaN
-valued parameter into adict_list
changes the behaviour of@onlyif
restrictions, even if they shouldn't depend on that parameter at all:Minimal Working Example
Versions: DrWatson v2.9.1 and Julia v1.7.1
returns
while
returns
I've had a quick look at the
dict_list
code and spotted the problem: the last pass on the trial parameter combinations filters out all combinations that are subsets of other parameter combinations. Normally, this should remove the extra entry in the MWE since it only differs from the last entry by the missing dependent parameter, however, sinceNaN != NaN
,Dict(:a => NaN, :c => false)
is technically not a subset ofDict(:a => NaN, :b => 2, :c => false)
and the comparison indict_list.jl#92
fails.My initial idea for a fix is to replace the
trials[k] == _trials[k]
withtrials[k] == _trials[k] || trials[k] === _trials[k]
, since the===
catches theNaN
s, but the==
is still necessary to catch mutable objects of equal value. Note that I have not thought this through at all, there may well be some edge case which breaks this.The text was updated successfully, but these errors were encountered: