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

tm_g_distribution always starts with validation error #823

Open
3 tasks done
chlebowa opened this issue Jan 7, 2025 · 2 comments
Open
3 tasks done

tm_g_distribution always starts with validation error #823

chlebowa opened this issue Jan 7, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@chlebowa
Copy link
Contributor

chlebowa commented Jan 7, 2025

What happened?

This is not necessarily a bug but is does interfere in some cases.

tm_g_distribution starts with Tests* (id = 'teal-main_ui-root-dist_1-module-dist_tests_input') unselected, which produces a validation error in the Tests output. This results in a validation error. Since it is impossible to set the theoretical distribution in the module call, this is inevitable.

Would it be possible to either
a) blocking the Tests output be achieved without raising a validation error,
b) add an argument to tm_g_distribution?

(*) probably should be "Test", by the way

sessionInfo()

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct.

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines.

Security Policy

  • I agree to follow this project's Security Policy.
@chlebowa chlebowa added the bug Something isn't working label Jan 7, 2025
@donyunardi
Copy link
Contributor

donyunardi commented Jan 8, 2025

Here's what it looks like
image

a) blocking the Tests output be achieved without raising a validation error,

If we hide the output until a test is selected, it might obscure the test feature for this module. I think the intention is to encourage users to select a test or to make user aware of the test output/selection.

We could also replace the validation with something more informative to highlight the presence of the "Test" feature if we have to remove the output when no test is selected.

b) add an argument to tm_g_distribution?

Possibly, it would have to be a required argument with a default value from one of the selection here to avoid the validation to trigger when nothing is selected.

teal.widgets::panel_item(
"Tests",
teal.widgets::optionalSelectInput(
ns("dist_tests"),
"Tests:",
choices = c(
"Shapiro-Wilk",
if (!is.null(args$strata_var)) "t-test (two-samples, not paired)",
if (!is.null(args$strata_var)) "one-way ANOVA",
if (!is.null(args$strata_var)) "Fligner-Killeen",
if (!is.null(args$strata_var)) "F-test",
"Kolmogorov-Smirnov (one-sample)",
"Anderson-Darling (one-sample)",
"Cramer-von Mises (one-sample)",
if (!is.null(args$strata_var)) "Kolmogorov-Smirnov (two-samples)"
),
selected = NULL
)
),

We could add a default value to the selected argument in the server logic since the choices are hard-coded anyway but this approach might feel too abrupt.

@chlebowa
Copy link
Contributor Author

chlebowa commented Jan 8, 2025

a) blocking the Tests output be achieved without raising a validation error,

If we hide the output until a test is selected, it might obscure the test feature for this module. I think the intention is to encourage users to select a test or to make user aware of the test output/selection.

We could also replace the validation with something more informative to highlight the presence of the "Test" feature if we have to remove the output when no test is selected.

That's what I meant. The validation message suppresses whatever output would be generated with no selection (probably errors). If the suppression is performed without validation errors, that's fine by me.
It is also les sinvasive than opening a new argument.

Would you like me to propose a change?

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

2 participants