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

Add type to KclValue::Number #5380

Merged
merged 1 commit into from
Feb 14, 2025
Merged

Add type to KclValue::Number #5380

merged 1 commit into from
Feb 14, 2025

Conversation

nrc
Copy link
Contributor

@nrc nrc commented Feb 13, 2025

Another step towards UoM types. Again, there are no user-visible changes here.

This PR adds a type to KclValue::Number. It initialises this for literals with either the specified of default units, but doesn't use it for any checking or conversion. I've done some of the low-hanging fruit of propagating the types, but mostly that is left for future work (as shown by the prevalence of Unknown).

@nrc nrc requested a review from jtran February 13, 2025 20:04
Copy link

qa-wolf bot commented Feb 13, 2025

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

Copy link

vercel bot commented Feb 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview Feb 13, 2025 11:45pm

Copy link
Collaborator

@jtran jtran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😃

Looks like numeric negation is just about the only thing that propagates the type, but this is exciting!

@nrc
Copy link
Contributor Author

nrc commented Feb 13, 2025

😃

Looks like numeric negation is just about the only thing that propagates the type, but this is exciting!

There's a bit more than that - I spiked out some of the propagation between numbers and geometry too, but yeah there's a lot to do still

Signed-off-by: Nick Cameron <nrc@ncameron.org>
@nrc nrc merged commit 8c5662e into main Feb 14, 2025
35 checks passed
@nrc nrc deleted the nrc-num-ty branch February 14, 2025 00:03
Copy link

codecov bot commented Feb 14, 2025

Codecov Report

Attention: Patch coverage is 89.01734% with 19 lines in your changes missing coverage. Please review.

Project coverage is 85.85%. Comparing base (5d02a27) to head (10cb4df).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/wasm-lib/kcl/src/execution/kcl_value.rs 80.32% 12 Missing ⚠️
src/wasm-lib/kcl/src/std/args.rs 86.95% 6 Missing ⚠️
src/wasm-lib/kcl/src/execution/exec_ast.rs 97.22% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5380      +/-   ##
==========================================
+ Coverage   85.84%   85.85%   +0.01%     
==========================================
  Files          94       94              
  Lines       34506    34639     +133     
==========================================
+ Hits        29622    29741     +119     
- Misses       4884     4898      +14     
Flag Coverage Δ
wasm-lib 85.85% <89.01%> (+0.01%) ⬆️

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.

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.

2 participants