Skip to content

Commit

Permalink
Enable Windows unit tests in CI (#32)
Browse files Browse the repository at this point in the history
* Enable Windows tests.

* Use pandas' check for int.
  • Loading branch information
kklein authored Jun 26, 2024
1 parent 2adf3af commit 34b9cde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions metalearners/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
)
Expand Down

0 comments on commit 34b9cde

Please sign in to comment.