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

Value validation #66

Merged
merged 16 commits into from
Nov 4, 2023
Merged

Value validation #66

merged 16 commits into from
Nov 4, 2023

Conversation

liamhuber
Copy link
Member

@liamhuber liamhuber commented Nov 3, 2023

Validate value assignments against type hints. Since this could possibly be a bit expensive (I haven't noticed it so far), I also added node-level shortcuts for turning (on)off type checking at all levels beneath that node. The idea is to leave it in place by default, then if a user has a workflow they're very happy with they disable the checking before submitting it for production runs.

Closes #50

TODO:

  • Update docstring examples (or at least verify they don't need updating)
  • Update example notebook (as above)

We do type checking when assigning to value now, so no need for a special method
Forget the "computational efficiency", just always type check. _But_ we should make it easier to disable _all_ type checking once users have a workflow they're totally satisfied with and want to run it in production.
Copy link

github-actions bot commented Nov 3, 2023

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

Copy link

github-actions bot commented Nov 3, 2023

Pull Request Test Coverage Report for Build 6756788069

  • 30 of 32 (93.75%) changed or added relevant lines in 5 files are covered.
  • 66 unchanged lines in 6 files lost coverage.
  • Overall coverage decreased (-0.2%) to 87.58%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pyiron_workflow/io.py 2 4 50.0%
Files with Coverage Reduction New Missed Lines %
io.py 2 88.55%
macro.py 7 89.41%
node.py 9 87.15%
function.py 12 90.7%
channels.py 13 91.3%
composite.py 23 89.08%
Totals Coverage Status
Change from base Build 6750383642: -0.2%
Covered Lines: 3279
Relevant Lines: 3744

💛 - Coveralls

Copy link

codacy-production bot commented Nov 3, 2023

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.40% (target: -1.00%) 58.82%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (24c88e0) 1880 1539 81.86%
Head commit (a52d8c8) 1893 (+13) 1542 (+3) 81.46% (-0.40%)

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 (#66) 34 20 58.82%

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

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@liamhuber liamhuber added the format_black trigger the Black formatting bot label Nov 4, 2023
@liamhuber liamhuber merged commit a83be99 into main Nov 4, 2023
14 of 15 checks passed
@liamhuber liamhuber deleted the value_validation branch November 4, 2023 19:43
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.

Type-check new values
2 participants