-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
doc/user_guide/Parameter_Types.ipynb
Outdated
@@ -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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: is_isntance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed in 8a4dd74
There was a problem hiding this 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....
Closes #868