pdf_reports icon indicating copy to clipboard operation
pdf_reports copied to clipboard

Update setup.py - matplotlib

Open agsdot opened this issue 2 years ago • 5 comments

matplotlib needed in https://github.com/Edinburgh-Genome-Foundry/pdf_reports/blob/6908f49a16007f882f108580e18503f492bea9fd/pdf_reports/tools.py#L15 .

agsdot avatar Dec 12 '23 18:12 agsdot

Thank you for spotting this, indeed it requires matplotlib for certain functions. It's a large dependency so I'm thinking whether to make it an optional install option (as in DNA Chisel for example)

veghp avatar Dec 12 '23 19:12 veghp

:+1:

agsdot avatar Dec 12 '23 20:12 agsdot

Any update on this @veghp , also I'm curious. How could I use tailwindcss 3 instead of semantic for this project?

agsdot avatar Feb 27 '24 21:02 agsdot

I am also voting for making matplotlib optional, the import is only used line 162:

if isinstance(fig, Axes):

This is really just a "comfort" check (the user could provide the ax.figure directly) and this could be replaced by the following which, although slightly less stringent, removes the need for matplotlib entirely

if fig.__class__.__name__ == "Axes":

Zulko avatar Feb 28 '24 15:02 Zulko

Yes I vote on that option too. I can implement it this week.

@agsdot re your other question, I haven't used tailwindcss, but for semantic, the css is stored here: https://github.com/Edinburgh-Genome-Foundry/pdf_reports/tree/master/pdf_reports/css which is loaded here https://github.com/Edinburgh-Genome-Foundry/pdf_reports/blob/6908f49a16007f882f108580e18503f492bea9fd/pdf_reports/pdf_reports.py#L54 and used in this function: https://github.com/Edinburgh-Genome-Foundry/pdf_reports/blob/6908f49a16007f882f108580e18503f492bea9fd/pdf_reports/pdf_reports.py#L112

To use other styles, set use_default_styling=False and specify extra CSS filepath(s) with extra_stylesheets=()

extra_stylesheets List of paths to other ".css" files used to define new styles or overwrite default styles.

Would that solve the question?

veghp avatar Feb 28 '24 17:02 veghp