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

new files for MCPL #658

Merged

Conversation

grzanka
Copy link
Contributor

@grzanka grzanka commented Jun 20, 2023

I've fixed the PDG codes in the 51-phsp-export branch of SHIELD-HIT12A source code. This change needs to be reflected in the testing files for pymchelper. Previously allmost all the particles were neutrons, while we expected protons.

This PR includes as well solid refactoring of tests suite (moving from unittest to pytest framework).

Concatenation for the MCPL data object was also implemented, which should enable dealing with concatenating large files using convertmc --many *.bdo

@grzanka grzanka linked an issue Jun 20, 2023 that may be closed by this pull request
@reviewpad reviewpad bot added the small Pull request is small label Jun 20, 2023
@grzanka grzanka self-assigned this Jun 20, 2023
@reviewpad reviewpad bot added medium Pull request is medium and removed small Pull request is small labels Jun 20, 2023
@grzanka
Copy link
Contributor Author

grzanka commented Jun 20, 2023

/reviewpad run

@grzanka grzanka marked this pull request as ready for review June 20, 2023 17:09
@grzanka
Copy link
Contributor Author

grzanka commented Jun 20, 2023

/reviewpad summarize

@reviewpad
Copy link
Contributor

reviewpad bot commented Jun 20, 2023

AI-Generated Summary: This pull request introduces changes in the test files and MCPL converter. The main modifications include:

  1. Updating .pre-commit-config.yaml to configure pre-commit hooks.
  2. Adding pre-commit and yapf to tests/requirements-test.txt.
  3. Updating binary file tests/res/shieldhit/phasespace/NB_mcpl.bdo and its corresponding text file tests/res/shieldhit/phasespace/NB_mcpl.txt.
  4. Changing the particle type from neutrons (2112) to protons (2212) in tests/test_mcpl.py.

Overall, the update focuses on configuring pre-commit hooks and ensuring the test files are using protons instead of neutrons as the particle.

@grzanka grzanka enabled auto-merge (squash) June 20, 2023 17:11
@grzanka grzanka requested a review from nbassler June 20, 2023 17:12
@reviewpad
Copy link
Contributor

reviewpad bot commented Jun 21, 2023

AI-Generated Summary: This pull request introduces several changes to the codebase:

  1. A new .pre-commit-config.yaml file has been added, which will allow for automatic formatting and linting of the code using pre-commit hooks from popular libraries such as trailing-whitespace, end-of-file-fixer, check-yaml, check-added-large-files, and yapf.

  2. Some type hints have been added to the pymchelper/estimator.py file to improve readability and provide better type checking.

  3. The requirements-test.txt file has been updated to include pre-commit and yapf packages to facilitate their use in the project's testing environment.

  4. Some minor updates were made to the contents of the tests/res/shieldhit/phasespace/NB_mcpl.txt, affecting PDG codes.

  5. Several adjustments have been made to the tests/test_mcpl.py file to accommodate these changes.

@reviewpad
Copy link
Contributor

reviewpad bot commented Jun 21, 2023

AI-Generated Summary: This pull request includes various updates to the codebase involving type hints, tests, binary files, requirements, pre-commit hooks, and particle data files. Key updates revolve around improving testing of phasespace BDO files, checking their properties, reading their content, generating MCPL files from them, and updating SHIELD-HIT12A particle data. Additional changes involve adding new dependencies and pre-commit hooks, modifying binary files, and improving file organization.

@reviewpad
Copy link
Contributor

reviewpad bot commented Jun 21, 2023

AI-Generated Summary: This pull request includes updates to multiple files, adding new dependencies, binary files, test data, and configuration settings. Key changes include the update of tests/requirements-test.txt to fix a missing newline and add two new dependencies, as well as a number of additions and modifications to files in the tests/res/shieldhit/phasespace directory such as new binary BDO files, new test data TXT files, and changes to existing test data. A new .pre-commit-config.yaml file has been added with a pre-commit configuration and several hooks. The tests/test_mcpl.py file received several updates, focusing on BDO file handling for testing with new fixtures, test function updates, and additional logging. An import statement for Optional from the typing module and type hints in a function signature have also been added. Finally, pytest.ini has been modified to include updated test paths and log settings.

@reviewpad
Copy link
Contributor

reviewpad bot commented Jun 21, 2023

AI-Generated Summary: This pull request introduces various changes across multiple files, including adding new binary and text files for test results in the tests/res/shieldhit/phasespace directory. It also updates the SHIELD-HIT12A version and modifies the PDG particle code in the existing test files.

In pytest.ini, the testpaths are updated, comments are added, and the logging level is set to INFO. Two new dependencies, pre-commit==3.3.3 and yapf==0.40.1, are added to tests/requirements-test.txt, along with a newline at the end.

Tests for MCPL converter have been updated, and additional tests have been added for BDO file generation and concatenation. Logging facilities have been improved in the test suite.

In the input_output.py file, error handling and logging have been enhanced, comments have been updated, and new checks have been added for concatenate normalization. Additionally, type hinting and Optional import have been introduced in multiple files.

Finally, a new .pre-commit-config.yaml file has been added with various pre-commit hooks to maintain code quality.

@reviewpad
Copy link
Contributor

reviewpad bot commented Jun 21, 2023

AI-Generated Summary: This pull request introduces various updates and additions across multiple files. Key changes include adding import statements for Optional and updating functions with type hints in estimator.py and input_output.py. Several modifications were made to the tests/test_mcpl.py, including adding new pytest fixtures, updating variable names, passing file paths as strings, and adding new test functions. The pytest.ini file has been updated to improve test discovery and logging settings.

Additionally, this PR adds new binary files in the tests/res/shieldhit/phasespace directory along with corresponding *.txt files presenting the text data from the binary files. The tests/requirements-test.txt file has been updated with new dependencies for pre-commit and yapf. A new .pre-commit-config.yaml file has been created to set up pre-commit hooks for the project.

Finally, several updates have been made to the input_output.py file, improving error handling, injecting type annotations, and modifying the function definition of convertfrompattern().

@reviewpad
Copy link
Contributor

reviewpad bot commented Jun 21, 2023

AI-Generated Summary: This pull request includes various changes to improve code quality, maintain a consistent code style, enhance error handling, and extend functionality. Key modifications include updating particle data in test files, adding pre-commit hooks, refactoring test cases using pytest fixtures and assertions, improving typing and error handling, updating dependencies, and adding new test files containing simulated data. Additionally, new pytest fixtures and utility functions have been added for downloading and installing the demo version of SHIELD-HIT12A.

@reviewpad
Copy link
Contributor

reviewpad bot commented Jun 21, 2023

AI-Generated Summary: This pull request includes several updates to the test framework, such as the addition of new test files, fixtures, utility functions, and test cases, as well as modifications to existing test files. The main focus is on the testing of different aspects of MCPL file conversion and validation, binary file handling, SHIELD-HIT12A demo version setup, and input file generation. New test functions have been introduced to validate specific cards within the generated input files, verify exit codes and file formats, and test the ability to concatenate multiple BDO files. A new .pre-commit-config.yaml file has been added for pre-commit hooks and updates were made to the test requirements file. The pytest.ini configuration file was also modified. Additionally, the SHIELD-HIT12A version has been updated from v1.0.1-23-gd578015e to v1.0.1-25-g25c9bf46, and the file pymchelper/estimator.py includes updates to function type hints.

@reviewpad
Copy link
Contributor

reviewpad bot commented Jun 21, 2023

AI-Generated Summary: This pull request includes several updates to files, including adding new binary files in 'tests/res/shieldhit/phasespace' directory, modifying '.gitignore', removing the binary file 'tests/res/shieldhit/executable/shieldhit', updating test configuration and requirement files, and introducing new test files. Furthermore, changes have been made to improve logging, error handling, and concatenation feature support in various files. Test functions have been refactored from a unittest class structure into individual pytest functions for better readability and modularity. The pull request also adds several pre-commit hooks to the project, addressing code formatting and file management issues. Finally, new tests for BDO files and MCPL conversion have been added, improving overall test coverage.

@reviewpad
Copy link
Contributor

reviewpad bot commented Jun 21, 2023

AI-Generated Summary: This pull request includes changes to several test files, refactoring and improving test implementations, and additional files and fixtures related to SHIELD-HIT12A, such as new BDO files and MCPL simulation results. It adds type hinting and error handling in the input_output.py script, as well as configuration updates to the pytest.ini file and the addition of pre-commit hooks for code formatting and quality checks. The pull request also contains changes to the .gitignore file, removal of obsolete binary files, and improvements in logging and the running variance algorithm. Additionally, new test functions and fixtures are introduced for checking file types and file conversion. Overall, these changes enhance the project's functionality, test coverage, and code quality.

@reviewpad
Copy link
Contributor

reviewpad bot commented Jun 21, 2023

AI-Generated Summary: This pull request introduces various changes to the project's files, including:

  1. Updates to dependencies in tests/requirements-test.txt and changes to the .gitignore file.
  2. Modifications to several source code files, such as pymchelper/input_output.py, pymchelper/estimator.py, and test files like tests/test_mcpl.py and tests/test_call_entry.py. These changes involve adding type hinting, updated function definitions, and improved test suites.
  3. Addition, deletion, and updating of binary files related to SHIELD-HIT12A simulations and test resources.
  4. Creation of new files, such as .pre-commit-config.yaml for setting up pre-commit hooks, conftest.py for downloading and extracting Shieldhit demo binaries, test files like test_example.py and test_runner.py, and result files like NB_mcpl_0001.txt and NB_mcpl_0002.txt.
  5. Changes to configuration files like pytest.ini.

Overall, the pull request contains numerous improvements to the codebase, such as enhanced readability, maintainability, and test coverage.

@reviewpad reviewpad bot added large Pull request is large and removed medium Pull request is medium labels Jun 21, 2023
@grzanka grzanka mentioned this pull request Jun 21, 2023
Copy link
Member

@nbassler nbassler left a comment

Choose a reason for hiding this comment

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

tested, works.

tests/conftest.py Show resolved Hide resolved
This was referenced Jun 23, 2023
@grzanka grzanka merged commit da40c97 into master Jun 23, 2023
@grzanka grzanka deleted the 657-fix-mcpl-files-with-ones-with-good-particle-numbers branch June 23, 2023 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
large Pull request is large waiting-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix MCPL files with ones with good particle numbers
3 participants