Accept raw allocation sequences and streamline the public API#46
Merged
Conversation
Let every public entry point (allocate, validate_allocation, save_allocation, plot_allocation) accept a raw Sequence[Allocation] in addition to System/Memory/Pool, wrapped via the new Pool.from_allocations; allocate returns the placed allocations as a tuple in input order. Pool.allocate now restores the pool's input order after allocator-internal reordering so positions keep corresponding to the request, and checks the returned set by length as well as ids. Rename Memory.capacity to Memory.size (validation message follows), and rename the analysis functions pressure/pressure_per_allocation to antichain_pressure/antichain_pressure_per_allocation, keeping the old names exported as aliases for the canonical default metric. Drop the keyword-only markers from allocator constructors, Timer, and plot_allocation so the common single-argument calls read naturally. Add any_allocated across Pool/Memory/System and use it in io. Add nanobind to the dev dependency group.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Let every public entry point (allocate, validate_allocation,
save_allocation, plot_allocation) accept a raw Sequence[Allocation] in
addition to System/Memory/Pool, wrapped via the new
Pool.from_allocations; allocate returns the placed allocations as a
tuple in input order. Pool.allocate now restores the pool's input order
after allocator-internal reordering so positions keep corresponding to
the request, and checks the returned set by length as well as ids.
Rename Memory.capacity to Memory.size (validation message follows), and
rename the analysis functions pressure/pressure_per_allocation to
antichain_pressure/antichain_pressure_per_allocation, keeping the old
names exported as aliases for the canonical default metric.
Drop the keyword-only markers from allocator constructors, Timer, and
plot_allocation so the common single-argument calls read naturally. Add
any_allocated across Pool/Memory/System and use it in io. Add nanobind
to the dev dependency group.