feat: added endpoint option to date_range - #220
Conversation
feat: add more defaults to `from_calendar` function docs: ruff format `conf.py` docs: use `:py:func:` instead of `:func:` ci: bump versions for github actions ci: upload simpler reports to PRs ci: use `ubuntu-slim` as default OS
There was a problem hiding this comment.
Pull request overview
Adds API options for generating date ranges / calendar times, and updates docs + CI configuration accordingly.
Changes:
- Add
endpointoption totimescale.time.date_rangeand defaultmonth/dayvalues forTimescale.from_calendar. - Update module wrapper docstrings to use Sphinx
:py:roles. - Update CI workflows (runner OS labels, action versions, PR coverage reporting behavior) and ruff configuration.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
timescale/time.py |
Adds endpoint arg to date_range; adds default month/day for from_calendar. |
timescale/__init__.py |
Updates wrapper docstrings to Sphinx :py: roles. |
pyproject.toml |
Removes doc from ruff exclude list. |
pixi.lock |
Updates lockfile hash for local package entry. |
doc/source/conf.py |
Ruff formatting / quoting normalization. |
.github/workflows/ruff-format.yml |
Changes runner label and bumps checkout action major. |
.github/workflows/python-request.yml |
Adjusts triggers/permissions; changes action versions; adds PR-only reporting; adds draft gating. |
.github/workflows/python-publish.yml |
Changes release trigger, runner label, and bumps checkout action major. |
.github/workflows/auto-update-files.yml |
Changes runner label and simplifies job definition. |
.github/workflows/auto-update-bulletin-a.yml |
Changes runner label and simplifies job definition. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 11 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| runs-on: ubuntu-slim |
There was a problem hiding this comment.
ubuntu-slim is not a valid GitHub-hosted runner label, so this publish workflow will fail to start. Use a supported runner label such as ubuntu-latest/ubuntu-22.04/ubuntu-24.04.
| runs-on: ubuntu-slim | |
| runs-on: ubuntu-latest |
| run: | ||
| shell: bash -l {0} | ||
|
|
||
| runs-on: ubuntu-slim |
There was a problem hiding this comment.
ubuntu-slim is not a valid GitHub-hosted runner label, so this scheduled job will not run. Use a supported runner label such as ubuntu-latest or ubuntu-22.04.
| runs-on: ubuntu-slim | |
| runs-on: ubuntu-latest |
| start = np.array(parse(start), dtype=f"datetime64[{units}]") | ||
| if isinstance(end, str): | ||
| end = np.array(parse(end), dtype=f"datetime64[{units}]") | ||
| # create date range | ||
| return np.arange(start, end + step, step) | ||
| return np.arange(start, end + endpoint * step, step) |
There was a problem hiding this comment.
date_range advertises support for datetime.datetime inputs, but only string inputs are converted to datetime64. If callers pass datetime.datetime, np.arange will receive non-datetime64 values and is likely to error or produce object arrays. Convert datetime.datetime inputs to datetime64[{units}] (or tighten the type hints/docs to match supported types).
| exp = 58849 + np.arange(32) | ||
| assert np.all(ts.MJD == exp) | ||
| ts = timescale.from_range('2020-01-01','2020-02-01',1,'D',endpoint=False) | ||
| exp = 58849 + np.arange(31) | ||
| assert np.all(ts.MJD == exp) |
There was a problem hiding this comment.
There’s trailing whitespace after the assertions, which will cause formatter/linter noise and can fail strict checks. Remove the extra spaces so the file stays clean under ruff/flake8.
| run: | ||
| shell: bash -l {0} | ||
|
|
||
| runs-on: ubuntu-slim |
There was a problem hiding this comment.
ubuntu-slim is not a valid GitHub-hosted runner label, so this scheduled job will not run. Switch to a supported Ubuntu runner label (e.g., ubuntu-latest or a pinned ubuntu-22.04).
| runs-on: ubuntu-slim | |
| runs-on: ubuntu-22.04 |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
feat: raise original exceptions in cases of `HTTPError`/`URLError`
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
feat: add more defaults to
from_calendarfunctiondocs: ruff format
conf.pydocs: use
:py:func:instead of:func:ci: bump versions for github actions
ci: upload simpler reports to PRs
ci: use
ubuntu-slimas default OS