Commit graph

20 commits

Author SHA1 Message Date
Grant Sanderson
f427fc67df
A few bug fixes (#2277)
* Comment tweak

* Directly print traceback

Since the shell.showtraceback is giving some issues

* Make InteracrtiveSceneEmbed into a class

This way it can keep track of it's internal shell; use of get_ipython has a finicky relationship with reloading.

* Move remaining checkpoint_paste logic into scene_embed.py

This involved making a few context managers for Scene: temp_record, temp_skip, temp_progress_bar, which seem useful in and of themselves.

* Change null key to be the empty string

* Ensure temporary svg paths for Text are deleted

* Remove unused dict_ops.py functions

* Remove break_into_partial_movies from file_writer configuration

* Rewrite guarantee_existence using Path

* Clean up SceneFileWriter

It had a number of vestigial functions no longer used, and some setup that could be made more organized.

* Remove --save_pngs CLI arg (which did nothing)

* Add --subdivide CLI arg

* Remove add_extension_if_not_present

* Remove get_sorted_integer_files

* Have find_file return Path

* Minor clean up

* Clean up num_tex_symbols

* Fix find_file

* Minor cleanup for extract_scene.py

* Add preview_frame_while_skipping option to scene config

* Use shell.showtraceback function

* Move keybindings to config, instead of in-place constants

* Replace DEGREES -> DEG

* Add arg to clear the cache

* Separate out full_tex_to_svg from tex_to_svg

And only cache to disk the results of full_tex_to_svg.  Otherwise, making edits to the tex_templates would not show up without clearing the cache.

* Bug fix in handling BlankScene

* Make checkpoint_states an instance variable of CheckpointManager

As per https://github.com/3b1b/manim/issues/2272

* Move resizing out of Window.focus, and into Window.init_for_scene

* Make default output directory "." instead of ""

To address https://github.com/3b1b/manim/issues/2261

* Remove input_file_path arg from SceneFileWriter

* Use Dict syntax in place of dict for config more consistently across config.py

* Simplify get_output_directory

* Swap order of preamble and additional preamble
2024-12-12 18:45:34 -08:00
Grant Sanderson
e2e785d6c9 Remove init_config.py
It may become a bit unwieldy to make sure this matches the structure of default_config, given the amount of code repetition involved. It seems easier for a user to just create their own custom_config.yml file directly.
2024-12-11 10:50:53 -06:00
Grant Sanderson
9ae5b4dee3 Use addict.Dict for scene config 2024-12-11 10:33:50 -06:00
Grant Sanderson
fce92347fa Replace get_global_config() with manim_config, and make it an addict Dict 2024-12-11 09:50:17 -06:00
Grant Sanderson
8744c878f4 Make log_level configurable in default_config 2024-12-10 20:12:38 -06:00
Grant Sanderson
8cf95ec9a4 Move ReloadManager logic into __main__.py
Since the reload logic no longer relies on any state, the relevant loop is simple enough that it feels clearest to include it in the main entry point file.
2024-12-10 15:46:17 -06:00
Grant Sanderson
cd744024ea Minor reorganization of ReloadManager.retrieve_scenes_and_run 2024-12-10 14:20:43 -06:00
Grant Sanderson
6d0b23f914 Slightly simplify ReloadManager 2024-12-09 16:14:27 -06:00
Grant Sanderson
bf81d94362 Don't make reload_manager a global variable 2024-12-09 15:54:16 -06:00
Splines
1fa17030a2
Add reload() command for interactive scene reloading (#2240)
* Init reload command (lots of things not working yet)

* Add back in class line (accidentally deleted)

* Add back in key modifiers (accidentally deleted)

* Unpack tuple from changed `get_module`

* Init MainRunManager & respawn IPython shell

* Init cleanup of scenes from manager

* Restore string quotes

* Still take `self.preview` into account

* Remove left-over code from module experimentation

* Remove double window activation

* Reset scenes array in RunManager

* Move self.args None check up

* Use first available window

* Don't use constructor for RunManager

* Use self. syntax

* Init moderngl context manually

* Add some comments for failed attempts to reset scene

* Reuse existing shell (this fixed the bug 🎉)

* Remove unused code

* Remove unnecessary intermediate ReloadSceneException

* Allow users to finally exit

* Rename main_run_manager to reload_manager

* Add docstrings to `ReloadManager`

* Improve reset management in window

* Clarify why we use magic exit_raise command

* Add comment about window reuse

* Improve docstrings in ReloadManager & handle case of 0 scenes

* Set scene and title earlier

* Run linter suggestions
2024-11-26 10:09:43 -08:00
YishiMichael
9ef9961d0e
Sort imports 2022-04-12 19:19:59 +08:00
Grant Sanderson
e9afb0ee33 Fix tiny PEP errors 2021-11-30 11:28:26 -08:00
TonyCrane
e10f850d0d add cli flag to specify log level 2021-10-16 21:01:39 +08:00
Michael W
0e574882b3
Refactor #1637 (#1650)
* Refactor #1637

* Refactor #1637

* Refactor #1637

* Refactor #1637

* Refactor #1637

* Refactor #1637

* Update config.py

Co-authored-by: 鹤翔万里 <tonycrane@foxmail.com>
2021-10-16 13:04:52 +08:00
TonyCrane
ed99427a3b print version when start 2021-10-07 17:42:23 +08:00
TonyCrane
ef5253f1bc add cli flag -v to show version info 2021-10-06 17:54:28 +08:00
GZTime
41120b096e Add support for debugger launch 2021-04-09 20:17:21 +08:00
Grant Sanderson
b48ce3f1de Remove whitespace 2021-02-25 08:48:50 -08:00
Tony031218
e3d09d161c add auto config guide 2021-02-07 17:45:18 +08:00
Tony031218
2394bdc2e6 refactor __init__.py and __main__.py 2021-02-07 17:43:05 +08:00