-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Fixed Some bugs of code_mobject.py and Text_mobject.py #198
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
Fixed Some bugs of code_mobject.py and Text_mobject.py #198
Conversation
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.
There have been some major changes since you last pulled from master.
- These include changing all the imports to relative imports, and
- Changing the main config system.
- Cleaning up some things from constants.py.
- Internally renaming the manimlib library to manim.
Your PR has added back some of the things that were once removed.
These include the relative imports in code_mobject.py and a lot of what was cleaned up from constants.py. Your code also makes frequent imports from manimlib which has been renamed to manim.
Please address these.
The easiest way would be to pull from ManimCommunity/Master, and simply go through your changes and re-add them.
|
@Aathish04 thanks for that. i did not notice that. |
|
I didn’t follow this PR at all. Is it ready ? |
I think it will work. |
@NavpreetDevpuri I'm so sorry for taking way too much time to respond. There are two things that I think need to be done before this is ready to merge: a) Format the code via Once these are resolved, I think we'll be ready to merge. |
|
I tested it and it works fine for me. But i am using 3b1b/manim Codeclass Test6(Scene):
def construct(self):
t = Paragraph('this is a awesome', 'paragraph', 'With \nNewlines', '\tWith Tabs', ' With Spaces',
'With Alignments',
'center', "left", "right", line_spacing=0.3, size=1, alignment="left", t2c={"Tabs": RED})
self.play(t.shift, RIGHT)
t.__len__()
self.play(t.set_color, RED)
t.set_line_alignment("left", 8)
t.set_line_alignment("right", 9)
self.play(t.set_all_lines_alignments, "right")
t[0][5].set_color(GREEN)
t[0][6].set_color(GREEN)
t[1][0:4].set_color(YELLOW)
rect = SurroundingRectangle(t)
self.add(t, rect)
self.wait()OutputCodeclass test15(Scene):
def construct(self):
helloworldc = Code(
"helloworldc.c",
tab_width=4,
background_stroke_width=1,
background_stroke_color=WHITE,
insert_line_no=True,
style=Code.styles_list[4],
background="window",
)
helloworldcpp = Code(
"helloworldcpp.cpp",
tab_width=4,
background_stroke_width=1,
background_stroke_color=WHITE,
insert_line_no=True,
style=Code.styles_list[15],
background="window",
)
helloworldc.move_to(np.array([-3.6, 0, 0]))
helloworldcpp.move_to(np.array([3.1, 0, 0]))
self.add(helloworldc)
self.play(Transform(remove_invisible_chars(helloworldc),
remove_invisible_chars(helloworldcpp)))
helloworldc[2][0:4].set_color(RED)
self.play(Transform(helloworldc[0], helloworldcpp[0]),
Transform(helloworldc[1], helloworldcpp[1]),
Transform(helloworldc[2], helloworldcpp[2]))
self.wait()Output |
What asset is |
Its looking for specified file |
|
Now tested with manim-community and it works fine 😃 |
|
@NavpreetDevpuri thank you for the update. The tests are failing. Could you please check to see what's the problem? |
|
I reformated all files locally and when I run command |
Hi @NavpreetDevpuri thanks for looking into this again :) Have you made sure to update your version of black? It recently changed from version 19 to version 20. Also, don't worry too much about the black check, it has been failing for a few days now. If you do find you have to update your black version PLEASE do not run black on the whole codebase and push those changes on this PR. If necessary, run black only on the files you are editing on this PR. @Aathish04 @huguesdevimeux please merge this even without black check passing :) |
|
Yes, black tests failing are ok for now as this will be changed soon. Let me know when you think you're done with this PR. We are just waiting @PgBiel aproval, and then we can merge ! |
|
I did my best. I checked/tested/changed/rechecked/tested... until I feel |
|
Marking as ready for review! |
PgBiel
left a comment
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.
There's still a long way to go regarding docs. Please read the guidelines in our Wiki.
manim/mobject/svg/code_mobject.py
Outdated
| from pygments.formatters.html import HtmlFormatter | ||
| from pygments.styles import get_all_styles | ||
|
|
||
| """ |
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.
Shouldn't this be in Code's documentation?
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.
now I added it to the documentation but I did not, because this seems like Extra?
Co-authored-by: Pg Biel <[email protected]>
Co-authored-by: Pg Biel <[email protected]>
|
This has been open for 2 months and the only thing that seems to be blocking the final merge is documentation. @NavpreetDevpuri do you think you have time to work on the documentation suggestions left by @PgBiel ? Otherwise, we should just merge as is and worry about documenting this module later. |
I was busy with something. I am a little weak in the documentation, I mean it takes more time for me to do simple documentations let me try. |
NavpreetDevpuri
left a comment
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.
This has been open for 2 months and the only thing that seems to be blocking the final merge is documentation. @NavpreetDevpuri do you think you have time to work on the documentation suggestions left by @PgBiel ?
Otherwise, we should just merge as-is and worry about documenting this module later.
I did almost what I can do. so, we should merge it after a little review. we can improve documentation in other PR. this PR created mainly for fixing very big bugs.
manim/mobject/svg/code_mobject.py
Outdated
| from pygments.formatters.html import HtmlFormatter | ||
| from pygments.styles import get_all_styles | ||
|
|
||
| """ |
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.
now I added it to the documentation but I did not, because this seems like Extra?
|
Thanks @NavpreetDevpuri for doing what you can about the documentation. There is just one instance that I would like to have sorted out and then we can merge this. See my comments above. |
|
I see you removed that last thing - is there anything else you wish to do before we merge this? @NavpreetDevpuri |
|
@leotrs sir, all clear for now. |






Reopening #90
Fixed 3b1b/manim#1067
NOTE : SurroundingRectangle() only contains visible text.
Output

Output

Added new parameters
background_stroke_widthandbackground_stroke_colorOutput

Updated Paragraph() and added new methods
set_line_to_initial_position()andset_all_lines_to_initial_positions()Output
