SPF-OST / pytrnsys_gui

Graphical user interface for pytrnsys
https://pytrnsys.readthedocs.io
GNU Lesser General Public License v3.0
3 stars 4 forks source link

Automate production of diagram PDFs for all regimes in a given hydraulic scheme #465

Closed ahobeost closed 2 months ago

ahobeost commented 1 year ago

As a user, I would like to automate the workflow of producing images of the different hydraulic regimes in a given diagram. This tends to work as follows:

FOREACH regime:

Afterwards, the PDFs also still need to be cropped.

I would like a way to:

The other requirements should already be accessible from python

ahobeost commented 1 year ago

@zuckerruebe: The following package makes the visual comparison of PDFs very simple. https://pypi.org/project/diff-pdf-visually/#on-windows-native

However, it requires both ImageMagic and PopplerCairo to be installed correctly. Before I further with this, I'd like your opinion on these requirements

ahobeost commented 1 year ago

Here is one alternative, which uses a CLI: https://github.com/vslavik/diff-pdf

ahobeost commented 1 year ago

Matplotlib provides a cleaner option: https://matplotlib.org/stable/api/testing_api.html#module-matplotlib.testing.compare

At the moment, this works with pdfs. However, it would be nice to run these tests without always saving the pdf to disk.

The following may allow this when combined with pytest_mpl: https://matplotlib.org/stable/users/explain/backends.html

https://pytest-mpl.readthedocs.io/en/latest/usage.html

ahobeost commented 1 year ago

Ok, so matplotlib only requires inkscape to do the svg comparison: https://matplotlib.org/stable/devel/dependencies.html#test-dependencies