Skip to content

Commit 867c5ca

Browse files
committed
Clean up, improve documentation, and prep for release
Includes several items suggested or flagged by @coderabbitai
1 parent 1b94c78 commit 867c5ca

File tree

18 files changed

+49
-48
lines changed

18 files changed

+49
-48
lines changed

.github/workflows/check.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ jobs:
2121
cache-dependency-path: '**/pyproject.toml'
2222
- name: Install package with development dependencies
2323
run: pip install -e ".[dev]"
24-
if: steps.python-cache.outputs.cache-hit != 'true'
24+
if: steps.setup-python.outputs.cache-hit != 'true'
2525

2626
# check with ruff
2727
- name: Run ruff
2828
run: ruff check
2929

30-
# check docs
31-
- name: Check that documentation can be built
32-
run: sphinx-build docs docs/_build # --fail-on-warning
30+
# check docs build
31+
- name: Check that documentation builds with no errors or warnings
32+
run: sphinx-build docs docs/_build --fail-on-warning
3333

3434
# check types with mypy
3535
- name: Check types in python src directory; install needed types

.github/workflows/unit_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Install package with dependencies
3535
run: |
3636
pip install -e ".[test]"
37-
if: steps.python-cache.outputs.cache-hit != 'true'
37+
if: steps.setup-python.outputs.cache-hit != 'true'
3838

3939
# for all versions but the one we use for code coverage, run normally
4040
- name: Run unit tests normally

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ repos:
44
rev: v0.3.4
55
hooks:
66
- id: ruff
7-
args: [ --select, I, --fix, --exit-non-zero-on-fix ]
7+
args: [ --fix, --exit-non-zero-on-fix ]
88
- id: ruff-format
99
- repo: https://github.com/pre-commit/pre-commit-hooks
1010
rev: v4.3.0

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
- Improved EDTF support:
1010
- Support 5+ digit years with leading Y (thanks to numpy.datetime64)
1111
- Jupyter notebook demonstrating / validating EDTF support
12+
- Full support for Level 0 Date and Time Interval (no Date and Time support)
13+
- Level 1:
14+
- Letter-prefixed cbalendar year
15+
- Unspecified digit from the right
16+
- Partial support for extended interval
17+
- Level 2: unspecified digit anywhere in the date
1218
- Improved readme with example usage and disclaimers about current functionality
1319
- Improved documentation for adding new converters
1420
- Improved documentation for branching guidelines in contributing

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ authors:
2525
family-names: Casties
2626
affiliation: Max Planck Institute for the History of Science
2727
orcid: https://orcid.org/0009-0008-9370-1303
28-
version: '0.2'
29-
date-released: 2024-04-25
28+
version: '0.3'
29+
date-released: 2024-11-18
3030
repository-code: https://github.com/dh-tech/undate-python
3131
license: Apache 2

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ Available converters are "ISO8601" and "EDTF" (but only)
156156
<UndateInterval 1800/1900>
157157
```
158158

159+
For more examples, refer to the [example notebooks](examples/notebooks/) included in this repository.
160+
159161
## Documentation
160162

161163
Project documentation is [available on ReadTheDocs](https://undate-python.readthedocs.io/en/latest/).

docs/conf.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@
6363
# so a file named "default.css" will overwrite the builtin "default.css".
6464
html_static_path = ["_static"]
6565

66-
# preliminary undate logo
67-
# html_logo = "_static/undate_logo.png"
68-
6966
html_theme_options = {
7067
"logo": "undate_logo.png",
7168
"logo_name": False,

examples/notebooks/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# `undate` demo notebooks
2+
3+
This folder contains code notebooks demonstrating how undate can be used on a specific dataset or for a specific problem.
4+
5+
- [EDTF support](edtf-support.ipynb) - demonstrate and validate supported portions of the Extended Date Time Format (EDTF) specification
6+
- [Partial date duration logic](shxco_partial_date_durations.ipynb) - compare `undate` partial date range duration logic with a previous implementation in the _Shakespeare and Company Project_

examples/notebooks/edtf-support.ipynb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
},
5656
{
5757
"cell_type": "code",
58-
"execution_count": 4,
58+
"execution_count": 2,
5959
"id": "9c6b7379-b2a7-4ec1-afa5-2cd9832c8a5d",
6060
"metadata": {},
6161
"outputs": [],
@@ -212,7 +212,7 @@
212212
},
213213
{
214214
"cell_type": "code",
215-
"execution_count": 16,
215+
"execution_count": 5,
216216
"id": "8d98a139-627b-40bd-b1c5-d0028e538a53",
217217
"metadata": {},
218218
"outputs": [],
@@ -268,9 +268,9 @@
268268
"\n",
269269
"# Example 2\n",
270270
"# parse\n",
271-
"assert Undate.parse(\"-Y170000002\", \"EDTF\").year == \"-170000002\"\n",
271+
"assert Undate.parse(\"Y-170000002\", \"EDTF\").year == \"-170000002\"\n",
272272
"# format\n",
273-
"assert str(Undate(-170000002)) == \"-Y170000002\""
273+
"assert str(Undate(-170000002)) == \"Y-170000002\""
274274
]
275275
},
276276
{
@@ -425,7 +425,7 @@
425425
},
426426
{
427427
"cell_type": "code",
428-
"execution_count": 9,
428+
"execution_count": 8,
429429
"id": "e47f3fff-d35c-4c2e-9568-214763f6511a",
430430
"metadata": {},
431431
"outputs": [],
@@ -481,7 +481,7 @@
481481
},
482482
{
483483
"cell_type": "code",
484-
"execution_count": 10,
484+
"execution_count": 9,
485485
"id": "39143c1f-932a-450c-9b2d-ffbe3e1416b0",
486486
"metadata": {},
487487
"outputs": [],
@@ -535,7 +535,7 @@
535535
},
536536
{
537537
"cell_type": "code",
538-
"execution_count": 11,
538+
"execution_count": 10,
539539
"id": "95965f17-0bd5-446f-bc09-9503eaed68e2",
540540
"metadata": {},
541541
"outputs": [],
@@ -589,7 +589,7 @@
589589
},
590590
{
591591
"cell_type": "code",
592-
"execution_count": 12,
592+
"execution_count": 11,
593593
"id": "c6c2d1a1-39f1-45eb-ac08-1de4fadbe842",
594594
"metadata": {},
595595
"outputs": [],
@@ -640,7 +640,7 @@
640640
},
641641
{
642642
"cell_type": "code",
643-
"execution_count": 15,
643+
"execution_count": 12,
644644
"id": "f24fd31a-176a-40b5-bff4-d72b68f32a18",
645645
"metadata": {},
646646
"outputs": [],
@@ -688,7 +688,7 @@
688688
},
689689
{
690690
"cell_type": "code",
691-
"execution_count": 14,
691+
"execution_count": 13,
692692
"id": "5910caab-eada-4715-b863-9bbbb15b9c5c",
693693
"metadata": {},
694694
"outputs": [],

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ classifiers = [
4949

5050
[project.optional-dependencies]
5151
docs = ["sphinx>=7.0.0", "alabaster", "myst-parser", "myst-parser[linkify]"]
52+
test = ["pytest>=7.2", "pytest-ordering", "pytest-cov"]
5253
dev = [
5354
"ruff",
5455
"pre-commit>=2.20.0",
@@ -57,19 +58,17 @@ dev = [
5758
"build",
5859
"mypy",
5960
"treon",
60-
"undate",
6161
"undate[docs]",
6262
"undate[test]",
6363
]
64-
test = ["pytest>=7.2", "pytest-ordering", "pytest-cov"]
65-
all = ["undate[dev]", "undate[test]"]
64+
all = ["undate", "undate[dev]"]
6665

6766
[project.urls]
6867
Homepage = "https://github.com/dh-tech/undate-python"
6968
Documentation = "https://undate-python.readthedocs.io/en/latest/"
7069
Repository = "https://github.com/dh-tech/undate-python.git"
7170
Issues = "https://github.com/dh-tech/undate-python/issues"
72-
Changelog = "https://github.com/dh-tech/undate/main/master/CHANGELOG.md"
71+
Changelog = "https://github.com/dh-tech/undate-python/blob/main/CHANGELOG.md"
7372

7473

7574
[tool.hatch.version]

0 commit comments

Comments
 (0)