Update hypothesis.R to allow for backquoted parameters#1722
Update hypothesis.R to allow for backquoted parameters#1722stemangiola wants to merge 2 commits intopaul-buerkner:masterfrom
Conversation
escape backquoted parameters from find_vars regexp
|
I think this would be good feature. Thank you! Adding some unit tests for this would be good. I suggest to add some in local tests (in tests/local/tests.models-5.R) would be great. Can you also slightly edit the style to fit with the general code style of brms. That is, use <- instead of = for assignments. Use |
|
Would you still be motivated to finish this PR? |
|
I will try to complete it in the following 2 weeks. |
|
Thank you!
Am Mi., 16. Apr. 2025 um 15:42 Uhr schrieb Stefano Mangiola <
***@***.***>:
… I will try to complete it in the following 2 weeks.
—
Reply to this email directly, view it on GitHub
<#1722 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADCW2AGWZUQBA5UMZPNBC2T2ZZM5BAVCNFSM6AAAAABUT3OLQGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMBZGYZTGOBVGQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
*stemangiola* left a comment (paul-buerkner/brms#1722)
<#1722 (comment)>
I will try to complete it in the following 2 weeks.
—
Reply to this email directly, view it on GitHub
<#1722 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADCW2AGWZUQBA5UMZPNBC2T2ZZM5BAVCNFSM6AAAAABUT3OLQGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMBZGYZTGOBVGQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
|
Is this PR still something you would like to work on? |
|
Hello Paul, yes, but I need to find some quiet time. If keeping it open for a long time is uncomfortable, feel free to close it, and I will reopen it when the opportunity arises. |
|
No worries, thank you for your response. I will keep it open for the time being. |
I happen to have this parameter
ethnicity_groupsNativeAmerican&PacificIslander, for a series of fits (30K genes, with 5K samples each, in a biological study) that take ~ 2 weeks, to run.The character
&would normally cause an error.Instead of rerunning everything, I have enabled
hypothesis()to allow for backquotes, such ashypothesis( c( "Europeans" = "(ethnicity_groupsAfrican + ethnicity_groupsEastAsian + ethnicity_groupsHispanicDLatinAmerican + ethnicity_groupsSouthAsian + `ethnicity_groupsNativeAmerican&PacificIslander`) / 5 = 0"If this is side-effect-free, I think it would be a great addition to give more flexibility to users. Afterall the modelling worked with atypical names, it would make sense the whole pipeline would.
If you are interested I could design a unit test.
Note: This PR is based on a ChatGPT suggestion that I cleaned up.