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: add new variant of the state object with a history #70

Draft
wants to merge 71 commits into
base: main
Choose a base branch
from

Conversation

hollandjg
Copy link
Member

@hollandjg hollandjg commented May 21, 2024

Add a new variant of the state object with a history.

ToDos

Implementation

  • Make a new object which handles the history by storing the initial object and all the Delta updates added to it.
  • Make helper functions – both as stand-alones and methods on the history – which:
    • Filter a history until the last time a particular tag was found, e.g. meta="raw" or meta="clean"
    • Filter just the entries in a history which updated a particular field
    • Show all the version of a particular field in the history
    • Reconstruct a new object from a history
  • Make delta_to_state_transformed – a new version of the wrapper delta_to_state which allows transforming the input State before passing it to the inner function, but adds the Delta to the original input State.
    • Write doctests which make sense. What's the simplest possible use for that kind of object?
    • Decide whether this should be a separate function or be merged into the original delta_to_state.
  • Add history methods for aggregating things like "experiment_data" over the whole of a history, overriding the "replace" and just putting them all together. This needs to return a State too.
  • Make a wrapper @tag_delta which adds a tag like meta="filtered" or component="theorist" to a Delta before passing it back to the caller.

Documentation

  • Add an example of using the new state for a cycle involving replacing experiment data with filtered experiment data.

Cleanups

  • Decide whether to keep the History version of the StandardState – it's a bit of a mess, as it keeps the history in two places. Probably delete this?

hollandjg added 30 commits May 20, 2024 15:45
…standard fields and always replaces but keeps a history
hollandjg added 26 commits May 23, 2024 10:56
… whose existence is required but value is unimportant
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure we should keep this file and this object – it's a bit weird.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is going to be the standard state we'd use with the history – it's the one which makes the most sense, I think. Although what do we do if a function needs multiple models? There's only one slot for a model here, so I'm not sure how we deal with that.

Copy link
Member Author

Choose a reason for hiding this comment

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

This file is the main change. It adds the History and the State object which uses it: DeltaHistory. There's a few examples and some testing in here.

Copy link
Member Author

Choose a reason for hiding this comment

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

These are changes to the basic state adding so that we don't have to emit a warning if there's a field missing in the Delta, which may often be the case for metadata fields.

Copy link
Member Author

Choose a reason for hiding this comment

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

Starting notebook on examples.

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.

1 participant