Skip to content

Conversation

@MrDiver
Copy link
Collaborator

@MrDiver MrDiver commented May 28, 2022

Overview: What does this pull request change?

This pull requests ports all the new changes from 3b1b/manim and adds type hints to OpenGLMobject and OpenGLVmobject

Current annotations and state is pushed in https://github.com/MrDiver/manimlib
Every method commented with #DONE is already in this PR

TODO:

  • find out the difference between manimgl arrange_in_grid and our version

changelog

OpenGLMobject

Additions:
init_constructor, __add__, __mul__, are_points_touching, is_touching, apply_over_attr_arrays, get_ancestors, insert_submobject, set_submobject, set_rgba_array, set_color_by_rgba_func, set_color_by_rgb_func, set_rgba_array_by_color, arrange_to_fit_dim, replicate
Renamed:
set_rgba_array -> set_rgba_array_by_color (added new set_rgba_array)
set_rgba_array_direct -> set_rgba_array

Removed/Depcrecated:
set_rgba_array_direct

Changes:

  • self.uniform.fixed_orientation_center is now a np.ndarray
  • __init__:
    • Now holds all initial self.x = x assignments and the rest of the constructor which is useful to see is now in init_constructor
  • set_points:
    • Uses asarray instead of array to not unnecessarily copy arrays when not needed.
  • add_updater:
    • now uses self.update(dt=0)
  • set_color:
    • now uses set_rgba_array_by_color instead of setting color directly
  • set_opacity:
    • now uses set_rgba_array_by_color
  • interpolate:
    • now treats all uniforms equally
  • fix_orientation:
    • creates a np.ndarray to set fixed_orientation_center instead of tuple

Temporary changes:

  • check_data_alignment:
    • Does not directly work on self.data instead returns the new result directly to be used in get_resized_shader_data_array

OpenGLVmobject

Additions:

  • @property:stroke_opacity, _stroke_opacity, @property:stroke_width, _stroke_width

Removed/Deprecated

Changes:

Temporary changes:


Shader

Additions:

Removed/Deprecated

Changes:

  • set_uniform:
    • now converts np.ndarray to tuple for easier outside usage to only need to convert on the last step when creating uniforms

Temporary changes:


Color

Additions:

Removed/Deprecated

Changes:

  • rgb_to_hex:
    • always returns Uppercase version of Hex string for uniformity

Temporary changes:


Motivation and Explanation: Why and how do your changes improve the library?

Links to added or changed documentation pages

Further Information and Comments

Reviewer Checklist

  • The PR title is descriptive enough for the changelog, and the PR is labeled correctly
  • If applicable: newly added non-private functions and classes have a docstring including a short summary and a PARAMETERS section
  • If applicable: newly added functions and classes are tested

@MrDiver MrDiver added testing Anything related to testing the library refactor Refactor or redesign of existing code typehints For adding/discussing typehints labels May 31, 2022
@MrDiver MrDiver force-pushed the small_port branch 2 times, most recently from d1b6457 to 8454fc3 Compare June 1, 2022 09:19
MrDiver and others added 10 commits June 4, 2022 16:45
updates:
- [github.com/pre-commit/mirrors-mypy: v0.950 → v0.960](pre-commit/mirrors-mypy@v0.950...v0.960)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Bumps [pillow](https://github.com/python-pillow/Pillow) from 9.1.0 to 9.1.1.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](python-pillow/Pillow@9.1.0...9.1.1)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@MrDiver MrDiver self-assigned this Jun 17, 2022
@MrDiver MrDiver added the help wanted We would appreciate help on this issue/PR label Jun 18, 2022
@MrDiver
Copy link
Collaborator Author

MrDiver commented Jun 18, 2022

Depends on

@MrDiver MrDiver linked an issue Jun 18, 2022 that may be closed by this pull request
@MrDiver
Copy link
Collaborator Author

MrDiver commented Jan 3, 2023

#3107 Will be continued here

@MrDiver MrDiver closed this Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted We would appreciate help on this issue/PR refactor Refactor or redesign of existing code testing Anything related to testing the library typehints For adding/discussing typehints

Projects

Status: Rejected

Development

Successfully merging this pull request may close these issues.

1 participant