MUCollective / multiverse

R package for creating explorable multiverse analysis
https://mucollective.github.io/multiverse/
GNU General Public License v3.0
62 stars 5 forks source link

Remove code which throws error from the multiverse #67

Closed abhsarma closed 4 years ago

abhsarma commented 4 years ago

M <- multiverse()

inside(M, { some_var = branch(parameter, "option1" ~ 1, "option2" ~ 2) })

inside(M, { some_other_var = branch(parameter, "option3" ~ 3, "option2" ~ 4 ) })

this throws an error, as it should ( see #14 ), but if the user then goes and corrects it, then it would still throw an error because the code is some_other_var = branch(parameter, "option3" ~ 3, "option2" ~ 4) is in the multiverse. This should be removed.

abhsarma commented 4 years ago

Now code is only added after parse_multiverse executes. This makes sure that every universe has a valid R code. If the execution of the entire multiverse throws errors in certain universes, that might be more difficult to solve

mjskay commented 4 years ago

That is a good point re: errors during execution. Do we have a way to handle that currently? Probably should capture errors during runs somehow rather than having a single universe kill everything

abhsarma commented 4 years ago

Could put everything inside a try block or something of that sort. If there's an error, then we can show messages to the user.