Skip to content

Conversation

@Tmodrzyk
Copy link
Contributor

@Tmodrzyk Tmodrzyk commented Jul 9, 2025

The fontsize parameter in plot has no effect (Issue #594). The fix was very simple, the size parameter in some matplotlib function calls was overwriting the config_matplotlib call.

  • python3 -m pytest deepinv/tests runs successfully.
  • black . runs successfully.
  • make html runs successfully (in the docs/ directory).
  • Updated docstrings related to the changes (as applicable).
  • Added an entry to the CHANGELOG.rst.

@codecov
Copy link

codecov bot commented Jul 9, 2025

Codecov Report

Attention: Patch coverage is 73.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 81.19%. Comparing base (464ec13) to head (c9c4ec4).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
deepinv/utils/plotting.py 73.33% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #596   +/-   ##
=======================================
  Coverage   81.18%   81.19%           
=======================================
  Files         195      195           
  Lines       17795    17805   +10     
  Branches     2377     2378    +1     
=======================================
+ Hits        14447    14456    +9     
- Misses       2546     2547    +1     
  Partials      802      802           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@samuro95 samuro95 left a comment

Choose a reason for hiding this comment

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

Thanks for the correction! Now the config_matplotlib sets the font.size to 17, when it was set to 9 or 12 before. Have you checked that it still looks good ? thanks

Moreover, I am wondering if there is a possibility to call config_matplotlib() in the setup.py file so that all the documentation is run with these options, rather than having it in every example file

@Tmodrzyk
Copy link
Contributor Author

Tmodrzyk commented Jul 9, 2025

Hi Sam, thanks for your feedback, I did not think about the documentation, I'll check it.
As for the setup.py file you mention I can't seem to find it, where is it located in the library ?

@samuro95
Copy link
Collaborator

samuro95 commented Jul 9, 2025

Hi Sam, thanks for your feedback, I did not think about the documentation, I'll check it. As for the setup.py file you mention I can't seem to find it, where is it located in the library ?

Sorry I mean the conf.py file

Tmodrzyk added 5 commits July 9, 2025 15:46
… available. All tensors in the example are on the cpu, so if the system has an available GPU the example breaks and the associated doc can't be generated.
@Tmodrzyk
Copy link
Contributor Author

Tmodrzyk commented Jul 9, 2025

Now the config_matplotlib sets the font.size to 17, when it was set to 9 or 12 before. Have you checked that it still looks good ?

So indeed it was not looking good with fontsize 17. Now it's supposed to be set at 9 again in the examples.

Moreover, I am wondering if there is a possibility to call config_matplotlib() in the setup.py file so that all the documentation is run with these options, rather than having it in every example file

I did that at the top of the conf.py file. However, calling plot with default value fontsize=17 overwrites this setting, so I changed slightly the way this parameter is handled.

The default fontsize is back to 17 except when generating the doc examples, then the fontsize is 9.

…nfig_matplotlib``

When using seaborn, fontsize had again no effect on the fontsize of the titles, but only on suptitles.
Now one can use seaborn and still control the fontsize of the titles.
@Andrewwango Andrewwango linked an issue Jul 11, 2025 that may be closed by this pull request
@Tmodrzyk
Copy link
Contributor Author

I built the doc locally and checked that everything looks ok.
Now the default fontsize is 9 for every title and suptitle in the doc's plots.
@Andrewwango @samuro95 could you maybe build the doc too just to double check that I did not break everything ? 😃

Copy link
Collaborator

@samuro95 samuro95 left a comment

Choose a reason for hiding this comment

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

I added new comments with the new changes.

@mh-nguyen712
Copy link
Collaborator

We just updated the preview docs for pr. Can your merge with deepinv/main to generate the preview doc @Tmodrzyk ? Thanks!

@Tmodrzyk
Copy link
Contributor Author

Tmodrzyk commented Jul 16, 2025

@mh-nguyen712 It seems I'm up to date with main, I'm not sure about what I should do ?
Also, is the CI broken ? I have a permission denied when building the docs

@mh-nguyen712
Copy link
Collaborator

Sorry for this bug. We just fixed it @Tmodrzyk . Can you merge with main and push again, please? The generated docs then can be found in the Actions. Thanks!

mathurinm and others added 4 commits July 17, 2025 17:31
* remove circle ci + modify docs push

* hai comments + contributing guidelines

* fix yaml

* edit if message exists

* yaml refix

* prpreview cleanup

* try sth

* fix

* fix again

* fix

* try sth 2

* fix again

* try

* and now

* ahhh

* add permission

* fix link

* fix link

* move to end

* add tip
* add size requirement for pretrained diffunet

* Update deepinv/models/diffunet.py

* Update deepinv/models/diffunet.py

* Apply suggestions from code review

* black trailing whitespaces

* cosmit forward diffusion
mh-nguyen712 and others added 3 commits July 17, 2025 17:31
* download url of built doc

* syntax

* comment artifact

* comment not working

* simple solution

* update contrib guide

* rm workflow

* changes
@Andrewwango
Copy link
Collaborator

I've just merged from main to remove existing changes from this PR

Copy link
Collaborator

@Andrewwango Andrewwango left a comment

Choose a reason for hiding this comment

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

Looks good to me

@Tmodrzyk
Copy link
Contributor Author

Looking at the docs generated by the CI, it seems the fontsize is back at 17 for some reasons. I'll double check locally.

My previous solution for the global fontsize was still overwritten by new calls to ``setup_matplotlib``
@Tmodrzyk
Copy link
Contributor Author

Now the fontsize works as expected: 17 by default, fontsize if specified, and 9 in the docs.
I'm not sure that the solution was the most elegant but it works.

@Tmodrzyk Tmodrzyk requested review from Andrewwango and samuro95 July 23, 2025 08:03
@Tmodrzyk
Copy link
Contributor Author

@Andrewwango @samuro95 I think I'm done with this PR, let me know if there's any issue. :)

Copy link
Collaborator

@Andrewwango Andrewwango left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Copy link
Collaborator

@jscanvic jscanvic left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

The font size is really small in the generated docs for the page on 3D diffraction PSFs. Can you check it out?

main:

Image

PR:

Image

@Tmodrzyk
Copy link
Contributor Author

Tmodrzyk commented Aug 8, 2025

I changed the CSS to fix Issue #673 causing figures to be plotted side by side instead of one after the other.
I also increased the default font size for the examples and fixed some errors in other plotting functions.
@jscanvic let me know if you spot any other issues in the examples :)

@Tmodrzyk Tmodrzyk requested a review from jscanvic August 8, 2025 12:03
@jscanvic jscanvic linked an issue Aug 8, 2025 that may be closed by this pull request
Copy link
Collaborator

@jscanvic jscanvic left a comment

Choose a reason for hiding this comment

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

LGTM thanks for fixing that!

@jscanvic jscanvic merged commit 02d2563 into deepinv:main Aug 10, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Figures appear side by side instead of one after the other in the docs fontsize parameter in deepinv.utils.plot has no effect

8 participants