Skip to content

Modular plotting - #11

Merged
maadcoen merged 4 commits into
masterfrom
modulare_plotting
Jun 24, 2024
Merged

maadcoen merged 4 commits into
masterfrom
modulare_plotting

Conversation

@maadcoen

Copy link
Copy Markdown

Made some changes to enhance reusability of some plotting code.

  • adding the option to pass an existing figure and axes to plot_all. This allows to have multiple axes in one plot and apply plot_all to one of them
  • breaking down plot_2d into several subroutines similar as is done for the 1d plotting

@maadcoen
maadcoen force-pushed the modulare_plotting branch from cc61c3f to d8113f8 Compare June 21, 2024 14:38
@maadcoen maadcoen mentioned this pull request Jun 21, 2024
@maadcoen maadcoen changed the title Modulare plotting Modular plotting Jun 24, 2024

@JanvanderLinden JanvanderLinden left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, looks good for me. Presumably you tested it?

From the modification of the original plot_2d function it also looks like there is no change needed for users when calling a default 2d plotting routine for now?

@maadcoen

Copy link
Copy Markdown
Author

so I tried running it and it works to make normal 2d plots. I cannot exclude problems if one tries to apply several command line options to customise the plot more, to be honest.
In principle I just reorganised the original code so that it's easier to make new 2d plots without having to copy pasting the entire plot_2d function. The only exception is the possibility to create a figure and axes externally, but that's only in addition. It doesn't change the original behaviour.

@maadcoen
maadcoen merged commit e3ef6d8 into master Jun 24, 2024
@maadcoen
maadcoen deleted the modulare_plotting branch June 24, 2024 09:06
JulesVandenbroeck added a commit that referenced this pull request Jul 9, 2024
* Draft for store parts modifiers.

* Minor corrections.

* Update upstream order.

* Add draft for markdown linting.

* Run docs linting and show errors, but don't fail ci.

* Fix docs version.

* Fix bug in CreateDatacards task when processing data datasets.

* Hotfix grid proxy fallback location in htcondor jobs.

* feat: Add error handling for invalid LHEPdfWeight values

The code changes add error handling for cases where the number of LHEPdfWeights is not equal to 101 or 103. If all LHEPdfWeights are invalid, a warning is logged and a ones array is returned for the pdf weights. If some LHEPdfWeights are invalid, an exception is raised with the details of the invalid values.

* bug fix: was trying to convert jagged arrays to numpy views

* Update upstream law.

* Hotfix lfn resolution from local resources.

* Allow columns to be skipped in 'keep_columns' definitions.

* Typos.

* De-nest and cleanup pdf.py.

* De-nest and cleanup scale.py.

* Add MANIFEST file.

* Simplify flat_np_view.

* fix issue with MergeMlEvents

* Fix tests.

* add process to lookup table only if process has a cross section

* fix inputs

* expanded api docs for `PlotMLResults`

* Fix typo in cms btag weight producer.

* Fix merging of reduced events for single-file datasets.

* final commit :)

* Improve process settings handling.

* Fix typehint.

* Doc string.

* Update upstream law.

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* Fix fill hist (#6)

Co-authored-by: Marcel Rieger <riga@users.noreply.github.com>

* Fix hist filling.

* Fix axis check.

* Draft for hist hooks and plot parts.

* sort objects when passing wildcards

* using ceil instead of int (latter creates problems for integer binning starting at 1 or above)

* .copy not defined for awkward arrays. Use ak.copy instead

* .copy not defined for awkward arrays. Use ak.copy instead (columnflow#474)

* Update columnflow/tasks/cutflow.py

Co-authored-by: Mathis Frahm <49306645+mafrahm@users.noreply.github.com>

* Update columnflow/tasks/cutflow.py

Co-authored-by: Mathis Frahm <49306645+mafrahm@users.noreply.github.com>

* Update columnflow/tasks/cutflow.py

Co-authored-by: Mathis Frahm <49306645+mafrahm@users.noreply.github.com>

* Add setup banner.

* Linting the docs :) (columnflow#476)

* update markdownlint configuration to allow specific elements and punctuation used in the README files

* linting the docs

* linting the ml docs and changing the heading structure in order to not have multiple headers

* removed unneded files (cms api was moved to a seperate folder, but old files were not removed)

* added plotting toctree for the docs

* fix sphinx warnings

* remove redundent links

* replaced link to old cf repo (uhh-cms)

* Add code coverage for test_config_util, test_task_parameters and test_plotting

* one-sentence-per-line

* local docs scan

* Enable docs linting in ci.

* Fi CI warnings.

* BUG: `tenacity` version 8.4.0 doesn't work (columnflow#475)

* Update dependencies to fix tenacity to the version 8.3.0

* Update sandboxes/cf.txt

Co-authored-by: Marcel Rieger <riga@users.noreply.github.com>

---------

Co-authored-by: Marcel Rieger <riga@users.noreply.github.com>

* Banner update.

* Verbose output in create_analysis script.

* Fix upper/lower case polyfills in create_analysis.

* Modular plotting (#11)

* make code more modular by allowing to use pre-existing figure and axes
* modularize 2d plotting function

* Cat per process plot (#12)

plot function that plots different categories for single process

* Migration matrix plot (#13)

* code to plot migrations with also purity and reco efficiency

* Safe selectionresult ghent (#10)

add checks to ensure proper event and object masks

* fixed mistakes in dz, dxy, ans etSC cuts (#17)

---------

Co-authored-by: Marcel R. <github.riga@icloud.com>
Co-authored-by: Marcel Rieger <riga@users.noreply.github.com>
Co-authored-by: Maarten De Coen <52047931+maadcoen@users.noreply.github.com>
Co-authored-by: Johanna Matthiesen <jomatthi@physnet.uni-hamburg.de>
Co-authored-by: haddadanas <hhhaaanas@gmail.com>
Co-authored-by: Anas <103462379+haddadanas@users.noreply.github.com>
Co-authored-by: maadcoen <maarten.de.coen@cern.ch>
Co-authored-by: Mathis Frahm <49306645+mafrahm@users.noreply.github.com>
Co-authored-by: Nathan Prouvost <nathan.prouvost@gmail.com>
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Mathis Frahm <mathisfrahm@gmx.de>
maadcoen added a commit that referenced this pull request Jul 31, 2024
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.

2 participants