Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Decouple and minimise dependencies for visualisation #131

Merged
merged 23 commits into from
Aug 24, 2022

Conversation

eduardo-rodrigues
Copy link
Member

@eduardo-rodrigues eduardo-rodrigues commented Jun 8, 2022

It is best to decouple as much as possible, in design, and with the dependency on Graphviz we now have for visualisation, we no longer need networkx, tex2pix and dot2tex. The package gets much lighter with no loss of functionality since, as I show in MR #130, it is trivial at present to visualize a graph directly in a notebook or simply save the graph in, say, PNG or PDF.

IMO this deals with #53.

Resolves #53

* Remove visualize method.
* Remove viz extra.
* Remove networkx and tex2pix dependencies in favor of using graphviz.

@eduardo-rodrigues eduardo-rodrigues changed the title Decouple dependencies for visualisation build: decouple and minimise dependencies for visualisation Jun 8, 2022
@eduardo-rodrigues
Copy link
Member Author

I realise that the example notebooks need to be refreshed after this. I would prefer to do it in a follow-up MR since the notebooks need a major refreshment anyway, especially that the LHE files "used" in them are not available. We could get new notebooks in a notebooks directory as for other or packages, and then add a Binder button as well ... WDYT?

@codecov
Copy link

codecov bot commented Jun 8, 2022

Codecov Report

Merging #131 (5f009cd) into master (555f5d9) will decrease coverage by 2.53%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #131      +/-   ##
==========================================
- Coverage   62.82%   60.28%   -2.54%     
==========================================
  Files           2        2              
  Lines         234      209      -25     
  Branches       59       56       -3     
==========================================
- Hits          147      126      -21     
+ Misses         76       73       -3     
+ Partials       11       10       -1     
Flag Coverage Δ
unittests-3.10 58.85% <ø> (-2.69%) ⬇️
unittests-3.6 57.35% <ø> (-2.91%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/pylhe/__init__.py 65.69% <ø> (-2.33%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@matthewfeickert matthewfeickert changed the title build: decouple and minimise dependencies for visualisation build: Decouple and minimise dependencies for visualisation Jun 20, 2022
Copy link
Member

@matthewfeickert matthewfeickert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good, and solves a lot of problems. 🚀 I think the only thing that would be good to note/fix(?) for the future would be

that the old method allowed for LaTeX fonts

old_example

while using graphviz.graphs.Digraph.render doesn't seem to do that

test

Is there a way to get LaTeX fonts? This is somewhat steering back into the questions of Issue #53, which I haven't taken the time to review and refresh myself on, so apologies if all of this should be obvious.

tests/test_visualize.py Show resolved Hide resolved
@eduardo-rodrigues
Copy link
Member Author

I think the only thing that would be good to note/fix(?) for the future would be that the old method allowed for LaTeX fonts.

Is there a way to get LaTeX fonts? This is somewhat steering back into the questions of Issue #53, which I haven't taken the time to review and refresh myself on, so apologies if all of this should be obvious.

It must be possible since both packages in the end write DOT language files. I used what I'm doing in DecayLanguage. I'm putting your request down as a to-do to look into this soon, after a few days off ... In the meantime, if this goes in we're good tp proceed with the other MRs dependent on this.

@eduardo-rodrigues
Copy link
Member Author

eduardo-rodrigues commented Aug 18, 2022

Hello @matthewfeickert, I finally remembered to re-instate a test as you had before, see your comment #131 (comment) above.

Coverage is to be worked on but that's not specific to this MR, rather a general issue that coverage is missing for certain classes, etc. That's clearly outsidethe scope of this MR. This is an important MR as it makes dependencies easier and unblocks some dependent MRs.

As for your comment #131 (comment) I would gladly make this a follow-up issue as it is a quality of life improvement, and something I can look into in the future. Again, a different matter, second priority.

In short, I really think this is ready to go in asap. If happy please approve and I will make the follow-up issue. Thanks a lot.

@eduardo-rodrigues
Copy link
Member Author

Follow-up issue created - #135 for discussion #131 (comment).

@eduardo-rodrigues
Copy link
Member Author

Hi @matthewfeickert, I will merge this really shortly since the follow-up task is created and blocking this further is counter-productive and not helping anyone, certainly not the users. Coverage is a serious matter to deal with across the files, not just the 2-3 lines mentioned by codecov above ;-).

@matthewfeickert
Copy link
Member

Hi @matthewfeickert, I will merge this really shortly since the follow-up task is created and blocking this further is counter-productive and not helping anyone, certainly not the users. Coverage is a serious matter to deal with across the files, not just the 2-3 lines mentioned by codecov above ;-).

Okay. 👍 I still have some concerns about trading one viz library for another that now changes how the visualizations look, but I'm willing to kick that down the road a bit to sometime when I have more time to do the work here for these concerns to matter.

@matthewfeickert matthewfeickert merged commit 48f528e into master Aug 24, 2022
@matthewfeickert matthewfeickert deleted the eduardo-rm-tex2pix branch August 24, 2022 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reconsider tex2pix dependency
2 participants