You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+17-2Lines changed: 17 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,21 @@
1
1
# Change Log
2
2
3
+
## 0.5
4
+
5
+
- New `UnDelta` and `UnInt` classes for uncertain durations
6
+
-`Undate.duration` now returns either a `Timedelta` or an `UnDelta` if the duration is ambiguous
7
+
- New properties `possible_years` and `representative_years` on `Undate` class, used for calculating durations for uncertain years and months
8
+
- New `weekday` method on class `undate.date.Date`
9
+
- Calendar converter improvements:
10
+
- Calendar converter classes can optional provide minimum and maximum years for uncertain dates
11
+
- New calendar methods `days_in_year` and `representative_years`
12
+
- Hebrew date parser now allows for week days, along with additional month variants
13
+
- Preliminary Seleucide calendar converter class, based on Hebrew calendar with a year offset
14
+
- New method `as_calendar` on `Undate` class, to set calendar without doing any conversion
15
+
- Readme examples have been improved and extended
16
+
- New example notebook testing Hebrew, Islamic, and Seleucid date parsing and conversion with Princeton Geniza Project data
17
+
- 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
18
+
3
19
## 0.4
4
20
5
21
- Undate is now Calendar aware / Calendar explicit; default is Gregorian
@@ -20,7 +36,6 @@
20
36
- Reorganized examples folder to avoid unnecessary nesting
21
37
- ISMI data has been updated from older JSON data to examples in RDF (turtle)
22
38
23
-
24
39
## 0.3.1
25
40
26
41
Update readthedocs config for current installation
@@ -49,7 +64,7 @@ Update readthedocs config for current installation
49
64
50
65
### numpy impact
51
66
52
-
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).
67
+
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).
Often humanities and cultural data include imprecise or uncertain temporal information. We want to store that information but also work with it in a structured way, not just treat it as text for display. Different projects may need to work with or convert between different date formats or even different calendars.
48
+
Often humanities and cultural data include imprecise or uncertain
49
+
temporal information. We want to store that information but also work
50
+
with it in a structured way, not just treat it as text for display.
51
+
Different projects may need to work with or convert between different
52
+
date formats or even different calendars.
31
53
32
-
An `undate.Undate` is analogous to python’s builtin `datetime.date` object, but with support for varying degrees of precision and unknown information. You can initialize an undate with either strings or numbers for whichever parts of the date are known or partially known. An `Undate` can take an optional label.
54
+
An `undate.Undate` is analogous to python’s builtin `datetime.date`
55
+
object, but with support for varying degrees of precision and unknown
56
+
information. You can initialize an `Undate` with either strings or
57
+
numbers for whichever parts of the date are known or partially known.
You can convert an `Undate` to string using a date formatter (current default is ISO8601):
75
+
49
76
```python
50
77
>>> [str(d) for d in [november7, november, year2k, november7_some_year]]
51
78
['2000-11-07', '2000-11', '2000', '--11-07']
52
79
```
53
80
54
81
If enough information is known, an `Undate` object can report on its duration:
82
+
55
83
```python
56
84
>>> december = Undate(2000, 12)
57
85
>>> feb_leapyear = Undate(2024, 2)
@@ -68,7 +96,9 @@ If enough information is known, an `Undate` object can report on its duration:
68
96
2024-02- duration in days: 29
69
97
```
70
98
71
-
If enough of the date is known and the precision supports it, you can check if one date falls within another date:
99
+
If enough of the date is known and the precision supports it, you can
100
+
check if one date falls within another date:
101
+
72
102
```python
73
103
>>> november7 = Undate(2000, 11, 7)
74
104
>>> november2000 = Undate(2000, 11)
@@ -86,7 +116,10 @@ False
86
116
False
87
117
```
88
118
89
-
For dates that are imprecise or partially known, `undate` calculates earliest and latest possible dates for comparison purposes so you can sort dates and compare with equals, greater than, and less than. You can also compare with python `datetime.date` objects.
119
+
For dates that are imprecise or partially known, `undate` calculates
120
+
earliest and latest possible dates for comparison purposes so you can
121
+
sort dates and compare with equals, greater than, and less than. You
122
+
can also compare with python `datetime.date` objects.
90
123
91
124
```python
92
125
>>> november7_2020 = Undate(2020, 11, 7)
@@ -104,7 +137,8 @@ False
104
137
False
105
138
```
106
139
107
-
When dates cannot be compared due to ambiguity or precision, comparison methods raise a `NotImplementedError`.
140
+
When dates cannot be compared due to ambiguity or precision, comparison
NotImplementedError: Can't compare when one date falls within the other
119
153
```
120
154
121
-
An `UndateInterval`is a date range between two `Undate` objects. Intervals can be open-ended, allow for optional labels, and can calculate duration if enough information is known
155
+
An `UndateInterval`is a date range between two `Undate` objects.
156
+
Intervals can be open-ended, allow for optional labels, and can
157
+
calculate duration if enough information is known. `UndateIntervals`
158
+
are inclusive (i.e., a closed interval), and include both the earliest
>>> UndateInterval(latest=Undate(2000)) # before 2000
133
172
<UndateInterval ../2000>
134
173
>>> UndateInterval(Undate(1900)) # after 1900
@@ -139,8 +178,10 @@ An `UndateInterval` is a date range between two `Undate` objects. Intervals can
139
178
31
140
179
```
141
180
142
-
You can initialize `Undate`or`UndateInterval` objects by parsing a date string with a specific converter, and you can also output an `Undate`objectin those formats.
143
-
Currently available converters are "ISO8601"and"EDTF"and supported calendars.
181
+
You can initialize `Undate`or`UndateInterval` objects by parsing a
182
+
date string with a specific converter, and you can also output an
183
+
`Undate`objectin those formats. Currently available converters
184
+
are "ISO8601"and"EDTF"and supported calendars.
144
185
145
186
```python
146
187
>>>from undate import Undate
@@ -158,9 +199,17 @@ Currently available converters are "ISO8601" and "EDTF" and supported calendars.
158
199
159
200
### Calendars
160
201
161
-
All `Undate` objects are calendar aware, and date converters include support for parsing and working with dates from other calendars. The Gregorian calendar is used by default; currently `undate` supports the Islamic Hijri calendar and the Hebrew Anno Mundi calendar based on calendar conversion logic implemented in the [convertdate](https://convertdate.readthedocs.io/en/latest/) package.
202
+
All `Undate` objects are calendar aware, and date converters include
203
+
support for parsing and working with dates from other calendars. The
204
+
Gregorian calendar is used by default; currently `undate` supports the
205
+
Islamic Hijri calendar and the Hebrew Anno Mundi calendar based on
Dates are stored with the year, month, day and appropriate precision for the original calendar; internally, earliest and latest dates are calculated in Gregorian / Proleptic Gregorian calendar for standardized comparison across dates from different calendars.
209
+
Dates are stored with the year, month, day and appropriate precision for
210
+
the original calendar; internally, earliest and latest dates are
211
+
calculated in Gregorian / Proleptic Gregorian calendar for standardized
212
+
comparison across dates from different calendars.
164
213
165
214
```python
166
215
>>>from undate import Undate
@@ -181,9 +230,11 @@ Dates are stored with the year, month, day and appropriate precision for the ori
For more examples, refer to the code notebooks included in the [examples](https://github.com/dh-tech/undate-python/tree/main/examples/) in this repository.
235
+
For more examples, refer to the code notebooks included in the[examples]
236
+
(https://github.com/dh-tech/undate-python/tree/main/examples/) in this
0 commit comments