Testing the Renderer's Backwards Compatibility #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is related to #2, and it should fix the issue also as well. This PR implements backward compatibility tests for the renderer. There are 3 new files,
examples/pixel_renderer/samples.tsvcontains example sentences from SIB-200. This file includes 5 examples per language, covering all 200 langauges present in the SIB-200 benchmark.examples/pixel_renderer/create_sample_images.py: This script reads thesamples.tsv(via--input-fileoption) and produces sample rendered text images per language at the specified--output-dir, using the provided set of example sentences. So, instead of saving all images individually, this script groups examples by language, concatenates visually rendered sentences vertically, and produces one image file per language (e.g.eng_Latn.png). It copies thesamples.tsvfile into this directory, and additionally creates a JSON fileversions.jsonwhich contains the current versions of related packages (e.g.pango,pygobject).tests/pixel_renderer/test_backward_compatibility.py: This is the main test file. It takes the sample image directory path via the environment variableSAMPLE_IMAGES_DIR. I don't know whether there exists a more viable solution to pass command line arguments usingpytest.ruff checkdoes not create any warning/error for these new files. I used AI tools to implement tests where I reviewed the code accordingly in detail. I was not completely sure about where I should have putsamples.tsvandcreate_sample_images.pyfiles. We can also move these files to somewhere else. Also, if there is better way to pass the sample image dir value other than environment variable, let's follow that approach. Lastly, this PR is not ready for merge, because I need to write some documentation about it.