Skip to content

Conversation

@xiaotongchang-creator
Copy link
Contributor

No description provided.

period_axis = PeriodAxis.from_series(series_date)
assert period_axis.between(np.datetime64("2023-01-02"), np.datetime64("2023-01-03")).tolist() == [1]
assert period_axis.between(np.datetime64("2023-01-02"), np.datetime64("2023-01-03"), closed=Closed.BOTH).tolist() == [1, 2]
assert period_axis.between(np.datetime64("2023-01-02"), np.datetime64("2023-01-03"), closed=Closed.RIGHT).tolist() == [2] No newline at end of file
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also we need general linting and formatting like last time :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I added a pre-commit dependency and defined formatting and type check as the steps in the pre-commit. I'd love to show you but I currently can't commit because it is failing type checks lol. But let me know if you think if it's a good idea, once you get back to me on the closed parameter issue, and I push the changes.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've seen some integrated CIs running in GitHub actions that gets auto run and tagged onto the commit/PR. that issue you're dealing with is the exact reason i'd be hesitant to add a pre-commit hook

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi James, please have a look at the pre-commit yaml file, let me know if you think the steps are okay to include.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like exactly what we should run as pre-commit, check out the checks i added for #7. i'll merge these pre-commit changes along with that.

i'll just need you to 1. create a new branch with only the pre-commit changes, 2. amend the pre-commit changes off of this commit, and then i can incorporate that commit into #7.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. The branch I created is called: add-pre-commit-steps, but it only has pre-commit and github CI actions. Let me know if I misunderstood you.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! that's all, it's merged now

@xiaotongchang-creator xiaotongchang-creator force-pushed the unit-test-period-axis branch 4 times, most recently from 5325d35 to 7954ad2 Compare January 11, 2026 16:51
@jathoms
Copy link
Owner

jathoms commented Jan 12, 2026

nice! this brings us up to about 40% coverage overall already

@jathoms jathoms merged commit 153f902 into jathoms:main Jan 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants