Skip to content

Add float helpers#167

Merged
Schamper merged 3 commits into
mainfrom
add-float-helpers
Jul 20, 2026
Merged

Add float helpers#167
Schamper merged 3 commits into
mainfrom
add-float-helpers

Conversation

@Schamper

Copy link
Copy Markdown
Member

Closes #159

I couldn't really think of a good name for the float packer, so I just called it pf16, pf32 and pf64.

@Schamper
Schamper requested a review from Miauwkeru July 16, 2026 00:54
@codspeed-hq

codspeed-hq Bot commented Jul 16, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 14 untouched benchmarks


Comparing add-float-helpers (b9b2de9) with main (32253fe)

Open in CodSpeed

@Schamper
Schamper force-pushed the add-float-helpers branch from 444f67e to 71517d0 Compare July 16, 2026 09:30
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (32253fe) to head (b9b2de9).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
dissect/cstruct/util.py 0.00% 23 Missing ⚠️
dissect/cstruct/compiler.py 0.00% 1 Missing ⚠️
dissect/cstruct/types/base.py 0.00% 1 Missing ⚠️
dissect/cstruct/types/packed.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main    #167   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files         22      22           
  Lines       2785    2798   +13     
=====================================
- Misses      2785    2798   +13     
Flag Coverage Δ
unittests 0.00% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

Comment thread dissect/cstruct/util.py
return pack(value, 64, endian)


def pf16(value: float, endian: AllowedEndianness = "little") -> bytes:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

shouldn't these pf# and f# functions also be exposed in dissect/cstruct/__init__.py just like the p# and u# functions?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@copilot add this and make sure linting passes

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Done — pf16, pf32, pf64, f16, f32, f64 are now exported from dissect/cstruct/__init__.py (both in the import block and __all__). Linting passes. Commit: Expose pf16, pf32, pf64, f16, f32, f64 in __init__.py.

@Schamper
Schamper requested a review from Miauwkeru July 20, 2026 12:09
@Schamper
Schamper merged commit 3032ad7 into main Jul 20, 2026
21 checks passed
@Schamper
Schamper deleted the add-float-helpers branch July 20, 2026 13:29
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.

Add float and double helper functions

3 participants