Description
causal_testing/generation/abstract_causal_test_case.py:30:4: R0913: Too many arguments (8/5) (too-many-arguments)
__init__
method for 'AbstractCausalTestCase' . Currently, we have
scenario: Scenario, # The testing scenario defining Variables and constraints
intervention_constraints: set[z3.ExprRef], # The constraints defining the testing intervention, e.g. "increase X by 4". This should be changed to a single constraint.
treatment_variable: Variable, # The treatment Variable, e.g. X. This should be referenced in the constraint above.
expected_causal_effect: dict[Variable:CausalTestOutcome], # The oracle, e.g. "Y should increase by 7". Can be changed to a (Variable, outcome) pair
effect_modifiers: set[Variable] = None, # The effect modifiers
estimate_type: str = "ate", # The causal effect measure, e.g. ate
effect: str = "total", # Total or direct effect
We discussed several options here. We could/should consider moving effect modifiers to be passed into the estimator instead. We should also be using abstract test case, and could also make another data class to handle effect
and estimate_type
.
causal_testing/generation/abstract_causal_test_case.py:79:4: R0914: Too many local variables (19/15) (too-many-locals)
I use this method to generate test cases and test data at the same time for efficiency reasons, but the method could perhaps be rewritten.
causal_testing/generation/abstract_causal_test_case.py:153:4: R0913: Too many arguments (6/5) (too-many-arguments)
Currently we have
self,
sample_size: int, # Test batch size (used for Latin hypercube sampling)
target_ks_score: float = None, # The target coverage of the input space
rct: bool = False, # Whether we want to run control and treatment values for each parameter configuration
seed: int = 0, # random seed
hard_max: int = 1000, # Hard maximum for the number of tests (in case target_ks_score cannot be reached)
causal_testing/generation/abstract_causal_test_case.py:153:4: R0914: Too many local variables (18/15) (too-many-locals)
This is a fairly complex method, but could potentially be rewritten.