Skip to content

Commit 4a86d9c

Browse files
Merge pull request #280 from CITCOM-project/python-311-compatible
Python 312 compatible
2 parents 61fa736 + d74e853 commit 4a86d9c

27 files changed

+132
-339
lines changed

.github/workflows/ci-tests-drafts.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
16-
python-version: ["3.9"]
16+
python-version: ["3.9", "3.10", "3.11", "3.12"]
1717
steps:
1818
- uses: actions/checkout@v2
1919
- name: Set up Python using Miniconda

.github/workflows/ci-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
matrix:
2020
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
21-
python-version: ["3.9"]
21+
python-version: ["3.9", "3.10", "3.11", "3.12"]
2222
steps:
2323
- uses: actions/checkout@v2
2424
- name: Set up Python using Miniconda

causal_testing/generation/abstract_causal_test_case.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""This module contains the class AbstractCausalTestCase, which generates concrete test cases"""
2+
23
import itertools
34
import logging
45
from enum import Enum

causal_testing/json_front/json_class.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ def _create_abstract_test_case(self, test, mutates, effects):
108108
self.scenario.variables[variable]: effects[effect]
109109
for variable, effect in test["expected_effect"].items()
110110
},
111-
effect_modifiers={self.scenario.variables[v] for v in test["effect_modifiers"]}
112-
if "effect_modifiers" in test
113-
else {},
111+
effect_modifiers=(
112+
{self.scenario.variables[v] for v in test["effect_modifiers"]} if "effect_modifiers" in test else {}
113+
),
114114
estimate_type=test["estimate_type"],
115115
effect=test.get("effect", "total"),
116116
)

causal_testing/specification/metamorphic_relation.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ def generate_follow_up(self, n_tests: int, min_val: float, max_val: float, seed:
7373
source_follow_up_test_inputs[[follow_up_input]]
7474
.rename(columns={follow_up_input: self.treatment_var})
7575
.to_dict(orient="records"),
76-
test_inputs.to_dict(orient="records")
77-
if not test_inputs.empty
78-
else [{}] * len(source_follow_up_test_inputs),
76+
(
77+
test_inputs.to_dict(orient="records")
78+
if not test_inputs.empty
79+
else [{}] * len(source_follow_up_test_inputs)
80+
),
7981
)
8082
]
8183

causal_testing/specification/scenario.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""This module holds the Scenario Class"""
2+
23
from collections.abc import Iterable, Mapping
34

45
from tabulate import tabulate

causal_testing/surrogate/surrogate_search_algorithms.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Module containing implementation of search algorithm for surrogate search """
2+
23
# Fitness functions are required to be iteratively defined, including all variables within.
34

45
from operator import itemgetter

causal_testing/testing/base_test_case.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""This module contains the BaseTestCase dataclass, which stores the information required for identification"""
2+
23
from dataclasses import dataclass
34
from causal_testing.specification.variable import Variable
45
from causal_testing.testing.effect import Effect

causal_testing/testing/causal_test_adequacy.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
This module contains code to measure various aspects of causal test adequacy.
33
"""
4+
45
from itertools import combinations
56
from copy import deepcopy
67
import pandas as pd

causal_testing/testing/causal_test_case.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""This module contains the CausalTestCase class, a class that holds the information required for a causal test"""
2+
23
import logging
34
from typing import Any
45
import numpy as np

0 commit comments

Comments
 (0)