Skip to content

Enhance JSON Comparison and Logging in BokehSnapshotExtension.py #59

@UTSAVS26

Description

@UTSAVS26

The BokehSnapshotExtension.py file in pyopenms_viz/testing/ is responsible for handling Bokeh snapshot comparisons by extracting and validating JSON data from generated HTML files. However, there are some areas that could be improved to enhance accuracy, maintainability, and debugging:

Reasons for Improvement:

1️⃣ Inefficient JSON Comparison:

  • The current method (compare_json) relies on direct key-value checks but does not effectively handle unordered lists.
  • This can lead to false mismatches in cases where the structure is the same, but element order differs.

2️⃣ Uncontrolled Debugging Output:

  • The function currently uses print statements for debugging.
  • Switching to Python’s logging module would allow better control over verbosity levels.

3️⃣ Lack of Unit Tests:

  • There are no dedicated tests to verify Bokeh snapshot extraction and comparison.
  • Adding tests using pytest and syrupy will improve reliability and prevent regressions.

4️⃣ Potential for Enhanced Serialization:

  • Right now, only HTML is stored, but supporting raw Bokeh JSON snapshots could improve performance and debugging.

These improvements will make Bokeh snapshot testing more accurate, maintainable, and easier to debug. I would like to work on these changes to enhance the robustness of snapshot testing in the project.

Metadata

Metadata

Assignees

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