-
Notifications
You must be signed in to change notification settings - Fork 122
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
Fix having to plot twice to get a file with size bigger than 3kb #2141
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2141 +/- ##
==========================================
+ Coverage 80.82% 87.16% +6.33%
==========================================
Files 44 45 +1
Lines 7489 8079 +590
==========================================
+ Hits 6053 7042 +989
+ Misses 1436 1037 -399 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think adding a test would be interesting but I let you decide @germa89 if it would be relevant or not!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Problem was that the graphics wasn't "flushed" after executing all the commands. Now using the context manager, we make sure we flush after running each plot command.
I also fixed the static images not being plot in jupyter notebooks, the key was relaxing the regex (
PNG_IS_WRITTEN_TO_FILE
) which decides if the plot was written to a file or not.Also I had to flush (
mapdl.show("close")
) the graphics before plotting (otherwise the 3kb file gives error).Close #1629