diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e40cdc9..02d971c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, windows-latest] env: ["py310", "py311", "py312"] steps: - name: Checkout branch diff --git a/metalearners/_utils.py b/metalearners/_utils.py index 2767d5a..a39c2c2 100644 --- a/metalearners/_utils.py +++ b/metalearners/_utils.py @@ -234,9 +234,10 @@ def convert_treatment(treatment: Vector) -> np.ndarray: new_treatment = treatment.to_numpy() if new_treatment.dtype == bool: return new_treatment.astype(int) - elif new_treatment.dtype == float and all(x.is_integer() for x in new_treatment): + if new_treatment.dtype == float and all(x.is_integer() for x in new_treatment): return new_treatment.astype(int) - elif new_treatment.dtype != int: + + if not pd.api.types.is_integer_dtype(new_treatment): raise TypeError( "Treatment must be boolean, integer or float with integer values." )