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

Remove semantikon_class condition #115

Merged
merged 2 commits into from
Jan 31, 2025
Merged

Remove semantikon_class condition #115

merged 2 commits into from
Jan 31, 2025

Conversation

samwaseda
Copy link
Member

It's basically the same as this PR, but you don't need to use semantikon_class anymore, but you have to use dataclass. For example:

@dataclass
class Input:
    T: u(float, units="kelvin")
    n: int
    class parameter:
        a: int = 1

@dataclass
class Output:
    E: u(float, units="electron_volt")
    L: u(float, units="angstrom")

@Workflow.wrap.as_function_node
def run_md(inp: Input) -> Output:
    out = Output(E=1., L=2.)
    return out

inp = Input(T=300., n=3)

wf = Workflow("my_wf")
wf.node = run_md(inp)
wf.run()

In this case, inp.T and inp.n as well as out.E and out.L will have their values stored, while inp.parameter.a not, because there is no dataclass applied to it

Copy link

Binder 👈 Launch a binder notebook on branch pyiron/pyiron_ontology/semantikon_class

Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.01% (target: -1.00%) 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (c5e1267) 611 562 91.98%
Head commit (4235026) 610 (-1) 561 (-1) 91.97% (-0.01%)

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 (#115) 3 3 100.00%

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

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@samwaseda samwaseda mentioned this pull request Jan 31, 2025
@samwaseda samwaseda merged commit 41af49a into main Jan 31, 2025
18 of 19 checks passed
@samwaseda samwaseda deleted the semantikon_class branch January 31, 2025 14:25
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.

1 participant