-
Notifications
You must be signed in to change notification settings - Fork 2
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 error message for return item without channel
#241
Conversation
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesYou may notice some variations in coverage metrics with the latest Coverage engine update. For more details, visit the documentation |
Pull Request Test Coverage Report for Build 8254926325Details
💛 - Coveralls |
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.
I totally agree with the diagnosis, and that the proper outcome is to raise a more informative error, I only have a differing opinion on finer details of the treatment. My disclaimer is that atm I'm on the couch on mobile with a sick kid napping on me 😂 so I can't browse the code base easily. I'll try to come back and polish this if I get a chance, but in case you get to it first I wanted you to have the feedback.
My main concern is that I don't like the location of the check -- IIRC this gets used for both I and O at some point, but this is strictly an O problem; it also un-statics the method, and while I agree we need self for an informative message (label and options), it is a yellow flag to me to convert away from static.
I think I would prefer a new private _prepare_...
method analogous to the input one and to do this there. At any rate, some other more specific and more specifically named location for this work please!
Otherwise just two nits:
- I'm trying to reduce string usage in the messages to help refactoring be more stable; this might be an edge case because of what we want to say, but you could play around with sentence formulations that replace the
"channel"
string with{HasChannel.__name__}
- I'm not sold on giving a link to the repo in the error message. IMO people know what the package name is and will find their way there by themselves. If we do wdecide to include this, I would want to do so consistently across all user-facing messages (and thus in a separate PR)
Oh, and we need a test added that catches the new message |
Ok, I've got my computer and I stand by everything I said earlier. More specifically, somewhere in here: pyiron_workflow/pyiron_workflow/macro.py Lines 313 to 319 in bb326ec
I'd slot in a new method like In the future we could even imagine extending the check to create channel objects from non-HasChannel returns. This heads in the direction of getting macro and function nodes to be more similar, and is absolutely not necessary here and now, but I like that this change is commensurate with that direction. |
Ok I messed around. In the end I didn't put it in |
@@ -317,13 +317,10 @@ def __init__( | |||
if len(ui_nodes) > 0: | |||
self._whitelist_inputs_map(*ui_nodes) | |||
if returned_has_channel_objects is not None: | |||
if not isinstance(returned_has_channel_objects, tuple): |
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.
This was not intentional (also nothing changed). I can revoke this change if you prefer.
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.
Maybe we lack a test where the graph creator returns only a single value?
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.
Ah, nvm, I see your comment applies to the change in the next few lines too. It's just a refactor. I don't have strong feelings, I find both perfectly readable and don't see an efficiency difference.
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.
LGTM now! The windows failure is just #48. I want the tests passing before we merge, but I would be surprised if it takes more than one re-run as the error is exceptionally rare.
Ugh, my rerun failed jobs button has no effect. I'm not sure if it's a problem with my browser or what, but this happens sometimes. @samwaseda could you rerun the failed windows test before merging? |
I keep making a mistake like this:
The main problem is that in the current implementation it only says
NOT_DATA
does not havechannel
, which doesn't immediately make me understand where the error is coming from.