Repository: ManimCommunity/manim

Issue:
When rendering with option --save_section the rendered file names are appended with 0001, 0002, 0003 instead of the "name" attribute.
I am not sure if this shall be categorized as a bug, so let me know if I have to move it elsewhere.

As per title, when rendering with option `--save_section `the rendered file names are appended with 0001, 0002, 0003 instead of the "name" attribute.

for example, say that iI have something like the following:

```
class MyScene(Scene)
    def construct(self):
          self.next_section("MyFirstSection")
          # some code
          self.next_section("Section_Two")
          # some other code
```

and then I render with `--save-sections` option‚ then the rendered files have names:

```
MyScene_0001.mp4
MyScene_0002.mp4
```

whereas it would be nicer if they inherit the section name, e.g.

```
MyScene_MyFirstSection.mp4
MyScene_Section_Two.mp4
```


Discussion:
Not sure I agree. The name could perhaps appear somewhere in the filename, but replacing the numbering completely leads to unsorted files in the file explorer.
> The name could perhaps appear somewhere in the filename

That could be an idea! 
But I am wondering, why it would be a problem to have unsorted files? 
At the end, even when you have a file with multiple scenes you would have them unsorted. 
For example:

```
class Foo(Scene):
    def construct(self):

class Bar(Scene):
    def construct(self):   

class FooBar(Scene):
    def construct(self):  
```

when you render all of them you would have them unsorted, no? :) 


Because if you read them back from disk it becomes a problem of sorting the files by name
> Because if you read them back from disk it becomes a problem of sorting the files by name

This sounds more like a developer issue than a user issue.  

I would like to take on this issue

Resolving patch:
diff --git a/manim/scene/scene_file_writer.py b/manim/scene/scene_file_writer.py
--- a/manim/scene/scene_file_writer.py
+++ b/manim/scene/scene_file_writer.py
@@ -191,7 +191,7 @@ def next_section(self, name: str, type: str, skip_animations: bool) -> None:
             and not skip_animations
         ):
             # relative to index file
-            section_video = f"{self.output_name}_{len(self.sections):04}{config.movie_file_extension}"
+            section_video = f"{self.output_name}_{len(self.sections):04}_{name}{config.movie_file_extension}"
 
         self.sections.append(
             Section(


Test patch:
diff --git a/tests/control_data/videos_data/SceneWithEnabledSections.json b/tests/control_data/videos_data/SceneWithEnabledSections.json
--- a/tests/control_data/videos_data/SceneWithEnabledSections.json
+++ b/tests/control_data/videos_data/SceneWithEnabledSections.json
@@ -10,14 +10,14 @@
     },
     "section_dir_layout": [
         "SquareToCircle.json",
-        "SquareToCircle_0000.mp4",
+        "SquareToCircle_0000_autocreated.mp4",
         "."
     ],
     "section_index": [
         {
             "name": "autocreated",
             "type": "default.normal",
-            "video": "SquareToCircle_0000.mp4",
+            "video": "SquareToCircle_0000_autocreated.mp4",
             "codec_name": "h264",
             "width": 854,
             "height": 480,
diff --git a/tests/control_data/videos_data/SceneWithSections.json b/tests/control_data/videos_data/SceneWithSections.json
--- a/tests/control_data/videos_data/SceneWithSections.json
+++ b/tests/control_data/videos_data/SceneWithSections.json
@@ -10,18 +10,18 @@
     },
     "section_dir_layout": [
         "SceneWithSections.json",
-        "SceneWithSections_0004.mp4",
-        "SceneWithSections_0003.mp4",
-        "SceneWithSections_0002.mp4",
-        "SceneWithSections_0001.mp4",
-        "SceneWithSections_0000.mp4",
+        "SceneWithSections_0004_unnamed.mp4",
+        "SceneWithSections_0003_Prepare For Unforeseen Consequences..mp4",
+        "SceneWithSections_0002_test.mp4",
+        "SceneWithSections_0001_unnamed.mp4",
+        "SceneWithSections_0000_autocreated.mp4",
         "."
     ],
     "section_index": [
         {
             "name": "autocreated",
             "type": "default.normal",
-            "video": "SceneWithSections_0000.mp4",
+            "video": "SceneWithSections_0000_autocreated.mp4",
             "codec_name": "h264",
             "width": 854,
             "height": 480,
@@ -32,7 +32,7 @@
         {
             "name": "unnamed",
             "type": "default.normal",
-            "video": "SceneWithSections_0001.mp4",
+            "video": "SceneWithSections_0001_unnamed.mp4",
             "codec_name": "h264",
             "width": 854,
             "height": 480,
@@ -43,7 +43,7 @@
         {
             "name": "test",
             "type": "default.normal",
-            "video": "SceneWithSections_0002.mp4",
+            "video": "SceneWithSections_0002_test.mp4",
             "codec_name": "h264",
             "width": 854,
             "height": 480,
@@ -54,7 +54,7 @@
         {
             "name": "Prepare For Unforeseen Consequences.",
             "type": "default.normal",
-            "video": "SceneWithSections_0003.mp4",
+            "video": "SceneWithSections_0003_Prepare For Unforeseen Consequences..mp4",
             "codec_name": "h264",
             "width": 854,
             "height": 480,
@@ -65,7 +65,7 @@
         {
             "name": "unnamed",
             "type": "presentation.skip",
-            "video": "SceneWithSections_0004.mp4",
+            "video": "SceneWithSections_0004_unnamed.mp4",
             "codec_name": "h264",
             "width": 854,
             "height": 480,
diff --git a/tests/control_data/videos_data/SceneWithSkipAnimations.json b/tests/control_data/videos_data/SceneWithSkipAnimations.json
--- a/tests/control_data/videos_data/SceneWithSkipAnimations.json
+++ b/tests/control_data/videos_data/SceneWithSkipAnimations.json
@@ -10,16 +10,16 @@
     },
     "section_dir_layout": [
         "ElaborateSceneWithSections.json",
-        "ElaborateSceneWithSections_0003.mp4",
-        "ElaborateSceneWithSections_0001.mp4",
-        "ElaborateSceneWithSections_0000.mp4",
+        "ElaborateSceneWithSections_0003_fade out.mp4",
+        "ElaborateSceneWithSections_0001_transform to circle.mp4",
+        "ElaborateSceneWithSections_0000_create square.mp4",
         "."
     ],
     "section_index": [
         {
             "name": "create square",
             "type": "default.normal",
-            "video": "ElaborateSceneWithSections_0000.mp4",
+            "video": "ElaborateSceneWithSections_0000_create square.mp4",
             "codec_name": "h264",
             "width": 854,
             "height": 480,
@@ -30,7 +30,7 @@
         {
             "name": "transform to circle",
             "type": "default.normal",
-            "video": "ElaborateSceneWithSections_0001.mp4",
+            "video": "ElaborateSceneWithSections_0001_transform to circle.mp4",
             "codec_name": "h264",
             "width": 854,
             "height": 480,
@@ -41,7 +41,7 @@
         {
             "name": "fade out",
             "type": "default.normal",
-            "video": "ElaborateSceneWithSections_0003.mp4",
+            "video": "ElaborateSceneWithSections_0003_fade out.mp4",
             "codec_name": "h264",
             "width": 854,
             "height": 480,