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

str -> Optional[Str] in create_starting_node_tree #753

Merged
merged 2 commits into from
Feb 26, 2025

Conversation

zachcp
Copy link
Contributor

@zachcp zachcp commented Feb 25, 2025

Molecule.create_object() calls this function which has branch for None but a type that is only str

def create_starting_node_tree(
    object: bpy.types.Object,
    coll_frames: bpy.types.Collection | None = None,
    style: str = "spheres",
    name: str | None = None,
    color: Optional[str]  = "common",
    material: str = "MN Default",
...
...
    # if requested, setup the nodes for generating colors in the node tree
    if color is not None:    <---- allowing this to be set
        if color == "common":
            node_color_set = add_custom(tree, "Set Color", [200, 0])
            node_color_common = add_custom(tree, "Color Common", [-50, -150])
            node_random_color = add_custom(tree, "Color Attribute Random", [-300, -150])
...
...

Copy link
Owner

@BradyAJohnston BradyAJohnston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just updated with the optional types that were introduced in python 3.10 which is overall what I would like the code base to move towards.

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.96%. Comparing base (9d371e1) to head (0834d2f).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #753      +/-   ##
==========================================
- Coverage   79.06%   78.96%   -0.11%     
==========================================
  Files          80       80              
  Lines        5317     5328      +11     
==========================================
+ Hits         4204     4207       +3     
- Misses       1113     1121       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@BradyAJohnston BradyAJohnston merged commit 53480ea into BradyAJohnston:main Feb 26, 2025
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants