Skip to content

fix: map flat fragments to dense columns in the given fragment type order - #471

Open
boopthesnoot wants to merge 1 commit into
mainfrom
fix/dense-column-order
Open

boopthesnoot wants to merge 1 commit into
mainfrom
fix/dense-column-order

Conversation

@boopthesnoot

Copy link
Copy Markdown
Contributor

Motivation

create_dense_matrices (and so SpecLibFlat.calc_dense_fragments and to_speclib_base) builds the dense matrices with columns in the order of charged_frag_types, but _calc_column_indices numbered the columns in sort_charged_frag_types order. With an unsorted list such as ["b_z1", "y_z1", "b_z2", "y_z2"], a b_z2 fragment was written into the y_z1 column and a y_z1 fragment into the b_z2 column. Sorted lists, as get_charged_frag_types returns them, were not affected.

Change

_calc_column_indices maps each fragment to its column in the given order. test_speclib_base_to_flat_conversion now also runs with the dense columns in reverse order. That case fails on main and passes with this change.

…rder

create_dense_matrices builds its matrices with the columns in the order of
charged_frag_types, but _calc_column_indices numbered the columns in
sort_charged_frag_types order. For an unsorted list such as
["b_z1", "y_z1", "b_z2", "y_z2"], a b_z2 fragment was written into the y_z1
column. Sorted lists, as get_charged_frag_types returns, were not affected.

This branch has not been deployed

No deployments
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.

1 participant