Skip to content

Commit

Permalink
Remove dependency to polars (#991)
Browse files Browse the repository at this point in the history
It is just too big (28MB) to have only to validate one code example.

Instead we leave the line that uses polars as a comment.
  • Loading branch information
llucax authored Jun 28, 2024
2 parents 249d4fe + 4e7aedc commit cd5a2dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ dev-flake8 = [
"pydoclint == 0.4.1",
"pydocstyle == 6.3.0",
]
dev-examples = ["polars == 0.20.31"]
dev-formatting = ["black == 24.4.2", "isort == 5.13.2"]
dev-mkdocs = [
"black == 24.4.2",
Expand Down Expand Up @@ -83,8 +82,6 @@ dev-pytest = [
"pytest-asyncio == 0.23.7",
"time-machine == 2.12.0",
"async-solipsism == 0.6",
# For checking docstring code examples
"frequenz-sdk[dev-examples]",
"hypothesis == 6.103.1",
]
dev = [
Expand Down
7 changes: 4 additions & 3 deletions src/frequenz/sdk/timeseries/_moving_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ async def run() -> None:
Example: Create a polars data frame from a `MovingWindow`
```python
import polars as pl
from datetime import datetime, timedelta, timezone
async def send_mock_data(sender: Sender[Sample]) -> None:
Expand All @@ -118,10 +117,12 @@ async def run() -> None:
# wait for one full day until the buffer is filled
await asyncio.sleep(60*60*24)
# create a polars series with one full day of data
time_start = datetime(2023, 1, 1, tzinfo=timezone.utc)
time_end = datetime(2023, 1, 2, tzinfo=timezone.utc)
series = pl.Series("Jan_1", window[time_start:time_end])
# You can now create a polars series with one full day of data by
# passing the window slice, like:
# series = pl.Series("Jan_1", window[time_start:time_end])
asyncio.run(run())
```
Expand Down

0 comments on commit cd5a2dd

Please sign in to comment.