Skip to content

Commit

Permalink
chore: pre-commit autoupdate (#142)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Jan 14, 2025
1 parent b965d93 commit 85d94bd
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.9.1
hooks:
- id: ruff
args: [ --fix ]
Expand Down
56 changes: 30 additions & 26 deletions src/pystatpower/models/two_proportion.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,16 +329,16 @@ def __init__(
case option if option == GroupAllocationOption.SIZE_OF_TOTAL | GroupAllocationOption.SIZE_OF_REFERENCE:
self.treatment_size_formula = lambda: size_of_total - size_of_reference
self.reference_size_formula = lambda: size_of_reference
case (
option
) if option == GroupAllocationOption.SIZE_OF_TOTAL | GroupAllocationOption.RATIO_OF_TREATMENT_TO_REFERENCE:
case option if (
option == GroupAllocationOption.SIZE_OF_TOTAL | GroupAllocationOption.RATIO_OF_TREATMENT_TO_REFERENCE
):
self.treatment_size_formula = (
lambda: size_of_total * ratio_of_treatment_to_reference / (1 + ratio_of_treatment_to_reference)
)
self.reference_size_formula = lambda: size_of_total / (1 + ratio_of_treatment_to_reference)
case (
option
) if option == GroupAllocationOption.SIZE_OF_TOTAL | GroupAllocationOption.RATIO_OF_REFERENCE_TO_TREATMENT:
case option if (
option == GroupAllocationOption.SIZE_OF_TOTAL | GroupAllocationOption.RATIO_OF_REFERENCE_TO_TREATMENT
):
self.treatment_size_formula = lambda: size_of_total / (1 + ratio_of_reference_to_treatment)
self.reference_size_formula = lambda: (
size_of_total * ratio_of_reference_to_treatment / (1 + ratio_of_reference_to_treatment)
Expand All @@ -352,50 +352,54 @@ def __init__(
case option if option == GroupAllocationOption.SIZE_OF_TREATMENT | GroupAllocationOption.SIZE_OF_REFERENCE:
self.treatment_size_formula = lambda: size_of_treatment
self.reference_size_formula = lambda: size_of_reference
case (
case option if (
option
) if option == GroupAllocationOption.SIZE_OF_TREATMENT | GroupAllocationOption.RATIO_OF_TREATMENT_TO_REFERENCE:
== GroupAllocationOption.SIZE_OF_TREATMENT | GroupAllocationOption.RATIO_OF_TREATMENT_TO_REFERENCE
):
self.treatment_size_formula = lambda: size_of_treatment
self.reference_size_formula = lambda: size_of_treatment / ratio_of_treatment_to_reference
case (
case option if (
option
) if option == GroupAllocationOption.SIZE_OF_TREATMENT | GroupAllocationOption.RATIO_OF_REFERENCE_TO_TREATMENT:
== GroupAllocationOption.SIZE_OF_TREATMENT | GroupAllocationOption.RATIO_OF_REFERENCE_TO_TREATMENT
):
self.treatment_size_formula = lambda: size_of_treatment
self.reference_size_formula = lambda: size_of_treatment * ratio_of_reference_to_treatment
case (
option
) if option == GroupAllocationOption.SIZE_OF_TREATMENT | GroupAllocationOption.PERCENT_OF_TREATMENT:
case option if (
option == GroupAllocationOption.SIZE_OF_TREATMENT | GroupAllocationOption.PERCENT_OF_TREATMENT
):
self.treatment_size_formula = lambda: size_of_treatment
self.reference_size_formula = (
lambda: size_of_treatment * (1 - percent_of_treatment) / percent_of_treatment
)
case (
option
) if option == GroupAllocationOption.SIZE_OF_TREATMENT | GroupAllocationOption.PERCENT_OF_REFERENCE:
case option if (
option == GroupAllocationOption.SIZE_OF_TREATMENT | GroupAllocationOption.PERCENT_OF_REFERENCE
):
self.treatment_size_formula = lambda: size_of_treatment
self.reference_size_formula = (
lambda: size_of_treatment * percent_of_reference / (1 - percent_of_reference)
)
case (
case option if (
option
) if option == GroupAllocationOption.SIZE_OF_REFERENCE | GroupAllocationOption.RATIO_OF_TREATMENT_TO_REFERENCE:
== GroupAllocationOption.SIZE_OF_REFERENCE | GroupAllocationOption.RATIO_OF_TREATMENT_TO_REFERENCE
):
self.treatment_size_formula = lambda: size_of_reference * ratio_of_treatment_to_reference
self.reference_size_formula = lambda: size_of_reference
case (
case option if (
option
) if option == GroupAllocationOption.SIZE_OF_REFERENCE | GroupAllocationOption.RATIO_OF_REFERENCE_TO_TREATMENT:
== GroupAllocationOption.SIZE_OF_REFERENCE | GroupAllocationOption.RATIO_OF_REFERENCE_TO_TREATMENT
):
self.treatment_size_formula = lambda: size_of_reference / ratio_of_reference_to_treatment
self.reference_size_formula = lambda: size_of_reference
case (
option
) if option == GroupAllocationOption.SIZE_OF_REFERENCE | GroupAllocationOption.PERCENT_OF_TREATMENT:
case option if (
option == GroupAllocationOption.SIZE_OF_REFERENCE | GroupAllocationOption.PERCENT_OF_TREATMENT
):
self.treatment_size_formula = (
lambda: size_of_reference * percent_of_treatment / (1 - percent_of_treatment)
)
self.reference_size_formula = lambda: size_of_reference
case (
option
) if option == GroupAllocationOption.SIZE_OF_REFERENCE | GroupAllocationOption.PERCENT_OF_REFERENCE:
case option if (
option == GroupAllocationOption.SIZE_OF_REFERENCE | GroupAllocationOption.PERCENT_OF_REFERENCE
):
self.treatment_size_formula = (
lambda: size_of_reference * (1 - percent_of_reference) / percent_of_reference
)
Expand Down

0 comments on commit 85d94bd

Please sign in to comment.