Skip to content

[FEATURE] return offset/mapping of 'recalculate_id' merge #154

@vincentkoppen

Description

@vincentkoppen

Currently if you merge two grids with "recalculate_ids" as an option, you have no clue how the ids are mapped.
This information could be useful if you have extra metadata on these ids for example, so that you can also update the references there.

Possible solutions:

  • A a return to the merge function:
    • return the offset that is used for the ids?
    • Return a mapping from old -> new as return value
  • Expose _increment_grid_ids_by_offset as a separate function on the grid. This way the user has the option to perform the action manually (with a known offset).
other_grid.increment_grid_ids_by_offset(10)
grid.merge(other_grid, mode="keep_ids")
  • Expose an variable id_offset (or similar) that indicates the offset that is used within the recalculate_ids.
    This way the user knows that all ids are updated by that value and make their own mapping if necessary

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions