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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

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.

help="Compact detector file to use",
type=str,
default=fspath(
Path(environ["k4geo_DIR"]) / "ILD" / "compact" / "ILD_sl5_v02" / "ILD_l5_v02.xml"
Copy link
Contributor

Choose a reason for hiding this comment

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

This technically changes the default geometry from IDEA_o1_v02.xml to an ILD geometry. However, it also looks like the previous version didn't work without editing the file?

Technically this should be a positional (required) argument, since the script can't do anything useful without it. However, at this point --compactFile is also pretty much a convention for several scripts.

For me these changes are OK.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't care which detector is the default as long as the path is absolute or relative to $K4GEO or $k4geo_DIR. Originally the path was relative and Daniel and I had trouble getting it to work. I think this should work out of the box without assuming a current working dir

Copy link
Contributor

Choose a reason for hiding this comment

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

Originally which path was relative?

Copy link
Contributor

@tmadlener tmadlener Oct 16, 2024

Choose a reason for hiding this comment

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

The path to the IDEA_o1_v02.xml compact file.

edit: I.e. the script only work if called in the directory where that file was, IIUC.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh, ok, the detector file was just hard coded. I guess the compactFile will accept relative or absolute paths.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, exactly. And yes, absolute and relative paths will work. It is directly passed to the GeoSvc.detectors.

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

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