-
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 colors for gui #486
base: main
Are you sure you want to change the base?
add colors for gui #486
Conversation
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.
Can you add an example figure?
pyiron_workflow/nodes/composite.py
Outdated
@property | ||
def gui_color(self) -> str: | ||
"""For nodes in the gui""" | ||
return "#eacf9f" |
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 find it nice that @liamhuber so far mostly followed the convention of naming the color and return the variable. Do you maybe want to do that as well?
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 added variables for the colors, but did not define them in the Seaborn class (which is in pyiron_snippets). I think the Seaborn colors follow some pre-defined color palette . Is that OK?
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.
And where would you like the example picture?
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.
In the PR comment.
Actually you might also need to explain either in the code (better) or in the PR how this property is used.
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 preferencesCodacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more |
Pull Request Test Coverage Report for Build 11234413414Details
💛 - Coveralls |
The properties are used in |
can you maybe also say real quick what was the problem without having |
The colors in the gui are taken directly from the nodes in |
Ok that's a valid concern. But I have a different concern now: Since we rely on auto-complete as well as Let's wait for @liamhuber and see what he says |
There may be more such attributes for the automated positioning of nodes in the gui in the future. If not in the specific types of nodes (e.g., |
I am definitely against introducing a new field for the gui color -- the core infrastructure shout have no idea the gui exists, and @samwaseda is correct about tab completion menu crowding. I have no objection to updating the existing color attributes and that should solve the problem. I am ok totally getting rid of the color node attribute, but this information can't be destroyed -- only moved. Somewhere we should have a table relating classes to colors, and a function for getting most-specific class color from this table given the class. Pros: nodes don't need to know about colors and then they wouldn't, and draw and the guy could use the same infrastructure with different color tables. Cons: more of a pain to maintain as such color tables may need to be updated (maybe in multiple places) if a new node is introduced. Overall I still think this is the best attack. |
And for this very reason I find it actually surprising that there are colours attached to the nodes in the first place. For me a helpful distinction would be whether there are more nodes underneath, which in the case of One way or other, I think there should be a cleaner interface between For this PR, if it's all about darkness, we can maybe define something similar to |
Is there an attribute which gives me the type of the node - function, composite etc.? I feel this would be useful in a variety of situations. On the S-Bahn for the next 50 minutes, but can't wait that long to check for myself 😆. EDIT: nvm I saw in the draw module that |
Yes, this is absolutely just bad/lazy abstraction on my part. This information needs to reside inside the
What you're looking for is just the class inheritance -- you just want I agree the main two are
This exists for |
I disagree -- there is a straightforward pythonic way of finding what type of
Here I agree, but the way I suggest to do it is as I mentioned earlier: So I'm for convenience, but against alternate routes for standard language stuff. |
If we have |
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 preferencesCodacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more |
No description provided.