Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cyclops/data/slicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ def _apply_mask(
months = pc.month(example_values)
mask = _apply_mask(months, month, mask)
if day is not None:
days = pc.year(example_values)
days = pc.day(example_values)
mask = _apply_mask(days, day, mask)
if hour is not None:
hours = pc.hour(example_values)
Expand Down
1 change: 0 additions & 1 deletion docs/source/tutorials/nihcxr/monitor_api.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"source": [
"\"\"\"NIHCXR Clinical Drift Experiments Tutorial.\"\"\"\n",
"\n",
"\n",
"import random\n",
"\n",
"import numpy as np\n",
Expand Down
14 changes: 14 additions & 0 deletions tests/cyclops/data/test_slicer_datetime.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""Focused datetime slicing tests."""

import pyarrow as pa

from cyclops.data.slicer import filter_datetime


def test_filter_datetime_matches_day_of_month() -> None:
"""Test filtering datetimes by day-of-month."""
table = pa.table({"dt": ["2020-01-07", "2020-01-14", "2021-01-07"]})

result = filter_datetime(table, column_name="dt", day=7)

assert result == [True, False, True]