-
Notifications
You must be signed in to change notification settings - Fork 0
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
Initial randomisation app commit #176
Conversation
from django.utils.text import slugify | ||
|
||
|
||
class Strata(models.Model): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed these models a bit now. Strategy isn't a parent of Strata anymore. You can now setup stratas and use them in multiple strategies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 small checks but 👍 regardless
from randomisation.models import StrataMatrix | ||
|
||
|
||
def validate_stratification_data(strategy, data): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got confused by this so I'm just checking: here we are validating that "data" (which would come from the API request) looks like a valid option for this strategy. Is that right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'm planning on adding docstrings that would make this clear
randomisation/tests/test_utils.py
Outdated
stratas[f"{random_age}_{random_province}"][random_arm] += 1 | ||
totals[random_arm] += 1 | ||
|
||
totals["Arm 1"] += 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to add 4 to this arm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha this is me testing that it actually fails if not balanced. probably explains why the tests are failing
No description provided.