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

feat(py): caching support #29

Merged
merged 15 commits into from
Oct 22, 2024
Merged

feat(py): caching support #29

merged 15 commits into from
Oct 22, 2024

Conversation

cmdoret
Copy link
Member

@cmdoret cmdoret commented Oct 21, 2024

Exposes caching helpers to the python API.

This also improves error handling throughout the library by returning Result instead of panicking.

Context:

Many (not so) edge cases resulted in panics, because we use the anyhow crate to handle errors, and I did not know how to convert its Results to PyErr in the python bindings. Turns out there's an optional anyhow feature in the PyO3 crate to auto-cast Results.

Changes Summary:

  • Propagate results throughout fuzon all the way to the python library.
  • Expose caching helpers from rust to python.
  • Improve documentation in the python library.

@cmdoret cmdoret self-assigned this Oct 21, 2024
Copy link
Contributor

@gabyx gabyx left a comment

Choose a reason for hiding this comment

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

Well done!
Only a few nitpicks.
However the granular caching suggestion (why you didnt go that way) probably has a reason I am curious to find out!

fuzon/src/cache.rs Outdated Show resolved Hide resolved
fuzon/src/cache.rs Outdated Show resolved Hide resolved
fuzon/src/cache.rs Outdated Show resolved Hide resolved
fuzon/src/cache.rs Outdated Show resolved Hide resolved
fuzon/src/cache.rs Outdated Show resolved Hide resolved
fuzon/src/cache.rs Show resolved Hide resolved
fuzon/src/cache.rs Show resolved Hide resolved
fuzon/src/main.rs Show resolved Hide resolved
pyfuzon/src/lib.rs Outdated Show resolved Hide resolved
pyfuzon/src/lib.rs Outdated Show resolved Hide resolved
@cmdoret cmdoret merged commit 9d0fcbd into main Oct 22, 2024
11 checks passed
@cmdoret cmdoret deleted the feat/py-caching branch October 22, 2024 15:03
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