Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/build-and-deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ on:
jobs:
build-docs:
name: Build docs and push to gh-pages
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@master
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@v6

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ on:
jobs:
build-n-publish:
name: Build and publish to PyPI
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-and-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10"]
python: ["3.9", "3.10", "3.11"]
name: Python ${{ matrix.python }} tests
steps:
- name: Checkout branch
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@master
Expand All @@ -26,7 +26,7 @@ jobs:

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ Full documentation can be found [here](https://quant-aq.github.io/cli/).

## Dependencies

This tool is built for Python 3.6.1+ and has the following key dependencies
This tool is built for Python 3.9+ and has the following key dependencies

```
python = ">=3.8,<4.0"
pandas = ">=1.0.4"
python = ">=3.9, <3.14"
pandas = ">=2.1.4,<2.2"
```

More details can be found in the `pyproject.toml` file at the base of this repository.
Expand Down
1,633 changes: 1,021 additions & 612 deletions poetry.lock

Large diffs are not rendered by default.

35 changes: 16 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,41 +1,38 @@
[tool.poetry]
name = "quantaq-cli"
version = "0.5.0"
version = "1.0.0rc0"
description = "The QuantAQ CLI"
authors = ["David H Hagan <david.hagan@quant-aq.com>"]
license = "Apache License 2.0"
license = "Apache-2.0"
readme = "README.md"
homepage = ""
repository = "https://github.com/quant-aq/cli"
documentation = ""
documentation = "https://quant-aq.github.io/cli/"
keywords = []
classifiers = []

[tool.poetry.dependencies]
python = ">=3.8,<4"
pandas = ">=1.0.4"
python = ">=3.9, <3.14"
pandas = ">=2.1.4,<2.2"
click = "^7.1.2"
pyarrow = ">=0.17.1"
pyarrow = ">=14.0.2"
terminaltables = "^3.1.0"
Comment thread
emmleroy marked this conversation as resolved.
urllib3 = "^1.26.10"
numpy = "^1.23.2"
rich-click = "^1.5.2"
rich-click = ">=1.7.2"

[tool.poetry.dev-dependencies]
[tool.poetry.group.dev.dependencies]
pytest = "^6.2.5"
pytest-coverage = "^0.0"
sphinx = "^5.3"
recommonmark = "^0.6.0"
pytest-cov = ">=0.0"
sphinx = "^7.0"
myst-parser = "^2.0"
toml = "^0.10.1"
sphinx-click = "^4.4"
sphinx-rtd-theme = "^0.5.0"
sphinx-click = "^5.0"
sphinx-rtd-theme = "^2.0"
setuptools = "^65.6.3"

[tool.poetry.scripts]
quantaq-cli = "quantaq_cli.console:main"

[tool.poetry.group.dev.dependencies]
setuptools = "^65.6.3"

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
9 changes: 3 additions & 6 deletions quantaq_cli/console/commands/merge.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from pathlib import Path
import pandas as pd
from pandas.api.types import is_datetime64_any_dtype, is_timedelta64_dtype
import numpy as np
import click

Expand Down Expand Up @@ -41,16 +42,12 @@ def merge_command(files, output, **kwargs):
continue

# convert the timestamp column to a pandas datetime
if not pd.core.dtypes.common.is_datetime_or_timedelta_dtype(tmp[tscol]):
if not (is_datetime64_any_dtype(tmp[tscol]) or is_timedelta64_dtype(tmp[tscol])):
tmp[tscol] = tmp[tscol].apply(lambda x: pd.to_datetime(x, errors='coerce'))

# drop the bad rows
tmp = tmp.dropna(how='any', subset=[tscol])

# re-convert to timestamp in case it's not
if not pd.core.dtypes.common.is_datetime_or_timedelta_dtype(tmp[tscol]):
tmp[tscol] = tmp[tscol].apply(lambda x: pd.to_datetime(x, errors='raise'))

# localize the timezone if needed
tmp[tscol] = tmp[tscol].apply(lambda x: x.tz_localize("UTC") if not x.tzinfo else x)

Expand Down
Loading