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

Refactor to only support fiddy.function.Function-type functions, and store history #13

Open
dilpath opened this issue Feb 15, 2022 · 0 comments

Comments

@dilpath
Copy link
Member

dilpath commented Feb 15, 2022

Store each function call as a dataclass object, and the history would be a list of such objects.

Only support fiddy.function.Function so history can be automatically generated inside __call__.

Pros:

  • can be used as a cache
    • either remove fiddy.function.CachedFunction, or disable history if CachedFunction is used
      • caching user option as a fiddy.function.Function attribute (e.g. boolean save_history and history_as_cache)
  • can be easily converted to a human-readable format e.g. pandas DataFrame
    • and store/load history (cache) as a DataFrame
  • easy to query results and reuse, if a DataFrame

Cons:

  • speed
    • need to limit slow pandas operations such as append
    • may be slower than the current disk or ram caching (can support all caching options)
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

No branches or pull requests

1 participant