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

EEP: Patch / Diff for all EDSL objects #492

Open
johnjosephhorton opened this issue May 13, 2024 · 0 comments
Open

EEP: Patch / Diff for all EDSL objects #492

johnjosephhorton opened this issue May 13, 2024 · 0 comments

Comments

@johnjosephhorton
Copy link
Contributor

We should be able to efficiently store changes in edsl objects, like so:

from edsl import QuestionFreeText 
q1 = QuestionFreeText.example()
q2 = QuestionFreeText.example()
q2.question_text = "Here is some new text"
diff_1 = q2 - q1
assert q2 == diff_1 + q1 
diff_2 = q1 - q2 
assert q1 == diff2 + q2

diffs themselves should be coop-able. In terms of implementation, it probably works by doing comparisons of the .dict() methods of the objects. It likely recursively checks if a sub-object has a diff/dict method. As much as possible, it tries to only log modifications of strings / numbers rather than whole-scale replacement of objects. A diff object might have nested diff objects.

Related - sematically the same

We need to decide what it means for two edsl obejcts to be identical.

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