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

[BUG-General] CodeMObject swallows empty lines #638

Closed
mrdon opened this issue Oct 30, 2020 · 0 comments · Fixed by #639
Closed

[BUG-General] CodeMObject swallows empty lines #638

mrdon opened this issue Oct 30, 2020 · 0 comments · Fixed by #639
Labels
pr:bugfix Bug fix for use in PRs solving a specific issue:bug

Comments

@mrdon
Copy link
Contributor

mrdon commented Oct 30, 2020

Describe the bug
When rendering code with the CodeMObject class, any empty lines in the source file are ignored.

To Reproduce

Problematic Code

code.py

from textwrap import wrap
from typing import Optional

from manim import *


class CodeScene(MovingCameraScene):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.caption = None.

Used by:

tex = Code("code.py")
self.play(ShowCreation(tex))

Expected behavior
I expected to see rendered text with new lines between the imports and class preserved. Instead, they were removed and the text was compressed.

Output Media Files

Images/GIFs

image

System Specifications

System Details
  • OS (with version, e.g Windows 10 v2004 or macOS 10.15 (Catalina)): Pop!_OS 20.04 LTS
  • RAM: 64gb
  • Python version (python/py/python3 --version): 3.8.3
  • Installed modules (provide output from pip list):
appdirs==1.4.4
black==20.8b1
cairocffi==1.1.0
cffi==1.14.3
click==7.1.2
colorama==0.4.4
colour==0.1.5
commonmark==0.9.1
grpcio==1.33.2
grpcio-tools==1.33.2
manimce==0.1.0
mypy-extensions==0.4.3
numpy==1.19.3
pangocairocffi==0.3.2
pangocffi==0.6.0
pathspec==0.8.0
pathtools==0.1.2
Pillow==8.0.1
progressbar==2.5
protobuf==3.13.0
pycairo==1.20.0
pycparser==2.20
pydub==0.24.1
Pygments==2.7.2
regex==2020.10.28
rich==9.1.0
scipy==1.5.3
six==1.15.0
toml==0.10.1
tqdm==4.51.0
typed-ast==1.4.1
typing-extensions==3.7.4.3
watchdog==0.10.3
Latex details
  • Distribution (e.g. TeX Live 2020):
  • Installed packages:
FFMPEG Output of `ffmpeg -version`:
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil      56. 31.100 / 56. 31.100
libavcodec     58. 54.100 / 58. 54.100
libavformat    58. 29.100 / 58. 29.100
libavdevice    58.  8.100 / 58.  8.100
libavfilter     7. 57.100 /  7. 57.100
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  5.100 /  5.  5.100
libswresample   3.  5.100 /  3.  5.100
libpostproc    55.  5.100 / 55.  5.100

Additional context
Add any other context about the problem here.

@mrdon mrdon added the pr:bugfix Bug fix for use in PRs solving a specific issue:bug label Oct 30, 2020
mrdon added a commit to mrdon/manim that referenced this issue Oct 30, 2020
@behackl behackl linked a pull request Oct 30, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:bugfix Bug fix for use in PRs solving a specific issue:bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant