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

getDydmacs causes system failure #43

Open
mpadge opened this issue Jan 27, 2021 · 3 comments
Open

getDydmacs causes system failure #43

mpadge opened this issue Jan 27, 2021 · 3 comments

Comments

@mpadge
Copy link

mpadge commented Jan 27, 2021

This is part of what autotest does by way of testing all possible forms and values of inputs, with code taken directly from the example for getDydmacs. The lowerLV parameter shown here causes a complete R session crash:

dvn <- scrapeVarCross(dat = DRES, x_order = "sip", x_stem = "PRQC", x_delim1 = "_", x_delim2=".", x_item_num="\\d+", distinguish_1="1", distinguish_2="2")
qual.config.script <-  scriptCFA(dvn, lvname = "Qual", model = "configural")
qual.config.mod <- lavaan::cfa(qual.config.script, data = DRES, std.lv = F, auto.fix.first= F, meanstructure = T)
qual.dmacs <- getDydmacs(DRES, dvn, qual.config.mod, lowerLV = -.Machine$integer.max / 1000)

autotest can handle a lot of things, and will in the future diagnose these kinds of total meltdowns without actually generating them, but at the moment they are simply left to happen. That makes this pretty important to fix!! Thanks!

@mpadge mpadge mentioned this issue Jan 27, 2021
@jsakaluk
Copy link
Owner

This is quite interesting that only lowerLV throws the error, because the example in getDydmacs uses function defaults for the lowerLV and upperLV arguments:

qual.dmacs <- getDydmacs(DRES, dvn, qual.config.mod)
The default arguments for lowerLV and upperLV are very similar, -5 and 5, respectively. I'll take a look, but this may be an error where the devil is in the (difficult to spot) details.

@mpadge
Copy link
Author

mpadge commented Jan 27, 2021

autotest uses defaults just to work out what kind of input it is. In that case, it identifies both as integers, and so tries the full range of possible integer values. lowerIV works okay for -Machine$integer.max by simply rejecting it, and does same for up to 1/100th of that value, but at 1/1000th, it obviously accepts the value as somehow valid and attempts to do something ... evidently destructive. Just try for yourself inputting that value, find the point where it all goes wrong, and, well, fix it. Should be fairly straightforward.

@jsakaluk
Copy link
Owner

Will do. Thanks :)

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