Skip to content

Commit

Permalink
Merge pull request #84 from dh-tech/experiment/numpy-datetime64
Browse files Browse the repository at this point in the history
Use numpy datetime64  instead of datetime.date #77
  • Loading branch information
rlskoeser authored Nov 7, 2024
2 parents fcacf38 + 0806dc9 commit 5c97e4b
Show file tree
Hide file tree
Showing 22 changed files with 659 additions and 480 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
run: pip install -e ".[dev]"
if: steps.python-cache.outputs.cache-hit != 'true'

# check code style
- name: Run black
run: black src --check --diff
# check with ruff
- name: Run ruff
run: ruff check

# check docs
- name: Check that documentation can be built
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

env:
# python version used to calculate and submit code coverage
COV_PYTHON_VERSION: "3.11"
COV_PYTHON_VERSION: "3.12"

jobs:
python-unit:
Expand Down
12 changes: 7 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
files: \.py
repos:
- repo: https://github.com/psf/black
rev: 22.10.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
hooks:
- id: black
- id: ruff
args: [ --select, I, --fix, --exit-non-zero-on-fix ]
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
Expand All @@ -14,7 +16,7 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
rev: v1.13.0
hooks:
- id: mypy
additional_dependencies: [types-python-dateutil]
additional_dependencies: [numpy]
1 change: 1 addition & 0 deletions .pythonversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Python 3.12.7
3 changes: 2 additions & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ We use [All Contributors](https://allcontributors.org/) because we recognize tha

### Related blog posts

- [by Rebecca Sutton Koeser](#blog-rlskoeser)
(blog-rlskoeser)=
#### [by Rebecca Sutton Koeser](#blog-rlskoeser)
- [Join me for a DHTech hackathon? It’s an un-date!](https://dh-tech.github.io/blog/2023-02-09-hackathon-summary/) 2023-02-09 on DHTech blog
14 changes: 8 additions & 6 deletions DEVELOPER_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ If you cannot or prefer not to install git flow, you can do the equivalent manua

### Create a Python virtual environment

Use a recent version of python 3. We highly recommend using a python virtualenv, e.g.
Use a recent version of python 3 (we recommend 3.12). If you use [pyenv](https://github.com/pyenv/pyenv), run `pyenv install` to get the current recommended python version for development (specified in `.pythonversion`).

We highly recommend using a python virtualenv to isolate dependencies, e.g.
```
python3 -m venv undate
source undate/bin/activate
python3 -m venv .venv
source .venv/bin/activate
```

### Install local version of undate with development python dependencies
Expand All @@ -47,12 +49,12 @@ pip install -e ".[dev]"

### Install pre-commit hooks

We use [pre-commit](https://pre-commit.com/) for automated checks and consistent formatting. If you're planning to contribute, please install these when you set up your local development.

```sh
pre-commit install
```

We use [pre-commit](https://pre-commit.com/) for automated checks and consistent formatting. If you're planning to contribute, please install these when you set up your local development.

## Tests, documentation, and other checks

### Running unit tests
Expand All @@ -65,7 +67,7 @@ To test cases by method name, use `-k`: `pytest -k test_str`

### Check python types

Python typing is currently enforced on pull requests as part of a GitHub Actions Continuous Integration check using `mypy`.
Python typing is currently enforced on pull requests as part of a GitHub Actions Continuous Integration check using `mypy` and via pre-commit hook.

To check types locally:
1. Install the necessary typing libraries (first run only):
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ It was initially created as part of a [DH-Tech](https://dh-tech.github.io/) hack
[![Documentation Status](https://readthedocs.org/projects/undate-python/badge/?version=latest)](https://undate-python.readthedocs.io/en/latest/?badge=latest)
[![unit tests](https://github.com/dh-tech/undate-python/actions/workflows/unit_tests.yml/badge.svg)](https://github.com/dh-tech/undate-python/actions/workflows/unit_tests.yml)
[![codecov](https://codecov.io/gh/dh-tech/undate-python/branch/main/graph/badge.svg?token=GE7HZE8C9D)](https://codecov.io/gh/dh-tech/undate-python)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](CONTRIBUTORS.md)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@
}

# turn on relative links; make sure both github and sphinx links work
m2r_parse_relative_links = True
myst_enable_extensions = ["linkify"]
Loading

0 comments on commit 5c97e4b

Please sign in to comment.