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

Add Pydantic for profile validation #199

Merged
merged 4 commits into from
Apr 22, 2024

Conversation

chrisoro
Copy link
Contributor

  • Implemented Pydantic for profile validation, ensuring that all user input conforms to expectations and eliminating the need for type checking or error handling after initial validation. Additionally, Pydantic provides improved output for users to assist them in defining valid profiles.
  • Refactored dataloader.py to accommodate validation within Pydantic Models.
  • Updated README documentation.
  • Overhauled profiles distributed with the installation. Outdated profiles have been replaced by an example profile demonstrating correct syntax and usage, with a focus on structure rather than specific content (or a particular character/build).
  • Renamed all Models in config/modely.py to include the suffix Model, clearly indicating that these are validated user inputs.
  • Restructured item/filter.py for improved clarity and reduced complexity. The code path is now easier to understand, with fewer side effects.
    • Introduced filter types to affixPool, starting with the initial type called count. count functions similarly to the count filter in the PoE trade website.
    • This refactor facilitates the addition of other possible filter types without breaking existing ones. The previous logic, which mixed and/or in one type, was not future-proof and had flaws.
  • Expanded unit test coverage for all new features and refactors.

@chrisoro chrisoro requested a review from aeon0 April 20, 2024 19:06
@chrisoro chrisoro mentioned this pull request Apr 20, 2024
Copy link
Contributor

@aeon0 aeon0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smooth, tested, works.

@aeon0 aeon0 merged commit 35e0828 into d4lfteam:main Apr 22, 2024
1 check passed
@chrisoro chrisoro deleted the add-pydantic-for-filters branch April 22, 2024 17:18
@chrisoro chrisoro mentioned this pull request Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants