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

Add is_instance attribute to the List Parameter #1023

Merged
merged 2 commits into from
Feb 21, 2025
Merged

Conversation

maximlt
Copy link
Member

@maximlt maximlt commented Feb 14, 2025

Closes #868

Copy link

codecov bot commented Feb 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.28%. Comparing base (aa3315a) to head (8a4dd74).
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1023      +/-   ##
==========================================
+ Coverage   87.25%   87.28%   +0.02%     
==========================================
  Files           9        9              
  Lines        4928     4946      +18     
==========================================
+ Hits         4300     4317      +17     
- Misses        628      629       +1     

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

@@ -587,7 +587,7 @@
"- `param.List`: A Python list of objects, usually of a specified type.\n",
"- `param.HookList`: A list of callable objects, for executing user-defined code at some processing stage\n",
"\n",
"List Parameters accept a Python list of objects. Typically the `item_type` will be specified for those objects, so that the rest of the code does not have to further check types when it refers to those values. Where appropriate, the `bounds` of the list can be set as (_min_length_, _max_length_), defaulting to `(0,None)`. Because List parameters already have an empty value ([]), they do not support `allow_None`.\n",
"List Parameters accept a Python list of objects. Typically the `item_type` will be specified for those objects, so that the rest of the code does not have to further check types when it refers to those values. Where appropriate, the `bounds` of the list can be set as (_min_length_, _max_length_), defaulting to `(0,None)`. Because List parameters already have an empty value ([]), they do not support `allow_None`. `is_isntance` defaults to `True` and can be set to `False` to declare the objects must be subclasses of `item_type`.\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: is_isntance

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, fixed in 8a4dd74

Copy link
Contributor

@jlstevens jlstevens left a comment

Choose a reason for hiding this comment

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

Other than the typo, looks good to me!

I am wondering if there are any other collection parameter types that should support is_instance but do not. Nothing comes immediately to mind....

@maximlt maximlt merged commit 058f77a into main Feb 21, 2025
17 checks passed
@maximlt maximlt deleted the add_List_is_instance branch February 21, 2025 11:14
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.

Add is_instance attribute to Param.List
2 participants