Skip to content

Commit

Permalink
Update API reference, tag new version v2.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dostuffthatmatters committed Sep 17, 2024
1 parent db42869 commit cccf87c
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
51 changes: 51 additions & 0 deletions docs/pages/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,57 @@ ISO 8601 supports time zones as `<time>Z`, `<time>±hh:mm`, `<time>±hhmm` and
This function supports parsing alll ISO 8601 time formats.


##### `datetime_span_intersection`

```python
def datetime_span_intersection(
dt_span_1: tuple[datetime.datetime,
datetime.datetime], dt_span_2: tuple[datetime.datetime,
datetime.datetime]
) -> Optional[tuple[datetime.datetime, datetime.datetime]]
```

Check if two datetime spans overlap.

**Arguments**:

- `dt_span_1` - The first datetime span (start, end).
- `dt_span_2` - The second datetime span (start, end).


**Returns**:

The intersection of the two datetime spans or None if they do
not overlap. Returns None if the intersection is a single point.


##### `date_span_intersection`

```python
def date_span_intersection(
d_span_1: tuple[datetime.date,
datetime.date], d_span_2: tuple[datetime.date,
datetime.date]
) -> Optional[tuple[datetime.date, datetime.date]]
```

Check if two date spans overlap. This functions behaves
differently from `datetime_span_intersection` in that it
returns a single point as an intersection if the two date
spans overlap at a single date.

**Arguments**:

- `d_span_1` - The first date span (start, end).
- `d_span_2` - The second date span (start, end).


**Returns**:

The intersection of the two date spans or None if they do
not overlap.


## `tum_esm_utils.validators`

Implements validator utils for use with pydantic models.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "tum_esm_utils"
version = "2.3.1"
version = "2.3.2"
description = "Python utilities by the Professorship of Environmental Sensing and Modeling at the Technical University of Munich"
authors = [{ name = "Moritz Makowski", email = "[email protected]" }]
dependencies = [
Expand Down

0 comments on commit cccf87c

Please sign in to comment.