Skip to content

Commit e655936

Browse files
committed
Merge branch 'develop' into feature/combined-parser
2 parents 7a99c5c + ceec78b commit e655936

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+6691
-662
lines changed

.all-contributorsrc

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,25 @@
6868
"test",
6969
"doc"
7070
]
71+
},
72+
{
73+
"login": "taylor-arnold",
74+
"name": "Taylor Arnold",
75+
"avatar_url": "https://avatars.githubusercontent.com/u/5752184?v=4",
76+
"profile": "http://taylorarnold.org",
77+
"contributions": [
78+
"review",
79+
"ideas"
80+
]
81+
},
82+
{
83+
"login": "rettinghaus",
84+
"name": "Klaus Rettinghaus",
85+
"avatar_url": "https://avatars.githubusercontent.com/u/7693447?v=4",
86+
"profile": "https://github.com/rettinghaus",
87+
"contributions": [
88+
"maintenance"
89+
]
7190
}
7291
],
7392
"contributorsPerLine": 7,
@@ -77,5 +96,6 @@
7796
"repoHost": "https://github.com",
7897
"projectName": "undate-python",
7998
"projectOwner": "dh-tech",
80-
"badgeTemplate": "![All Contributors](https://img.shields.io/github/all-contributors/dh-tech/undate-python?color=ee8449&style=flat-square)"
99+
"badgeTemplate": "![All Contributors](https://img.shields.io/github/all-contributors/dh-tech/undate-python?color=ee8449&style=flat-square)",
100+
"commitType": "docs"
81101
}

.github/workflows/check.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Check style + docs + types
33
on:
44
pull_request:
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
check:
811
runs-on: ubuntu-latest
@@ -12,28 +15,33 @@ jobs:
1215
working-directory: .
1316

1417
steps:
15-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@v5
1619
- name: Set up Python 3.12
17-
uses: actions/setup-python@v5
20+
uses: actions/setup-python@v6
1821
with:
1922
python-version: "3.12"
20-
cache: 'pip'
21-
cache-dependency-path: '**/pyproject.toml'
22-
- name: Install package with development dependencies
23-
run: pip install -e ".[dev]"
23+
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v6
26+
with:
27+
enable-cache: true
28+
cache-dependency-glob: "pyproject.toml"
29+
30+
- name: Install package with check dependencies
31+
run: uv sync --extra check
2432

2533
# check with ruff
2634
- name: Run ruff
27-
run: ruff check
35+
run: uv run ruff check
2836

2937
# check docs build
3038
- name: Check that documentation builds with no errors or warnings
31-
run: sphinx-build docs docs/_build --fail-on-warning
39+
run: uv run sphinx-build docs docs/_build --fail-on-warning
3240

3341
# check types with mypy
3442
- name: Check types in python src directory; install needed types
35-
run: mypy --install-types --non-interactive src
43+
run: uv run mypy --install-types --non-interactive src
3644

3745
# use treon to make sure that example notebooks run
3846
- name: Check jupyter notebooks with treon
39-
run: treon
47+
run: uv run treon

.github/workflows/python-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
runs-on: ubuntu-latest
2222

2323
steps:
24-
- uses: actions/checkout@v3
24+
- uses: actions/checkout@v5
2525
- name: Set up Python
26-
uses: actions/setup-python@v3
26+
uses: actions/setup-python@v6
2727
with:
2828
python-version: '3.x'
2929
- name: Install dependencies

.github/workflows/unit_tests.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: unit tests
22

3+
permissions:
4+
contents: read
5+
id-token: write
6+
37
on:
48
push:
59
branches:
@@ -20,32 +24,38 @@ jobs:
2024
runs-on: ubuntu-latest
2125
strategy:
2226
matrix:
23-
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
27+
python: ["3.10", "3.11", "3.12", "3.13"]
2428
defaults:
2529
run:
2630
working-directory: .
2731

2832
steps:
29-
- uses: actions/checkout@v3
30-
- name: Set up Python ${{ matrix.python-version }}
31-
uses: actions/setup-python@v4
33+
- uses: actions/checkout@v5
34+
35+
# use github python action instead of uv to take advantage of caching
36+
- name: Set up Python ${{ matrix.python }}
37+
uses: actions/setup-python@v6
3238
with:
3339
python-version: ${{ matrix.python }}
3440
cache: 'pip'
3541
cache-dependency-path: '**/pyproject.toml'
42+
3643
- name: Install package with dependencies
3744
run: pip install -e ".[test]"
3845

3946
# for all versions but the one we use for code coverage, run normally
40-
- name: Run unit tests normally
47+
- name: Run unit tests without code coverage
4148
run: pytest
4249
if: ${{ matrix.python != env.COV_PYTHON_VERSION }}
4350

4451
# run code coverage in one version only
4552
- name: Run unit tests with code coverage reporting
46-
run: pytest --cov=undate
53+
run: pytest --cov=.
4754
if: ${{ matrix.python == env.COV_PYTHON_VERSION }}
48-
- name: Upload test coverage to Codecov
49-
uses: codecov/codecov-action@v3
55+
56+
- name: Upload coverage to Codecov
57+
uses: codecov/codecov-action@v5
58+
env:
59+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
5060
if: ${{ matrix.python == env.COV_PYTHON_VERSION }}
5161

CHANGELOG.md

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,50 @@
11
# Change Log
22

3+
## 0.5.2
4+
- repr for Undate, UndateInterval, and UnDelta now produce fully-qualified, constructor-style strings with deterministic field ordering.
5+
- Added Undate.unknown_year property and is_unknown() method to check for fully-unknown year/month/day.
6+
- bugfix: comparisons (eq, gt, lt) and contains (in) now return False when year is unknown
7+
- bugfix: month durations for non-Gregorian dates now returns an integer when month length is known
8+
9+
## 0.5.1
10+
- Correct license identifier in CITATION.cff so it is valid
11+
12+
## 0.5
13+
14+
- New `UnDelta` and `UnInt` classes for uncertain durations
15+
- `Undate.duration` now returns either a `Timedelta` or an `UnDelta` if the duration is ambiguous
16+
- New properties `possible_years` and `representative_years` on `Undate` class, used for calculating durations for uncertain years and months
17+
- New `weekday` method on class `undate.date.Date`
18+
- Calendar converter improvements:
19+
- Calendar converter classes can optional provide minimum and maximum years for uncertain dates
20+
- New calendar methods `days_in_year` and `representative_years`
21+
- Hebrew date parser now allows for week days, along with additional month variants
22+
- Preliminary Seleucide calendar converter class, based on Hebrew calendar with a year offset
23+
- New method `as_calendar` on `Undate` class, to set calendar without doing any conversion
24+
- Readme examples have been improved and extended
25+
- New example notebook testing Hebrew, Islamic, and Seleucid date parsing and conversion with Princeton Geniza Project data
26+
- bugfix: duration for uncertain years previously returned the duration from earliest to latest possible dates in range; now returns an `UnDelta` with the possible durations for the possible years in the given calendar
27+
28+
## 0.4
29+
30+
- Undate is now Calendar aware / Calendar explicit; default is Gregorian
31+
- New `BaseCalendarConverter` class, with additional methods required for calendar converters
32+
- `HebrewDateConverter`: Parsing and calendar conversion for Hebrew/Anno Mundi
33+
- `IslamicDateConverter`: Parsing and calendar conversion for Islamic/Hijri
34+
- `GregorianDateConverter`: basic Gregorian calendar logic
35+
- `undate.Calendar` class to track `Undate` object calendar, and match with calendar converters
36+
- BaseDateConverter class now includes nested/descendant subclasses when looking
37+
for available converters
38+
- `Undate.to_undate` method to convert supported date objects to `Undate` (`datetime.date`, `datetime.datetime`, and internal `undate.date.Date` class)
39+
- `UndateInterval` improvements
40+
- Can be initialized with `Undate` objects or any type supported by `Undate.to_undate`
41+
- New method for contains (`in`), to determine if another interval or date is contained by an interval
42+
- New method `intersection` to determine the overlap between two `UndateInterval` objects
43+
- EDTF parser : fixed day parsing for some unsupported cases
44+
- Dropped support for Python 3.9
45+
- Reorganized examples folder to avoid unnecessary nesting
46+
- ISMI data has been updated from older JSON data to examples in RDF (turtle)
47+
348
## 0.3.1
449

550
Update readthedocs config for current installation
@@ -14,7 +59,7 @@ Update readthedocs config for current installation
1459
- Support 5+ digit years with leading Y (thanks to numpy.datetime64)
1560
- Jupyter notebook demonstrating / validating EDTF support
1661
- Full support for Level 0 Date and Time Interval (no Date and Time support)
17-
- Level 1:
62+
- Level 1:
1863
- Letter-prefixed calendar year
1964
- Unspecified digit from the right
2065
- Partial support for extended interval
@@ -28,7 +73,7 @@ Update readthedocs config for current installation
2873

2974
### numpy impact
3075

31-
Performance differences seem to be negligible, but it does increase payload size. The virtualenv for installing version 0.2 was 14MB; when installing the newer version with numpy, the virtualenv is 46MB (the numpy folder in site packages is 31MB on its own).
76+
Performance differences seem to be negligible, but it does increase payload size. The virtualenv for installing version 0.2 was 14MB; when installing the newer version with numpy, the virtualenv is 46MB (the numpy folder in site packages is 31MB on its own).
3277

3378
## 0.2
3479

CITATION.cff

Lines changed: 3 additions & 3 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.3'
29-
date-released: 2024-11-18
28+
version: '0.5'
29+
date-released: 2025-06-25
3030
repository-code: https://github.com/dh-tech/undate-python
31-
license: Apache 2
31+
license: Apache-2.0

CONTRIBUTORS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ We use [All Contributors](https://allcontributors.org/) because we recognize tha
1919
<td align="center" valign="top" width="14.28%"><a href="https://github.com/robcast"><img src="https://avatars.githubusercontent.com/u/1488847?v=4?s=100" width="100px;" alt="Robert Casties"/><br /><sub><b>Robert Casties</b></sub></a><br /><a href="#data-robcast" title="Data">🔣</a> <a href="#ideas-robcast" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/dh-tech/undate-python/pulls?q=is%3Apr+reviewed-by%3Arobcast" title="Reviewed Pull Requests">👀</a></td>
2020
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jdamerow"><img src="https://avatars.githubusercontent.com/u/8881141?v=4?s=100" width="100px;" alt="Julia Damerow"/><br /><sub><b>Julia Damerow</b></sub></a><br /><a href="https://github.com/dh-tech/undate-python/commits?author=jdamerow" title="Code">💻</a> <a href="https://github.com/dh-tech/undate-python/pulls?q=is%3Apr+reviewed-by%3Ajdamerow" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/dh-tech/undate-python/commits?author=jdamerow" title="Tests">⚠️</a> <a href="#eventOrganizing-jdamerow" title="Event Organizing">📋</a> <a href="#ideas-jdamerow" title="Ideas, Planning, & Feedback">🤔</a></td>
2121
<td align="center" valign="top" width="14.28%"><a href="https://github.com/maltevogl"><img src="https://avatars.githubusercontent.com/u/20907912?v=4?s=100" width="100px;" alt="Malte Vogl"/><br /><sub><b>Malte Vogl</b></sub></a><br /><a href="https://github.com/dh-tech/undate-python/commits?author=maltevogl" title="Code">💻</a> <a href="https://github.com/dh-tech/undate-python/pulls?q=is%3Apr+reviewed-by%3Amaltevogl" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/dh-tech/undate-python/commits?author=maltevogl" title="Tests">⚠️</a> <a href="https://github.com/dh-tech/undate-python/commits?author=maltevogl" title="Documentation">📖</a></td>
22+
<td align="center" valign="top" width="14.28%"><a href="http://taylorarnold.org"><img src="https://avatars.githubusercontent.com/u/5752184?v=4?s=100" width="100px;" alt="Taylor Arnold"/><br /><sub><b>Taylor Arnold</b></sub></a><br /><a href="https://github.com/dh-tech/undate-python/pulls?q=is%3Apr+reviewed-by%3Ataylor-arnold" title="Reviewed Pull Requests">👀</a> <a href="#ideas-taylor-arnold" title="Ideas, Planning, & Feedback">🤔</a></td>
23+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rettinghaus"><img src="https://avatars.githubusercontent.com/u/7693447?v=4?s=100" width="100px;" alt="Klaus Rettinghaus"/><br /><sub><b>Klaus Rettinghaus</b></sub></a><br /><a href="#maintenance-rettinghaus" title="Maintenance">🚧</a></td>
2224
</tr>
2325
</tbody>
2426
<tfoot>

0 commit comments

Comments
 (0)