Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release 0.8.1 #50

Merged
merged 5 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 27 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,44 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

<!-- insertion marker -->
## [0.8.0](https://github.com/georgedouzas/sports-betting/releases/tag/0.8.0) - 2023-09-30
## [0.8.1](https://github.com/georgedouzas/sports-betting/releases/tag/0.8.1) - 2024-03-08

<small>[Compare with 0.8.0](https://github.com/georgedouzas/sports-betting/compare/0.8.0...0.8.1)</small>

### Bug Fixes

- Decode response and convert data types ([a265162](https://github.com/georgedouzas/sports-betting/commit/a2651620a44993000bcfa1f5d91ae2b0ff219461) by georgedouzas).

### Docs

- Fix README typo ([ad67830](https://github.com/georgedouzas/sports-betting/commit/ad6783081d6ee2ab646a255aa82bf875db3efc1d) by georgedouzas).

### Chore

- Sort imports ([eebf12f](https://github.com/georgedouzas/sports-betting/commit/eebf12f8911539aba36dc5f16a2763a087bf8fbc) by georgedouzas).
- Silence ruff usage and configuration warnings ([b4a9815](https://github.com/georgedouzas/sports-betting/commit/b4a9815969274c35b48420a3e6647267be2c9617) by georgedouzas).
- Predictions 13/10/2023 ([77a3a72](https://github.com/georgedouzas/sports-betting/commit/77a3a723b464cd45418936076d27fb14e2bfc0b1) by georgedouzas).
- Predictions 03/10/2023 ([6af121b](https://github.com/georgedouzas/sports-betting/commit/6af121be9aef9b4c51bfd7866ddfb9b38e6b5576) by georgedouzas).
- Skip session if fixtures data are empty ([00d3eeb](https://github.com/georgedouzas/sports-betting/commit/00d3eeb0eb491f94f1036096d97f7fab6e303b98) by georgedouzas).

## [0.8.0](https://github.com/georgedouzas/sports-betting/releases/tag/0.8.0) - 2023-09-29

<small>[Compare with 0.7.0](https://github.com/georgedouzas/sports-betting/compare/0.7.0...0.8.0)</small>

### Features

- Use footballdata only for data source ([2b41ad0](https://github.com/georgedouzas/sports-betting/commit/2b41ad05c336ec769882b1ff39179c42d686ee65) by georgedouzas).
- Use footballdata only for data source ([582d547](https://github.com/georgedouzas/sports-betting/commit/582d54782a299312badc19641c15ba632a7934ea) by georgedouzas).

### Style

- Split line ([893cd70](https://github.com/georgedouzas/sports-betting/commit/893cd70c17c9f57e149c27adb83c0629f80bdda5) by georgedouzas).
- Split line ([6b93930](https://github.com/georgedouzas/sports-betting/commit/6b9393045ad00930bac816fa46266e8763ec4099) by georgedouzas).

### Chore

- Ignore warnings ([36ff455](https://github.com/georgedouzas/sports-betting/commit/36ff455dcf6dce6583a991218b79b88ef4db4e91) by georgedouzas).
- Update Pandas dependency ([cf179d8](https://github.com/georgedouzas/sports-betting/commit/cf179d8c48c4b8c7942f25c700c56a3a8b05630c) by georgedouzas).
- Update copier template ([e5b5a0a](https://github.com/georgedouzas/sports-betting/commit/e5b5a0a606ecfefdc8a7aa3e3779032dc3589914) by georgedouzas).
- Release 0.8.0 ([b611337](https://github.com/georgedouzas/sports-betting/commit/b611337962073f27cb2c403586657e05c3293365) by georgedouzas).
- Ignore warnings ([6b78adc](https://github.com/georgedouzas/sports-betting/commit/6b78adc69618eb96f3a2cefa890a8beafe6cb181) by georgedouzas).
- Update Pandas dependency ([51a9a13](https://github.com/georgedouzas/sports-betting/commit/51a9a139a6e7ccfa09a56039bbd8f683dbef9dff) by georgedouzas).
- Update copier template ([a724b9e](https://github.com/georgedouzas/sports-betting/commit/a724b9e6bfeca4a5f04595e2c8670448c6e0d866) by georgedouzas).

## [0.7.0](https://github.com/georgedouzas/sports-betting/releases/tag/0.7.0) - 2023-09-23

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ The dictionary `CONFIG` has the following structure:
- The `'data'` key has a nested dictionary as a value with a mandatory key '`dataloader`' and the optional keys `'param_grid'`,
`'drop_na_thres'` and `'drop_na'`. You can refer to the [API](api/datasets) for more details about their values.
- The `'betting'` key has a nested dictionary as a value with a mandatory key '`bettor`' and the optional keys `'tscv'`, and
`'inti_cash'`. You can refer to the [API](api/datasets) for more details about their values.
`'init_cash'`. You can refer to the [API](api/datasets) for more details about their values.

#### Dataloader

Expand All @@ -293,7 +293,7 @@ sportsbet dataloader odds-types -c config.py
Extract training data and save them as CSV files:

```bash
sportsbet dataloader training -c dataloader_config.py -d /path/to/directory
sportsbet dataloader training -c config.py -d /path/to/directory
```

Extract fixtures data and save them as CSV files:
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def checks(session: nox.Session, file: str) -> None:
check_cli(session, ['all', 'quality', 'dependencies', 'types'])
session.run('pdm', 'install', '-dG', 'checks', '--no-default', external=True)
if session.posargs[0] in ['quality', 'all']:
session.run('ruff', file)
session.run('ruff', 'check', file)
if session.posargs[0] in ['types', 'all']:
session.run('mypy', file)
if session.posargs[0] in ['dependencies', 'all']:
Expand Down
20 changes: 11 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,27 +120,29 @@ extend-exclude = "(tests/fixtures|docs/generated)"
skip-string-normalization = true

[tool.ruff]
select = ["C", "E", "F", "W", "B", "I", "D", "N", "UP", "YTT", "ANN", "S",
fix = true
extend-exclude = ["docs/generated"]
force-exclude = true
line-length = 120
target-version = "py39"

[tool.ruff.lint]
fixable = ["C", "E", "F", "W", "B", "I", "D", "N", "UP", "YTT", "ANN", "S",
"BLE", "A", "COM", "C4", "DTZ", "T10", "EM", "EXE", "ISC", "ICN", "G",
"INP", "PIE", "T20", "PT", "Q", "RET501", "RET502", "RET503", "SIM",
"PTH", "PD", "PGH", "PL", "TRY", "RUF", "PLE", "PLR", "PLW", "TRY", "RUF"]
ignore = ["D202", "N806", "N803", "S101", "INP001", "Q000", "TRY002", "PLR0913", "EXE001", "EXE002", "E741"]
fix = true
fixable = ["C", "E", "F", "W", "B", "I", "D", "N", "UP", "YTT", "ANN", "S",
select = ["C", "E", "F", "W", "B", "I", "D", "N", "UP", "YTT", "ANN", "S",
"BLE", "A", "COM", "C4", "DTZ", "T10", "EM", "EXE", "ISC", "ICN", "G",
"INP", "PIE", "T20", "PT", "Q", "RET501", "RET502", "RET503", "SIM",
"PTH", "PD", "PGH", "PL", "TRY", "RUF", "PLE", "PLR", "PLW", "TRY", "RUF"]
extend-exclude = ["docs/generated"]
force-exclude = true
line-length = 120
target-version = "py39"

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"docs/examples/*" = ["ANN", "D", "B018"]
"docs/generated/*" = ["ANN", "D"]
"test_*" = ["ANN"]

[tool.ruff.pydocstyle]
[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.mypy]
Expand Down
7 changes: 6 additions & 1 deletion src/sportsbet/datasets/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,12 @@ def _convert_data_types(self: Self, data: pd.DataFrame) -> pd.DataFrame:
},
)
if converted_cols:
data_converted_cols = data[converted_cols].fillna(-1 if data_type is np.int64 else np.nan)
data_converted_cols = data[converted_cols]
if data_type is float or data_type is np.int64:
data_converted_cols = data_converted_cols.replace('-', np.nan)
data_converted_cols = data_converted_cols.infer_objects().fillna(
-1 if data_type is np.int64 else np.nan,
)
data[converted_cols] = (
data_converted_cols.to_numpy().astype(data_type)
if data_type is not np.datetime64
Expand Down
2 changes: 1 addition & 1 deletion src/sportsbet/datasets/_soccer/_fd.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

from __future__ import annotations

import warnings
from datetime import datetime
from functools import lru_cache
from typing import ClassVar
import warnings

import numpy as np
import pandas as pd
Expand Down
2 changes: 1 addition & 1 deletion src/sportsbet/datasets/_soccer/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
async def _read_url_content_async(client: aiohttp.ClientSession, url: str) -> str:
"""Read asynchronously the URL content."""
async with client.get(url) as response:
with io.StringIO(await response.text()) as text_io:
with io.StringIO(await response.text(encoding='ISO-8859-1')) as text_io:
return text_io.getvalue()


Expand Down
Loading