Skip to content

Conversation

@juliohm
Copy link
Member

@juliohm juliohm commented Oct 30, 2025

Minor refactor to clean things up before further work.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 30, 2025

Benchmark Results (Julia v1)

Time benchmarks
master 3c5709a... master / 3c5709a...
clipping/SutherlandHodgman 2.62 ± 0.28 μs 2.65 ± 0.27 μs 0.992 ± 0.15
discretization/simplexify 24 ± 4 ms 23.5 ± 4.2 ms 1.02 ± 0.25
intersection/ray-triangle 0.05 ± 0.001 μs 0.06 ± 0.01 μs 0.833 ± 0.14
sideof/ring/large 6.84 ± 0.019 μs 6.84 ± 0.01 μs 1 ± 0.0031
sideof/ring/small 0.06 ± 0 μs 0.06 ± 0 μs 1 ± 0
topology/half-edge 2.83 ± 0.25 ms 2.86 ± 0.25 ms 0.989 ± 0.12
winding/mesh 0.0411 ± 0.0032 s 0.0408 ± 0.0031 s 1.01 ± 0.11
time_to_load 1.5 ± 0.018 s 1.52 ± 0.028 s 0.989 ± 0.022
Memory benchmarks
master 3c5709a... master / 3c5709a...
clipping/SutherlandHodgman 0.064 k allocs: 5.55 kB 0.064 k allocs: 5.55 kB 1
discretization/simplexify 0.321 M allocs: 21.7 MB 0.321 M allocs: 21.7 MB 1
intersection/ray-triangle 0 allocs: 0 B 0 allocs: 0 B
sideof/ring/large 0 allocs: 0 B 0 allocs: 0 B
sideof/ring/small 0 allocs: 0 B 0 allocs: 0 B
topology/half-edge 25.9 k allocs: 3.17 MB 25.9 k allocs: 3.17 MB 1
winding/mesh 0.326 M allocs: 22.9 MB 0.326 M allocs: 22.9 MB 1
time_to_load 0.145 k allocs: 11 kB 0.145 k allocs: 11 kB 1

@github-actions
Copy link
Contributor

github-actions bot commented Oct 30, 2025

Benchmark Results (Julia vlts)

Time benchmarks
master 3c5709a... master / 3c5709a...
clipping/SutherlandHodgman 3.69 ± 0.14 μs 3.68 ± 0.15 μs 1 ± 0.056
discretization/simplexify 26.1 ± 1.8 ms 25.3 ± 1.9 ms 1.03 ± 0.11
intersection/ray-triangle 0.05 ± 0.01 μs 0.05 ± 0.01 μs 1 ± 0.28
sideof/ring/large 6.53 ± 0.01 μs 6.53 ± 0.01 μs 1 ± 0.0022
sideof/ring/small 0.05 ± 0.001 μs 0.05 ± 0.001 μs 1 ± 0.028
topology/half-edge 2.72 ± 0.048 ms 2.7 ± 0.038 ms 1 ± 0.023
winding/mesh 0.0415 ± 0.0017 s 0.0408 ± 0.0021 s 1.02 ± 0.067
time_to_load 1.5 ± 0.051 s 1.49 ± 0.032 s 1.01 ± 0.04
Memory benchmarks
master 3c5709a... master / 3c5709a...
clipping/SutherlandHodgman 0.053 k allocs: 4.97 kB 0.053 k allocs: 4.97 kB 1
discretization/simplexify 0.226 M allocs: 21.8 MB 0.226 M allocs: 21.8 MB 1
intersection/ray-triangle 0 allocs: 0 B 0 allocs: 0 B
sideof/ring/large 0 allocs: 0 B 0 allocs: 0 B
sideof/ring/small 0 allocs: 0 B 0 allocs: 0 B
topology/half-edge 18.1 k allocs: 2.92 MB 18.1 k allocs: 2.92 MB 1
winding/mesh 0.231 M allocs: 23 MB 0.231 M allocs: 23 MB 1
time_to_load 0.153 k allocs: 14.5 kB 0.153 k allocs: 14.5 kB 1

@juliohm juliohm requested a review from Copilot October 30, 2025 21:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the unit handling system by replacing the addunit function with more focused aslen and aslentype functions. The changes improve clarity and consistency in how length units are added to dimensionless numbers throughout the codebase.

  • Replaces addunit(x, u"m") with aslen(x) for adding meter units to numbers
  • Replaces addunit(x, u"m") with aslen.(x) for collections/tuples
  • Updates aslentype function with simplified error message

Reviewed Changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/units.jl Refactored addunit into aslen and aslentype functions with clearer naming and simplified error messages
src/vectors.jl Updated Vec constructor to use aslen instead of addunit
src/transforms/*.jl Updated transform constructors to use aslen
src/simplification/*.jl Updated simplification method constructors to use aslen
src/sampling/*.jl Updated sampling method constructors to use aslen
src/partitioning/*.jl Updated partitioning method constructors to use aslen
src/neighborhoods/metricball.jl Updated MetricBall constructors to use aslen
src/geometries/primitives/*.jl Updated primitive geometry constructors to use aslen
src/domains/trajecs.jl Updated trajectory constructors to use aslen
src/discretization/maxlength.jl Updated discretization method constructors to use aslen

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Oct 30, 2025

Codecov Report

❌ Patch coverage is 90.90909% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.90%. Comparing base (afe6694) to head (3c5709a).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/units.jl 66.66% 2 Missing ⚠️
src/partitioning/plane.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1263      +/-   ##
==========================================
- Coverage   87.90%   87.90%   -0.01%     
==========================================
  Files         197      197              
  Lines        6241     6240       -1     
==========================================
- Hits         5486     5485       -1     
  Misses        755      755              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@juliohm juliohm merged commit d182dcf into master Oct 30, 2025
24 checks passed
@juliohm juliohm deleted the aslen-refactor branch October 30, 2025 22:11
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