guppylang icon indicating copy to clipboard operation
guppylang copied to clipboard

refactor!: Store function argument names in `FuncInput`

Open mark-koch opened this issue 2 months ago • 5 comments

It't a lot nicer to have the name of function arguments in the same object as the type an flags instead of the separate list we have at the moment - not adding the name was more of an oversight when we introduced FuncInput 😅

BREAKING CHANGE: FunctionType constructor no longer accepts the input_names argument. Instead, input names should be provided as an optional argument to FuncInput

mark-koch avatar Oct 03 '25 14:10 mark-koch

This PR contains breaking changes to the public Python API.

Breaking changes summary
guppylang-internals/src/guppylang_internals/tys/ty.py:417: FunctionType.__init__(input_names):
Parameter was removed

guppylang-internals/src/guppylang_internals/tys/ty.py:417: FunctionType.__init__(params):
Positional parameter was moved
Details: position: from 4 to 3 (-1)

guppylang-internals/src/guppylang_internals/tys/ty.py:417: FunctionType.__init__(comptime_args):
Positional parameter was moved
Details: position: from 5 to 4 (-1)

guppylang-internals/src/guppylang_internals/tys/ty.py:417: FunctionType.__init__(unitary_flags):
Positional parameter was moved
Details: position: from 6 to 5 (-1)


hugrbot avatar Oct 03 '25 14:10 hugrbot

🐰 Bencher Report

Branchrefactor/input-names
TestbedLinux
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
microseconds (µs)
(Result Δ%)
Upper Boundary
microseconds (µs)
(Limit %)
tests/benchmarks/test_big_array.py::test_big_array_check📈 view plot
🚷 view threshold
686,253.47 µs
(-5.94%)Baseline: 729,590.29 µs
766,069.80 µs
(89.58%)
tests/benchmarks/test_big_array.py::test_big_array_compile📈 view plot
🚷 view threshold
1,627,991.41 µs
(+4.22%)Baseline: 1,562,011.50 µs
1,640,112.08 µs
(99.26%)
tests/benchmarks/test_big_array.py::test_big_array_executable📈 view plot
🚷 view threshold
7,277,447.22 µs
(+2.10%)Baseline: 7,127,758.27 µs
7,484,146.19 µs
(97.24%)
tests/benchmarks/test_ctrl_flow.py::test_many_ctrl_flow_check📈 view plot
🚷 view threshold
49,380.19 µs
(-32.21%)Baseline: 72,844.09 µs
76,486.29 µs
(64.56%)
tests/benchmarks/test_ctrl_flow.py::test_many_ctrl_flow_compile📈 view plot
🚷 view threshold
87,273.57 µs
(+1.16%)Baseline: 86,272.51 µs
90,586.13 µs
(96.34%)
tests/benchmarks/test_ctrl_flow.py::test_many_ctrl_flow_executable📈 view plot
🚷 view threshold
591,656.85 µs
(-0.15%)Baseline: 592,556.58 µs
622,184.41 µs
(95.09%)
tests/benchmarks/test_prelude.py::test_import_guppy📈 view plot
🚷 view threshold
48.51 µs
(-1.56%)Baseline: 49.28 µs
51.75 µs
(93.75%)
🐰 View full continuous benchmarking report in Bencher

github-actions[bot] avatar Oct 03 '25 14:10 github-actions[bot]

🐰 Bencher Report

Branchrefactor/input-names
TestbedLinux
Click to view all benchmark results
Benchmarkhugr_bytesBenchmark Result
bytes x 1e3
(Result Δ%)
Upper Boundary
bytes x 1e3
(Limit %)
hugr_nodesBenchmark Result
nodes
(Result Δ%)
Upper Boundary
nodes
(Limit %)
tests/benchmarks/test_big_array.py::test_big_array_compile📈 view plot
🚷 view threshold
143.67 x 1e3
(0.00%)Baseline: 143.67 x 1e3
145.10 x 1e3
(99.01%)
📈 view plot
🚷 view threshold
6,590.00
(0.00%)Baseline: 6,590.00
6,655.90
(99.01%)
tests/benchmarks/test_ctrl_flow.py::test_many_ctrl_flow_compile📈 view plot
🚷 view threshold
21.64 x 1e3
(0.00%)Baseline: 21.64 x 1e3
21.86 x 1e3
(99.01%)
📈 view plot
🚷 view threshold
606.00
(0.00%)Baseline: 606.00
612.06
(99.01%)
🐰 View full continuous benchmarking report in Bencher

github-actions[bot] avatar Oct 03 '25 14:10 github-actions[bot]

Codecov Report

:x: Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review. :white_check_mark: Project coverage is 93.42%. Comparing base (54dc200) to head (627627a).

Files with missing lines Patch % Lines
...pylang-internals/src/guppylang_internals/tys/ty.py 92.30% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1286      +/-   ##
==========================================
- Coverage   93.42%   93.42%   -0.01%     
==========================================
  Files         125      125              
  Lines       11290    11298       +8     
==========================================
+ Hits        10548    10555       +7     
- Misses        742      743       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov-commenter avatar Oct 03 '25 14:10 codecov-commenter

Apologies, totally forgot about this PR 😅

mark-koch avatar Oct 28 '25 17:10 mark-koch