Skip to content

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

Open
@dilpath

Description

@dilpath

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions