Conversation
…` usage in sync and async contexts
…include `fspin_cheatsheet.md` in the manifest
…d` loader script
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 811ffdfc00
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| cheatsheet_path = os.path.join(current_dir, "fspin_cheatsheet.md") | ||
|
|
||
| # Fallback for development environment if not found in package dir | ||
| if not os.path.exists(cheatsheet_path): | ||
| cheatsheet_path = os.path.join(current_dir, "..", "fspin_cheatsheet.md") |
There was a problem hiding this comment.
Package cheatsheet so python -m fspin can find it
This lookup assumes fspin_cheatsheet.md is bundled alongside the installed package, but setup.py doesn’t set include_package_data/package_data, so wheels built via pip won’t contain that file even with MANIFEST.in. In that common install path, python -m fspin will always fall through to “Cheatsheet not found,” so the advertised feature won’t work. Consider shipping the file as package data (or moving it into fspin/ and loading via importlib.resources).
Useful? React with 👍 / 👎.
This pull request introduces improved support and documentation for using lambda functions as stop conditions in the
fspinlibrary. It updates the cheatsheet, main documentation, and examples to recommend and demonstrate the use of lambdas for concise, readable loop control. Additionally, it adds a new example, enhances the package's usability, and improves performance reporting.Lambda Condition Support and Documentation:
fspin_cheatsheet.md,readme.md, and in-code docstrings to recommend using lambda functions for thecondition_fnparameter, with new and revised examples for both sync and async workflows. [1] [2] [3] [4] [5] [6] [7] [8]example/lambda_condition.pyand updatedexample/README.mdto showcase lambda-based loop conditions. [1] [2]Cheatsheet and CLI Improvements:
fspin_cheatsheet.mdto the package manifest and created a__main__.pyentry point to print the cheatsheet when runningpython -m fspin. [1] [2]spinentry point now dynamically loads the cheatsheet into its docstring if available, improving inline help and discoverability.Functionality and Reporting Enhancements:
RateControl.get_report()method to correctly count the initial iteration even when only a warmup iteration occurs.These changes make it easier for users to implement concise loop exit conditions and improve the clarity and accessibility of the documentation.