OmkarPathak/pygorithm

Better way to do images?

Tjstretchalot opened this issue · 6 comments

I am hoping for comment on my latest commit to the dev branch (f044a65) specifically regarding this folder: https://github.com/OmkarPathak/pygorithm/tree/dev/imgs/test_geometry/test_extrapolated_intersection/out

It contains a lot of images that help me visualize what the tests are doing. They look like:

ah04_test_line_line_intr_later

They are referenced as explained here: https://github.com/OmkarPathak/pygorithm/blob/dev/tests/test_geometry.py#L1455
Do you think that it's fine that there are a lot of these files? I can't think of any good alternatives.

I think it's good. Let's go with this idea for now. 👍

How are you making them? It should be fine since they aren't packaged with the module, unless they are supposed to be

I'm using this program called "graph". It probably doesn't need to be packaged on pypy but I wonder if I should add a link to the github repo in the tests in case they come across the comments referencing it?

@Tjstretchalot Maybe we could implement matplotlib?

Ok so spent last couple hours working on what that would look like with matplotlib. The files generated would look something like:

aa01_test_point_line_no_intr_2

Generated from this file: https://github.com/OmkarPathak/pygorithm/blob/608999b4b847088d84c089bb356e287c8863ee87/imgs/test_geometry/test_extrapolated_intersection/aa01_test_point_line_no_intr.py

as opposed to:

aa01_test_point_line_no_intr

(after lots of configuration). No huge difference (though matplotlib has slightly better antialiasing whereas Graph has prettier arrows).

Using that method I believe I could reduce the number of generating files by about a factor of 4 with the same number of images. That is to say, I could reduce it to one file per "type" of image. It wouldn't save any time, but is perhaps more portable?

Thoughts on that now that we can see them both? @OmkarPathak @IanDoarn

I'm going to go with matplotlib from now on, I think with a larger initial investment it will make future ones easier