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

PyLint: Module causal_testing.generation.abstract_causal_test_case #155

Open
jmafoster1 opened this issue Mar 9, 2023 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@jmafoster1
Copy link
Contributor

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.

@f-allian f-allian added the enhancement New feature or request label Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants