Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurability for material plots #392

Merged
merged 13 commits into from
Oct 25, 2024

Conversation

Victor-Schwan
Copy link
Contributor

@Victor-Schwan Victor-Schwan commented Sep 17, 2024

BEGINRELEASENOTES

  • formatting and refactorization
  • material_plots_2D.py:
    • angleDef is a choice parameter + thetaRad choice added
    • outputDir option added
  • material_scan_2d.py:
    • argParser added (compactFile,outputFileBase, angleDef)
    • outputDir option added

ENDRELEASENOTES

@Victor-Schwan Victor-Schwan force-pushed the PR_utils_config branch 2 times, most recently from 0c8bf66 to f2cd8da Compare September 18, 2024 07:54
@Victor-Schwan Victor-Schwan marked this pull request as ready for review September 18, 2024 07:58
@Victor-Schwan Victor-Schwan force-pushed the PR_utils_config branch 2 times, most recently from b0f3ac7 to 62be7fa Compare September 25, 2024 01:52
@tmadlener
Copy link
Contributor

@andresailer
Copy link
Contributor

these are the changes with the formatting factored out

Now can we have those changes on top of the original style 🤪

@tmadlener
Copy link
Contributor

I am afraid that is not something I can do in 5 minutes ;)

Should we format all python sources and make a PR that we can then ignore in blames?

@andresailer
Copy link
Contributor

Should we format all python sources and make a PR that we can then ignore in blames?

But something that reduces the amount of changes. Because #396 is going to be painful enough to merge.

utils/material_plots_2D.py Outdated Show resolved Hide resolved
utils/material_plots_2D.py Outdated Show resolved Hide resolved
utils/material_plots_2D.py Outdated Show resolved Hide resolved
@tmadlener
Copy link
Contributor

Rebased this after #398 has been merged. Please check again that I didn't mess up in the process.

--inputFile is now available as well as the original --fname which now simply has inputFile as destination.

@tmadlener
Copy link
Contributor

Thanks for checking.

Copy link
Contributor

@tmadlener tmadlener left a comment

Choose a reason for hiding this comment

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

I am OK with this. Anything else from your side @andresailer?

@armin-ilg
Copy link
Contributor

Thank you for the work @Victor-Schwan, it works fine for me! I think it would be nice to apply the same improvements to the 1D mat. budget scripts (in the same place) and update the scripts/check_material_budget.sh script accordingly. What do you think @andresailer @tmadlener ?

@tmadlener
Copy link
Contributor

In the long run, I think harmonizing all of these scripts would be a good idea. Whether we do it in this PR or in follow up PRs depends a bit on the availability of @Victor-Schwan. I the bash script does not work any longer at the moment, we should fix it. @armin-ilg do you have some estimates how long this runs, and whether we could put this into a CI workflow (maybe in a slightly slimmed down version)?

@Victor-Schwan
Copy link
Contributor Author

I agree that it is a good idea to harmonize as much as possible. I'd prefer to do the harmonization in another PR. In principle, one could also turn the scripts in the scripts folder into python scripts to have the same --compactFile interface (keeping a bash script calling them not to change the ui). Is the linked script affected by the changes? The main change is the different default detector but the script forwards a compact file anyway...

@armin-ilg
Copy link
Contributor

In the long run, I think harmonizing all of these scripts would be a good idea. Whether we do it in this PR or in follow up PRs depends a bit on the availability of @Victor-Schwan. I the bash script does not work any longer at the moment, we should fix it. @armin-ilg do you have some estimates how long this runs, and whether we could put this into a CI workflow (maybe in a slightly slimmed down version)?

On lxplus the plots take O(5) minutes (running all angle defs), so that could definitely go into a CI workflow

@Victor-Schwan
Copy link
Contributor Author

Should this script be added to a CI workflow in this PR or in another one?
Assuming that the 1D mat. budget scripts will be changed in another PR, is an update of the https://github.com/key4hep/k4geo/blob/main/scripts/check_material_budget.sh script required @armin-ilg?

@armin-ilg
Copy link
Contributor

Should this script be added to a CI workflow in this PR or in another one? Assuming that the 1D mat. budget scripts will be changed in another PR, is an update of the https://github.com/key4hep/k4geo/blob/main/scripts/check_material_budget.sh script required @armin-ilg?

I was wrong, sorry, the bash script still works fine, no change needed.

Let me know if I shall make a CI workflow at some point @tmadlener (will not be able to do it soon though)

@tmadlener
Copy link
Contributor

@Victor-Schwan can you estimate how much work it would be to simply run the bash script in CI? If it's only a few more lines, I would appreciate it if it's added in this PR, otherwise, I am also fine with a follow up.

@Victor-Schwan
Copy link
Contributor Author

@Victor-Schwan can you estimate how much work it would be to simply run the bash script in CI? If it's only a few more lines, I would appreciate it if it's added in this PR, otherwise, I am also fine with a follow up.

I took another look at the script and noticed two things:

  1. According to a comment, for over a year it only runs on the stable key4hep release (https://github.com/key4hep/k4geo/blob/main/scripts/check_material_budget.sh#L57)
  2. In line 7, IDEA is hardcoded in a name (https://github.com/key4hep/k4geo/blob/main/scripts/check_material_budget.sh#L7). In my opinion, in the utils, scripts, etc, the detector choice should not be hardcoded/assumed; such a name can confuse.

I only use the nightlies for ILD@FCCee, hence, I cannot test the script easily with my detectors (I have never run it before). I suggest fixing the script and adding the CI in another PR

@Victor-Schwan
Copy link
Contributor Author

Should this script be added to a CI workflow in this PR or in another one? Assuming that the 1D mat. budget scripts will be changed in another PR, is an update of the https://github.com/key4hep/k4geo/blob/main/scripts/check_material_budget.sh script required @armin-ilg?

I was wrong, sorry, the bash script still works fine, no change needed.

Let me know if I shall make a CI workflow at some point @tmadlener (will not be able to do it soon though)

@armin-ilg Am I right in assuming that there is nothing left to stop you from approving this PR?

Copy link
Contributor

@armin-ilg armin-ilg left a comment

Choose a reason for hiding this comment

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

All fine with me, thanks!

@tmadlener tmadlener merged commit 1f414da into key4hep:main Oct 25, 2024
6 checks passed
@Victor-Schwan Victor-Schwan deleted the PR_utils_config branch October 28, 2024 11:00
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.

4 participants