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

aRez 0.2.0 changes #3

Closed
DevilXD opened this issue Mar 16, 2021 · 2 comments
Closed

aRez 0.2.0 changes #3

DevilXD opened this issue Mar 16, 2021 · 2 comments
Labels
Informational Important information

Comments

@DevilXD
Copy link
Owner

DevilXD commented Mar 16, 2021

I'm making this issue to better communicate what's coming with upcoming / new version 0.2.0, specifically because there is quite a bit of changes that one could consider breaking. Nonetheless, I made sure that the update would require minimal changes to the code, so hopefully it shouldn't be too problematic.

Non-breaking changes / additions:
• Various bug-fixes, tweaks and optimizations.
• Server status now includes merged information from both, the StatusPage, and the official API.
• Added a new register_status_callback method, that lets you setup a loop that will periodically check the server status, and call the provided callback function in case the status changes. Perfect for constant server status monitoring and almost instant notifications.
• Support for the bounty store endpoint.
• Support for aware datetime objects in get_matches_for_queue.
• New group_by utility, that allows you to group together items from a list, into a dictionary, where each item shares a common key value specified.
MatchPlayer and LivePlayer objects now have a rank attribute, populated for ranked matches only.
LivePlayer player objects now have their platform included / set correctly.
MatchItem, LoadoutCard and Device now include a new description method, that allows you to obtain the card / item description, with the correct leveled information already formatted in.
• The cache now includes champion skins list (at least those that the API returns, the list appears to be incomplete).
• The skin attribute now includes a new Skin object from the cache, if available.
• Most methods will now raise a TypeError or ValueError (instead of AssertionError), in case of incorrect arguments being provided to them - this allows for more verbose error messages.

Breaking changes:
• Following the new description method addition to MatchItem, LoadoutCard and Device objects, the old description attribute has been renamed to raw_description.
• Removed all get_(champion|item|talent|card|device) methods from the cache (so api as well), as well as the cache entry. All of those have now been unified into a single get method, available on the Lookup class itself. To convert, simply change every instance of api.get_champion into a cache entry fetch, followed by entry.champions.get - repeat for all other get methods and champions, items, talents, cards or devices attributes respectively. To lookup the new cached skins by their name, use entry.skins.get.
• Following the get_* methods removal, the new get method will not accept the fuzzy kwarg anymore. Instead, the get method will perform a semi-fuzzy search by default, by not being case-sensitive anymore. To provide even more freedom with fuzzy item lookups, there have been two new methods added to the Lookup class, called get_fuzzy_matches and get_fuzzy, with this latter one most likely finding the most usage - please see the documentation for more information.

Breaking changes code overview:
• Replace device.description into device.raw_description, unless you were doing the description formatting yourself, then feel free to utilize the new description method for the same purpose.
• Replace api.get_champion(name) with entry = api.get_entry() (or entry = await api.get_champion_info() for a more up-to-date result), followed by entry.champions.get(name).
• Replace api.get_champion(name, fuzzy=True) according to the above, but use entry.champions.get_fuzzy(name) at the end.

@DevilXD DevilXD pinned this issue Mar 16, 2021
@DevilXD DevilXD added the Informational Important information label Mar 16, 2021
@DevilXD DevilXD changed the title aRez 0.1.8 changes aRez 0.2.0 changes Mar 17, 2021
@DevilXD
Copy link
Owner Author

DevilXD commented Mar 17, 2021

This is actually going to be a 0.2.0 release, given how big the changes are. I think this will be more fitting version than 0.1.8 at this point.

@DevilXD
Copy link
Owner Author

DevilXD commented Apr 18, 2021

aRez 0.2.0 has been released. You can upgrade to it via:

pip install -U arez

@DevilXD DevilXD closed this as completed Apr 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Informational Important information
Projects
None yet
Development

No branches or pull requests

1 participant