From 56ed3538f6048e46ee51356a7c1f602138a7a7af Mon Sep 17 00:00:00 2001 From: pdcxs Date: Sun, 13 Jan 2019 23:29:46 +0800 Subject: [PATCH 1/6] Fix the file problem when combine videos on Windows --- manimlib/scene/scene.py | 7 ++++++- manimlib/utils/output_directory_getters.py | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/manimlib/scene/scene.py b/manimlib/scene/scene.py index b4331f79..b3cceb68 100644 --- a/manimlib/scene/scene.py +++ b/manimlib/scene/scene.py @@ -733,8 +733,13 @@ class Scene(Container): '-loglevel', 'error', movie_file_path ] - subprocess.call(commands) + combine_process = subprocess.Popen(commands) + combine_process.wait() + for pf_path in partial_movie_files: + os.remove(pf_path) os.remove(file_list) + os.rmdir(partial_movie_file_directory) + os.rmdir(os.path.join(partial_movie_file_directory, os.path.pardir)) print("File ready at {}".format(movie_file_path)) def tex(self, latex): diff --git a/manimlib/utils/output_directory_getters.py b/manimlib/utils/output_directory_getters.py index 3e364271..a3695249 100644 --- a/manimlib/utils/output_directory_getters.py +++ b/manimlib/utils/output_directory_getters.py @@ -15,7 +15,7 @@ def add_extension_if_not_present(file_name, extension): def guarantee_existance(path): if not os.path.exists(path): os.makedirs(path) - return path + return os.path.abspath(path) def get_scene_output_directory(scene_class): @@ -78,4 +78,4 @@ def get_sorted_integer_files(directory, elif remove_non_integer_files: os.remove(full_path) indexed_files.sort(key=lambda p: p[0]) - return list(map(lambda p: p[1], indexed_files)) + return list(map(lambda p: os.path.join(directory, p[1]), indexed_files)) From cb76ec127084b294e5b941529dc33f497a8a282b Mon Sep 17 00:00:00 2001 From: pdcxs Date: Sun, 13 Jan 2019 23:35:05 +0800 Subject: [PATCH 2/6] Fix file problem when combine videos on Windows --- manimlib/scene/scene.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manimlib/scene/scene.py b/manimlib/scene/scene.py index b3cceb68..4e69e6b2 100644 --- a/manimlib/scene/scene.py +++ b/manimlib/scene/scene.py @@ -719,7 +719,7 @@ class Scene(Container): ) with open(file_list, 'w') as fp: for pf_path in partial_movie_files: - fp.write("file {}\n".format(pf_path)) + fp.write("file {}\n".format(pf_path).replace('\\', '/')) movie_file_path = self.get_movie_file_path() commands = [ From ac8773870172f3c56f537e8e6baee0670673e102 Mon Sep 17 00:00:00 2001 From: pdcxs Date: Mon, 14 Jan 2019 10:38:54 +0800 Subject: [PATCH 3/6] Only change backslash on windows --- manimlib/scene/scene.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/manimlib/scene/scene.py b/manimlib/scene/scene.py index 4e69e6b2..72dde6a4 100644 --- a/manimlib/scene/scene.py +++ b/manimlib/scene/scene.py @@ -719,7 +719,10 @@ class Scene(Container): ) with open(file_list, 'w') as fp: for pf_path in partial_movie_files: - fp.write("file {}\n".format(pf_path).replace('\\', '/')) + if os.name == 'nt': + fp_path = fp_path.replace('\\', '/') + + fp.write("file {}\n".format(pf_path)) movie_file_path = self.get_movie_file_path() commands = [ From 27f1dfe75bf20b82ae9b841528bfecd169fe58a8 Mon Sep 17 00:00:00 2001 From: pdcxs Date: Mon, 14 Jan 2019 10:45:36 +0800 Subject: [PATCH 4/6] Replace backslash to slash only on windows platform --- manimlib/scene/scene.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manimlib/scene/scene.py b/manimlib/scene/scene.py index 72dde6a4..b3135cf0 100644 --- a/manimlib/scene/scene.py +++ b/manimlib/scene/scene.py @@ -720,7 +720,7 @@ class Scene(Container): with open(file_list, 'w') as fp: for pf_path in partial_movie_files: if os.name == 'nt': - fp_path = fp_path.replace('\\', '/') + pf_path = pf_path.replace('\\', '/') fp.write("file {}\n".format(pf_path)) From bb1a74ce715c939859d669dab39fd9975a078b9b Mon Sep 17 00:00:00 2001 From: govind cs Date: Wed, 16 Jan 2019 15:43:43 +0530 Subject: [PATCH 5/6] updated the docker file to use fewer layers. The final image size should be much smaller. You can squish it down a bit more but the difference in size isn't that big. --- Dockerfile | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index ef72df0f..45ecc1f7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,37 +1,24 @@ FROM ubuntu:18.04 ENV DEBIAN_FRONTEND noninteractive - RUN apt-get update -qqy RUN apt-get install -qqy --no-install-recommends apt-utils - WORKDIR /root -RUN apt-get install -qqy build-essential libsqlite3-dev sqlite3 bzip2 \ - libbz2-dev zlib1g-dev libssl-dev openssl libgdbm-dev \ - libgdbm-compat-dev liblzma-dev libreadline-dev \ - libncursesw5-dev libffi-dev uuid-dev -RUN apt-get install -qqy wget +RUN apt-get install --no-install-recommends -qqy build-essential libsqlite3-dev sqlite3 bzip2 \ +libbz2-dev zlib1g-dev libssl-dev openssl libgdbm-dev \ +libgdbm-compat-dev liblzma-dev libreadline-dev \ +libncursesw5-dev libffi-dev uuid-dev wget ffmpeg apt-transport-https texlive-latex-base \ +texlive-full texlive-fonts-extra sox git libcairo2-dev libjpeg-dev libgif-dev && rm -rf /var/lib/apt/lists/* RUN wget -q https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz RUN tar -xf Python-3.7.0.tgz WORKDIR Python-3.7.0 RUN ./configure > /dev/null && make -s && make -s install RUN python3 -m pip install --upgrade pip -RUN apt-get install -qqy libcairo2-dev libjpeg-dev libgif-dev COPY requirements.txt requirements.txt RUN python3 -m pip install -r requirements.txt RUN rm requirements.txt WORKDIR /root RUN rm -rf Python-3.7.0* - -RUN apt-get install -qqy ffmpeg - ENV TZ=America/Los_Angeles RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone -RUN apt-get install -qqy apt-transport-https -RUN apt-get install -qqy texlive-latex-base -RUN apt-get install -qqy texlive-full -RUN apt-get install -qqy texlive-fonts-extra -RUN apt-get install -qqy sox -RUN apt-get install -qqy git - ENV DEBIAN_FRONTEND teletype ENTRYPOINT ["/bin/bash"] From f4e3706389c0dd8f8b75454dcd05c4076a842eea Mon Sep 17 00:00:00 2001 From: Jasper Homann Date: Fri, 18 Jan 2019 13:38:07 +0100 Subject: [PATCH 6/6] Fixed a ZeroDivisionError when instantiating Axes --- manimlib/mobject/coordinate_systems.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manimlib/mobject/coordinate_systems.py b/manimlib/mobject/coordinate_systems.py index 60ccd036..03dfae06 100644 --- a/manimlib/mobject/coordinate_systems.py +++ b/manimlib/mobject/coordinate_systems.py @@ -38,12 +38,12 @@ class Axes(VGroup): VGroup.__init__(self, **kwargs) x_axis_config = merge_config([ self.x_axis_config, - {"x_min": self.x_min, "x_max": self.x_min}, + {"x_min": self.x_min, "x_max": self.x_max}, self.number_line_config, ]) y_axis_config = merge_config([ self.y_axis_config, - {"x_min": self.y_min, "x_max": self.y_min}, + {"x_min": self.y_min, "x_max": self.y_max}, self.number_line_config, ]) self.x_axis = NumberLine(**x_axis_config)