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

Typing progress tracker #3375

Open
8 of 22 tasks
Viicos opened this issue Sep 22, 2023 · 8 comments
Open
8 of 22 tasks

Typing progress tracker #3375

Viicos opened this issue Sep 22, 2023 · 8 comments
Labels

Comments

@Viicos
Copy link
Member

Viicos commented Sep 22, 2023

This issue is meant to track progress related to adding type hints to the library.

Fixes:

Progress (layout subject to changes):

Contributing

Contribution guidelines can be found here (TODO).

This issue can be used for any questions (Discord is good place as well).

When starting working on a new module, you can tweak the ignore_errors value in the mypy.ini configuration file:

manim/.mypy.ini

Lines 4 to 6 in c6450b2

# ignore most files; should be checked once proper types have been implemented
[mypy-manim.__main__]
ignore_errors = True

@to-sta
Copy link

to-sta commented Sep 23, 2023

Happy to help here 😊.

@Viicos
Copy link
Member Author

Viicos commented Sep 24, 2023

Happy to help here 😊.

Nice, #3086 will bring some typing guidelines, though I still need to add more info I guess. Once merged, I'll review the typed modules individually. Feel free to tell which module you'd like to work on (after #3086 gets merged)

@JasonGrace2282
Copy link
Member

Planning on bringing the typing docs up to date when I have time :)

@henrikmidtiby
Copy link
Contributor

There are also work on adding types to the utils module #3999
and to the files in manim/scene/*.py #3981

@henrikmidtiby
Copy link
Contributor

These pull requests are also adding type annotations

Typing mobject text #4092

Typing graphing and camera #4125

@fmuenkel
Copy link
Contributor

Did some work on graphing in #4118, but waiting until some of the other typing PRs are merged.

Any recommendation on what to work on? I want to avoid duplicating work, but like to help making progress on the typing.

@henrikmidtiby
Copy link
Contributor

henrikmidtiby commented Jan 21, 2025

I tried to get an overview of the current number of type errors reported by mypy if no errors are ignored. For this the following command was helpful

pre-commit run mypy --all-files | grep "error" | sed 's/:.*//' | sort | uniq -c

I had this version checked out (6ca08fd) and obtained this output. The numbers in each line indicate the number of mypy errors that was triggered by that file.

      1 Found 882 errors in 55 files (checked 167 source files)
     23 manim/animation/animation.py
     12 manim/animation/composition.py
     25 manim/animation/creation.py
      2 manim/animation/fading.py
      7 manim/animation/growing.py
      8 manim/animation/indication.py
      9 manim/animation/movement.py
      2 manim/animation/numbers.py
      1 manim/animation/rotation.py
     27 manim/animation/speedmodifier.py
      4 manim/animation/transform_matching_parts.py
     21 manim/animation/transform.py
      9 manim/animation/updaters/mobject_update_utils.py
      3 manim/animation/updaters/update.py
      8 manim/camera/camera.py
     10 manim/camera/moving_camera.py
      1 manim/camera/multi_camera.py
      1 manim/camera/three_d_camera.py
      1 manim/_config/cli_colors.py
      4 manim/_config/logger_utils.py
     90 manim/_config/utils.py
    117 manim/mobject/graphing/coordinate_systems.py
      4 manim/mobject/graphing/functions.py
     15 manim/mobject/graphing/number_line.py
      2 manim/mobject/graphing/probability.py
      2 manim/mobject/graphing/scale.py
     32 manim/mobject/graph.py
      4 manim/mobject/logo.py
      5 manim/mobject/matrix.py
     35 manim/mobject/mobject.py
      1 manim/mobject/opengl/opengl_compatibility.py
      4 manim/mobject/opengl/opengl_image_mobject.py
     52 manim/mobject/opengl/opengl_mobject.py
      3 manim/mobject/opengl/opengl_surface.py
     16 manim/mobject/opengl/opengl_vectorized_mobject.py
      4 manim/mobject/svg/brace.py
     10 manim/mobject/svg/svg_mobject.py
     26 manim/mobject/table.py
      3 manim/mobject/text/numbers.py
      4 manim/mobject/text/tex_mobject.py
     37 manim/mobject/text/text_mobject.py
      8 manim/mobject/three_d/polyhedra.py
     34 manim/mobject/three_d/three_dimensions.py
      3 manim/mobject/types/image_mobject.py
      9 manim/mobject/types/point_cloud_mobject.py
     51 manim/mobject/types/vectorized_mobject.py
      4 manim/mobject/value_tracker.py
     30 manim/mobject/vector_field.py
      2 manim/renderer/cairo_renderer.py
      3 manim/renderer/opengl_renderer.py
      4 manim/scene/scene_file_writer.py
     43 manim/scene/scene.py
     17 manim/scene/three_d_scene.py
     24 manim/scene/vector_space_scene.py
      6 manim/utils/hashing.py

I would suggest that you find a file with a low number of type errors and then address these errors in a single PR. Then moves on to the next file and PR.

I can see the following PR's are looking at adding type annotations to the files listed below. It would make sense to avoid adding types to these files.

#4125

      8 manim/camera/camera.py
     10 manim/camera/moving_camera.py
      1 manim/camera/multi_camera.py
   117 manim/mobject/graphing/coordinate_systems.py
      4 manim/mobject/graphing/functions.py
     15 manim/mobject/graphing/number_line.py
      2 manim/mobject/graphing/probability.py
      2 manim/mobject/graphing/scale.py

#4118

      4 manim/mobject/graphing/functions.py
      2 manim/mobject/graphing/scale.py

#4092

     35 manim/mobject/mobject.py
     10 manim/mobject/svg/svg_mobject.py
      3 manim/mobject/text/numbers.py
      4 manim/mobject/text/tex_mobject.py
     37 manim/mobject/text/text_mobject.py
     51 manim/mobject/types/vectorized_mobject.py

@fmuenkel
Copy link
Contributor

@henrikmidtiby Thanks, that's helpful. I will work on some of them one at a time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🆕 New
Development

No branches or pull requests

6 participants