## time_range.TimeRange


An inclusive window of calendar days, `start` through `end`.


Usage

``` python
time_range.TimeRange(
    start,
    end,
)
```


The one object a pipeline hands to both the search and the composite: `~s1bursts.query.SearchQuery` selects the acquisitions that fall on any of its days, and `ResolutionWeighter.compose_*()` names and tags the product with it. Because both take the same window, the product's dates describe exactly what was searched.

Days have no time of day, so there is nothing to be exclusive about: a window `2023-07-18` through `2023-10-15` covers every acquisition on October 15. Filters that compare instants get the same span from [half_open()](time_range.TimeRange.md#s1bursts.time_range.TimeRange.half_open).


## Parameters


`start: DateLike`  
First and last day of the window. An instant names the UTC calendar day it falls on, the resolution every date tag is written at.

`end: DateLike`  
First and last day of the window. An instant names the UTC calendar day it falls on, the resolution every date tag is written at.


## Raises


`ValueError`  
If `end` is before `start`.


## Methods

| Name | Description |
|----|----|
| [__contains__()](#__contains__) | Whether `value` falls on one of the window's days. |
| [__post_init__()](#__post_init__) | Check the order of the days. |
| [__str__()](#__str__) | Return the window as `start..end`. |
| [half_open()](#half_open) | Return the window as `[start, stop)` naive UTC instants. |

------------------------------------------------------------------------


#### \_\_contains\_\_()


Whether `value` falls on one of the window's days.


Usage

``` python
__contains__(value)
```


------------------------------------------------------------------------


#### \_\_post_init\_\_()


Check the order of the days.


Usage

``` python
__post_init__()
```


Separate from `__init__` because a validation library that builds a dataclass from its fields, pydantic for one, skips `__init__` but still calls this.


------------------------------------------------------------------------


#### \_\_str\_\_()


Return the window as `start..end`.


Usage

``` python
__str__()
```


------------------------------------------------------------------------


#### half_open()


Return the window as `[start, stop)` naive UTC instants.


Usage

``` python
half_open()
```


`stop` is the midnight after `end`, so a filter that keeps `start <= t < stop` keeps every instant of every day of the window.
