Skip to content

Commit

Permalink
Add rank property to snapshot timeline entry (#34)
Browse files Browse the repository at this point in the history
* Add rank property to snapshot timeline entry

* Bump project version

* Update changelog
  • Loading branch information
Jonxslays authored Nov 7, 2023
1 parent 7e14f58 commit bd047d3
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# v0.8.1 (Nov 2023)

## Additions

- Add `rank` property to `SnapshotTimelineEntry`.

---

# v0.8.0 (Oct 2023)

## Additions
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "wom.py"
version = "0.8.0"
version = "0.8.1"
description = "An asynchronous wrapper for the Wise Old Man API."
authors = ["Jonxslays"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion wom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from typing import Final

__packagename__: Final[str] = "wom.py"
__version__: Final[str] = "0.8.0"
__version__: Final[str] = "0.8.1"
__author__: Final[str] = "Jonxslays"
__copyright__: Final[str] = "2023-present Jonxslays"
__description__: Final[str] = "An asynchronous wrapper for the Wise Old Man API."
Expand Down
7 changes: 6 additions & 1 deletion wom/models/players/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,12 @@ class SnapshotTimelineEntry(BaseModel):
"""An entry representing a point in time of a players gains."""

value: int
"""The total xp gained since the last timeline entry."""
"""The players value for a specific metric, at a specific point in
time."""

rank: int
"""The players rank for a specific metric, at a specific point in
time."""

date: datetime
"""The date this timeline entry was recorded."""
2 changes: 1 addition & 1 deletion wom/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ def deserialize_snapshot_timeline_entry(self, data: DictT) -> models.SnapshotTim
"""
entry = models.SnapshotTimelineEntry()
entry.date = self._dt_from_iso(data["date"])
entry.value = data["value"]
self._set_attrs(entry, data, "value", "rank")
return entry

@serializer_guard
Expand Down

0 comments on commit bd047d3

Please sign in to comment.