Skip to content
Snippets Groups Projects

Allow categorical variables in smpdf plots

Merged Emanuele Roberto Nocera requested to merge smpdfcategorical into master

Created by: Zaharid

Fix crash in plot_smpdf when the variable in the color axis is categorical, such as for the W and Z total cross sections. Encode the categorical variables as integers and use an appropriate color map to display them.

The implementation feels a bit untidy, with some variables acting at a distance, but there doesn't seem to be an easy better way considering that we'd like the color bar to be the same for all figures.

Also, the fact that np.unique sorts the output may not be what we want. See https://github.com/numpy/numpy/issues/8621. But don't want to make it more complicated.

Merge request reports

Approval is optional

Merged by Emanuele Roberto NoceraEmanuele Roberto Nocera 1 year ago (Jun 19, 2023 2:09pm UTC)

Merge details

  • Changes merged into master with 6089608f.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Emanuele Roberto Nocera
  • Created by: RoyStegeman

    Review: Commented

    np.unique seems fine to me. At the moment I don't imagine the order matters very much so as long as np.unique keeps things consistent I couldn't care less.

    Did you mean to have a different figure for the Ws and Z?

    Also, there are double parentheses due to group_label and the title both adding them.

  • Emanuele Roberto Nocera
  • Created by: scarlehoff

    Review: Commented

    Can this be merged?

    I guess it would be good to add another smpdf test in which the categorical branch is used, maybe using one of the datasets in your report @Zaharid ? ATLAS_WZ_TOT_13TEV for instance

  • Created by: RoyStegeman

    Review: Changes requested

    There are different figures for only W and only Z but both figures contain labels for W and Z.

    There are double parentheses due to group_label and the title both adding them.

  • Emanuele Roberto Nocera
  • Emanuele Roberto Nocera
  • Emanuele Roberto Nocera
  • 891 891
    892 892 plotting_var = info.get_xcol(table)
  • Created by: RoyStegeman

    Review: Approved

    Was this just waiting on a review or is there another reason why this hasn't been merged?

    Could you run black and isort?

  • Created by: RoyStegeman

    Review: Changes requested

    Oh right, the tests...

  • Created by: Zaharid

    @scarlehoff @RoyStegeman I don't know what the current test failure with the evolution is, but don't believe it matters for this. Please merge this.

  • Created by: RoyStegeman

    Review: Approved

    I'm happy with this PR. I think the error is because our tests are not compatible with the eko version and I believe this is fixed in #1754. @scarlehoff can you confirm?

  • Merged by: Zaharid at 2023-06-19 14:09:08 UTC

  • merged manually

  • Please register or sign in to reply
    Loading