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

chore: cleanup InputObservation class #27

Open
rmm-ch opened this issue Jan 30, 2025 · 1 comment
Open

chore: cleanup InputObservation class #27

rmm-ch opened this issue Jan 30, 2025 · 1 comment

Comments

@rmm-ch
Copy link
Collaborator

rmm-ch commented Jan 30, 2025

As part of the data persistence issue (#23), we need to adjust when the hash generation happens. Basically we want the hash as an index, but currently we are generating too late (because the observation construction requires more user input).

Taking this opportunity to clean up the class further:

  1. the hash should be generated externally and passed at construction time (required for setting identifiers to the dynamic UI elements now we have multi-file handling)
  2. it is not clear why we track date, time, date_option and time_option.
  3. not clear why we have both class method and static method for constructing instances (from_data; from_input)
  4. verify that the methods for equality, str, repr, cover all the attributes
  5. remove the hash function, it is not used anywhere and confusing vs. the image hash
  6. type hints
rmm-ch added a commit that referenced this issue Jan 30, 2025
see issue #27.
- added image_md5 as input (1)
- removed duplicate methods (3)
- removed unused hash func (5)
- checked by inspection the attribute coverage (4) - still to test
rmm-ch added a commit that referenced this issue Jan 30, 2025
see issue #27.
- added typehints (6) for all arguments, except (date, time) which
  always seem to be none, and need investigation to resolve (see 2)
- updated the attribute uploaded_filename to uploaded_file, since it
  is *not* a filename, but a BytesIO-like object, `UploadedFile`.
@rmm-ch
Copy link
Collaborator Author

rmm-ch commented Jan 31, 2025

1ba3d0b (and intermediate step beca8fa, 3e2cb2f) solve this now

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