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

ref: python cleanup #914

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

niermann999
Copy link
Contributor

@niermann999 niermann999 commented Jan 15, 2025

Cleanup python plotting code in preparation for benchmark plots:

  • fix formatting
  • add the CLI arguments using dedicated functions
  • add new data tuples to pass options to plot factory
  • deduplicate plot creation the track parameters plotter
  • put some recurring code in the pyplot_factory into internal methods to be reused

Fixes a number of small bugs:

  • momentum range option parsing in python
  • correct normalization of ray direction when issued by track generator
  • correct momentum range string in output data file names (reading and writing)

@niermann999 niermann999 added refactor refactoring the current codes priority: low Low priority labels Jan 15, 2025
@niermann999
Copy link
Contributor Author

niermann999 commented Jan 15, 2025

This has been factored out from #909 and can be merged independently of #904

@niermann999 niermann999 force-pushed the ref-python-cleanup branch 11 times, most recently from 2fd05f0 to 355f7b1 Compare January 17, 2025 16:26
@niermann999 niermann999 added bug Something isn't working priority: high high priority and removed priority: low Low priority labels Jan 17, 2025
@niermann999 niermann999 force-pushed the ref-python-cleanup branch 3 times, most recently from bea627d to 737ad0e Compare January 20, 2025 14:29
@niermann999
Copy link
Contributor Author

With these fixes the navigation and material validation works correctly again

Copy link

Copy link
Member

@stephenswat stephenswat left a comment

Choose a reason for hiding this comment

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

Didn't go through it in too much depth but looks good.

"_" +
std::to_string(
std::ceil(10. * static_cast<double>(pT_range[1])) / 10.) +
"_GeV";
Copy link
Member

Choose a reason for hiding this comment

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

Is it intended that this will produce very slightly different files names than before?


const auto data_path{
std::filesystem::path{m_cfg.track_param_file()}.parent_path()};
const auto truth_trk_path{data_path / (prefix + "truth_track_params_" +
mometum_str + "GeV.csv")};
momentum_str + ".csv")};
Copy link
Member

Choose a reason for hiding this comment

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

Same comment as above.

@@ -19,7 +19,7 @@


def __main__():
# ----------------------------------------------------------------arg parsing
# ---------------------------------------------------------------arg parsing
Copy link
Member

Choose a reason for hiding this comment

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

Any reason for these changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: high high priority refactor refactoring the current codes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants