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

626 idea generate mc summary table #634

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nbassler
Copy link
Member

Proposal for MC summary, see discussion in #626

Comments?

@nbassler nbassler linked an issue Apr 19, 2023 that may be closed by this pull request
@reviewpad
Copy link
Contributor

reviewpad bot commented Apr 19, 2023

AI-Generated Summary: This pull request consists of two patches:

  1. [PATCH 1/2] introduces a feature for adding total times for all estimators, with modifications in pymchelper/estimator.py, pymchelper/input_output.py, pymchelper/readers/shieldhit/binary_spec.py, and pymchelper/readers/shieldhit/reader_bdo2019.py. The changes involve initializing additional variables to track run time, updating the values while averaging with nan, and incorporating the total number of primaries and run times in the fromfilelist method.

  2. [PATCH 2/2] adds a Monte Carlo (MC) summary table based on Sechopoulos et al. (2018), with output in markdown format. The changes affect pymchelper/input_output.py, pymchelper/run.py, pymchelper/writers/common.py, and a newly created file, pymchelper/writers/mcsum.py. In addition to adding the MCSumWriter class, the patch connects the new converter (mcsum) to the writer in common.py and introduces a new parser for mcsum in run.py.

@reviewpad reviewpad bot added small Pull request is small waiting-for-review labels Apr 19, 2023
@reviewpad
Copy link
Contributor

reviewpad bot commented Apr 19, 2023

Reviewpad Report

‼️ Errors

  • Unconventional commit detected: 'suggestion for addidn total times for all estimators' (549b1d0)
  • Unconventional commit detected: 'suggestion for MC-summary table, output in markdown format.' (d2c8e1a)
  • Unconventional title detected: '626 idea generate mc summary table' illegal '6' character in commit message type: col=00

logger = logging.getLogger(__name__)


class MCSumWriter:
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need a new writer for that functionality ?
Could it be part of inspect command ?
Like:
convertmc inspect blabla.bdo --summary
or
convertmc inspect --many "*.bdo" --summary
?

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought of additional options for what format you would like to have. Also it may collide with inspect -d option, and may get more complex if also the scoring field will be filled out.

Other questions: we could hardcode also SH references, for convenience and make reference list at bottom.

Copy link
Contributor

Choose a reason for hiding this comment

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

pymchelper also can read Fluka binary files, so SH12A references would need to be saved in a smarter way.

@grzanka grzanka force-pushed the 626-idea-generate-mc-summary-table branch from 36517bc to d2c8e1a Compare April 20, 2023 12:09
@reviewpad
Copy link
Contributor

reviewpad bot commented Apr 20, 2023

AI-Generated Summary: This pull request introduces new features to record total run times and primary events for all estimators, as well as a new output format as an MC-summary table. It updates the estimator.py, input_output.py, binary_spec.py, and reader_bdo2019.py files to store various run times and primary event counts. Additionally, it includes a new "mcsum" output format that displays the MC summary table in markdown format, following the example of Sechopoulos et al (2018).

@grzanka
Copy link
Contributor

grzanka commented Apr 20, 2023

@nbassler can you add some tests similar to https://github.com/DataMedSci/pymchelper/blob/master/tests/test_hdf.py ?

Resolved issues in the following files with DeepSource Autofix:
1. pymchelper/estimator.py
2. pymchelper/writers/mcsum.py
@reviewpad
Copy link
Contributor

reviewpad bot commented Apr 20, 2023

AI-Generated Summary: This pull request consists of 3 patches that make the following changes:

  1. Add total times support for all estimators: This patch introduces new attributes for estimator class, such as run_time, run_time_sim, total_number_of_primaries, total_run_time, and total_run_time_sim, and updates other related methods to include these changes. It also modifies the reader_bdo2019.py file to set total_number_of_primaries, total_run_time, and total_run_time_sim for the estimator.

  2. Suggestion for MC-summary table, output in markdown format: This patch adds a new MCSumWriter class in mcsum.py file, which generates an MC summary table in markdown format including code version, number of histories, timing, and other fields. It also updates the run.py and common.py files to include mcsum as one of the available converters.

  3. Autofix issues in 2 files: This patch automatically refactors small issues in estimator.py and mcsum.py files using DeepSource Autofix, such as removing unnecessary "elif" statements and making "write" method in MCSumWriter a static method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
small Pull request is small waiting-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

idea: generate MC summary table
2 participants