Description of the issue
PR #903 introduced the selected_atoms argument. However, except from a conditional, the selected atoms are not not actually used in the function (for instance to slice output_block_types), so it's unclear to me the purpose of this and what the corresponding test is checking.
The fix should be simple, but I wanted to bring this to the attention of @frostedoyster and @Luthaf so you can check MD side if things are working as expected.