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

Registration by identifier alone #156

Merged
merged 15 commits into from
Jan 15, 2024
Merged

Conversation

liamhuber
Copy link
Member

Promotes the importance of the package identifier during registration -- it comes first in the signature, and specifying a domain is completely optional. Also gives item-access to registered packages from the creator using their package identifier as a key. E.g., together with recursive registration on modules from the parent branch, we could now write something like

from pyiron_workflow import Workflow

Workflow.register("pyiron_workflow.node_library")
Workflow.create["pyiron_workflow.node_library.standard"].Absolute(label="without_a_creator_domain")

# Or with a shortcut and attribute access as before
Workflow.register("pyiron_workflow.node_library", "lib")
Workflow.create.lib.standard.Absolute(label="shortcut_sugar")

This will be useful downstream for loading saved workflows, and maybe also for macros -- basically whenever all we have/want is the package identifier. After all, the whole "domain" business for registration was just to make shortcuts like Workflow.create.some_domain.NodeClass for cases where the package identifier is long and hideous and we don't want to type it all the time.

@liamhuber liamhuber requested a review from samwaseda January 9, 2024 19:45
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link

github-actions bot commented Jan 9, 2024

Binder 👈 Launch a binder notebook on branch pyiron/pyiron_workflow/registration_by_identifier_alone

Copy link

codacy-production bot commented Jan 9, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.04% (target: -1.00%) 90.63%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (1964aa7) 2559 2185 85.38%
Head commit (05b6356) 2572 (+13) 2195 (+10) 85.34% (-0.04%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#156) 32 29 90.63%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

You may notice some variations in coverage metrics with the latest Coverage engine update. For more details, visit the documentation

@liamhuber liamhuber added the format_black trigger the Black formatting bot label Jan 9, 2024
Base automatically changed from registration_tracking to main January 15, 2024 21:14
@liamhuber liamhuber merged commit 5bb9eaf into main Jan 15, 2024
15 checks passed
@liamhuber liamhuber deleted the registration_by_identifier_alone branch January 15, 2024 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
format_black trigger the Black formatting bot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants