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

GUI: add task control for int, float, string and structure #295

Merged
merged 11 commits into from
Nov 12, 2024

Conversation

superstar54
Copy link
Member

@superstar54 superstar54 commented Sep 6, 2024

See issue #296

Here is an example that shows the value of int, float, string and StructureData sockets:

from ase.build import molecule

h2o = molecule("H2O")
h2o.pbc = [True, True, True]
h2o.center(vacuum=2.0)

structure = orm.StructureData(ase=h2o)

@task.calcfunction()
def add(x: int, y: float, z: str, structure: orm.StructureData):
    return x + y


wg = WorkGraph("add_multiply_workflow")
add_task = wg.add_task(add, name="add1", x=1, y=2.1, z="abc", structure=structure)
wg.add_task(multiply, name="multiply1", x=add_task.outputs["result"], y=3)
wg.run()

Then open the web app, and visualize the WorkGraph, here is a screenshot from the web app:

image

TODO

How to handle serializer registered in PythonJob?

@superstar54 superstar54 changed the title Add control for int, float and string GUI: add task control for int, float and string Sep 6, 2024
@superstar54 superstar54 marked this pull request as draft September 6, 2024 18:08
@superstar54 superstar54 changed the title GUI: add task control for int, float and string GUI: add task control for int, float, string and structure Sep 7, 2024
@superstar54 superstar54 force-pushed the feature/add_basic_input_control branch 2 times, most recently from d457dd1 to 37fc92c Compare September 8, 2024 20:35
@codecov-commenter
Copy link

codecov-commenter commented Sep 8, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 80.55%. Comparing base (5937b88) to head (f57f83b).
Report is 90 commits behind head on main.

Files with missing lines Patch % Lines
tests/web/frontend/test_frontend.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #295      +/-   ##
==========================================
+ Coverage   75.75%   80.55%   +4.79%     
==========================================
  Files          70       66       -4     
  Lines        4615     5157     +542     
==========================================
+ Hits         3496     4154     +658     
+ Misses       1119     1003     -116     
Flag Coverage Δ
python-3.11 80.47% <60.00%> (+4.80%) ⬆️
python-3.12 80.47% <60.00%> (?)
python-3.9 80.50% <60.00%> (+4.77%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@superstar54 superstar54 force-pushed the feature/add_basic_input_control branch from 37fc92c to 312c1b3 Compare September 8, 2024 21:19
@agoscinski
Copy link
Contributor

agoscinski commented Sep 9, 2024

Can this be also turned off? I am just a bit worried if people have huge structures that the GUI becomes quite slow. Not sure if this a valid worry as I don't know much about the computational cost for rendering atomic structures

@superstar54
Copy link
Member Author

Can this be also turned off?

Yes, there is a toggle button so that the user can switch between short view and node detail view.

@superstar54 superstar54 linked an issue Sep 18, 2024 that may be closed by this pull request
@superstar54 superstar54 marked this pull request as ready for review November 12, 2024 05:40
@superstar54 superstar54 merged commit bdbc28e into main Nov 12, 2024
8 checks passed
@superstar54 superstar54 deleted the feature/add_basic_input_control branch November 12, 2024 09:41
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.

GUI: show node properties (detail view)
3 participants