Skip to content
Snippets Groups Projects

[LPD] [Correct] Fix mistakes in parallel-gain non-combining mode

Merged Thomas Kluyver requested to merge fix/lpd-pgain-nocombine-typo into master
1 unresolved thread

My mistake. I'm running this now and the code has already passed the point it failed before.

@hammerd @schmidtp

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
501 501 " # Replicate corrected cell and pulse IDs from high gain to other gains.\n",
502 502 " tmp_cell = np.zeros_like(in_cell)\n",
503 503 " tmp_pulse = np.zeros_like(in_pulse)\n",
504 " sel = np.zeros_like(in_cell)\n",
504 " sel = np.zeros_like(in_cell, dtype=np.bool_)\n",
505 505 "\n",
506 506 " cursor_in = cursor_out = 0\n",
507 " for afc in actual_frame_count:\n",
507 " for afc in actual_frame_counts:\n",
508 508 " for gg in range(3):\n",
509 509 " tmp_cell[cursor_out : cursor_out+afc] = in_cell[cursor_in : cursor_in+afc]\n",
510 510 " tmp_pulse[cursor_out : cursor_out+afc] = in_pulse[cursor_in : cursor_in+afc]\n",
511 511 " sel[cursor_out : cursor_out+afc] = 1\n",
  • Hmm, does dtype=bool yield an object array nowadays?

    Original comment: Use True here to make it clearer it's a mask?

  • No, dtype=bool works the same, giving you an array of numpy booleans. I wanted to write that more explicitly, but I don't mind if you prefer dtype=bool. :shrug:

    Good point regarding True.

  • changed this line in version 3 of the diff

  • Thanks! I don't mind either type, but couldn't fully grasp the difference from the docs. What I found though:

    Introduce numpy.bool as the new canonical name for NumPy’s boolean dtype, and make numpy.bool_ an alias to it. Note that until NumPy 1.24, np.bool was an alias to Python’s builtin bool. The new name helps with array API standard compatibility and is a more intuitive name.

    So np.bool_ seems to be future-proof.

    Edited by Philipp Schmidt
  • Please register or sign in to reply
  • added 1 commit

    • d05479b2 - Use True in assignment to mask for clarity

    Compare with previous version

  • Thomas Kluyver mentioned in commit 90db1d36

    mentioned in commit 90db1d36

  • Philipp Schmidt changed milestone to %3.15.5

    changed milestone to %3.15.5

  • Please register or sign in to reply
    Loading