Add failing test case for issue #549 (empty Importance object print)#681
Conversation
MicahGale
left a comment
There was a problem hiding this comment.
Thanks for the contribution @kordusas!
This is a good first pass but some changes are needed. I left comments on specific changes.
- Update the PR description to give a summary of what the problem that was solved is, and how it was solved. Also link to the specific issues. See #680 for an example.
- Do you want to add yourself as an author to
AUTHORSand/orpyproject.toml? - Make sure to update the changelog with this bug fix.
- Would you like to added as a contributor to this repo on GH?
|
@kordusas do you need any help with this PR? |
MicahGale
left a comment
There was a problem hiding this comment.
I like what you have done with this __str__ style.
Also thank you for handling the conversion of unittest->pytest for this test suite, it wasn't essential for this PR, but is a huge help.
|
FYI: this will probably be deployed in 1.0.0, and not 0.5.6... hopefully. I'm hoping that we are really close to completing 1.0.0 release. |
Should i wait for the 1.0.0 to come out before submitting another pull request? |
Handling the merge conflicts wouldn't be the biggest deal. What you can do though is make new branches off of |
…ject not connected to _problem
…turing list added type hints to the function signature
…more cases to try. should be easier to add tests.
Co-authored-by: Micah Gale <mgale@fastmail.com>
458bc4f to
d6f8e2d
Compare
I have rebased it to alpha-test-dev, let me know if I didnt follow some procedures, I will adress the rest of the changes this week. Cheers |
MicahGale
left a comment
There was a problem hiding this comment.
This is looking good. Just one small tweak. Thanks for the contribution. If you have permissions you can merge when you are ready (we prefer merging over other options).
Co-authored-by: Micah Gale <mgale@fastmail.com>
Pull Request Checklist for MontePy
Description
Previously Importance class had a place holder for printing and failed on empty object instance. Now Importance printing is formatted like this:
IMPORTANCE: neutron=1.0, photon=1.0Empty object instance printing looks like this:
IMPORTANCE: Object is emptyReformated the test_importance.py now using @pytest.mark.parametrize and removed dependence on TestCase object.
test_importance_parsing_from_cellchecks if valid values are initiated or valid error is raised when creating Cell instance and getting the importance instance from thetest_importance_init_data_validtests init of importance from DATA block and testing access to ittest_importance_init_data_invalid- testing invalid importance object instance initcell_with_importance,empty_cell,test_importance_valuesto reuse same cells and same particle and importance assingmentstest_str_repr_parsed_cellschecks that methods return valid typetest_str_repr_empty_importancechecks that empty importance object returns whats expectedtest_importance_manual_assignment_and_str_repr- tests manual assignment of importance and the correct strrepresentation of the importance instanceFixes #549
General Checklist
blackversion 25.Documentation Checklist
I have documented all added classes and methods.For infrastructure updates, I have updated the developer's guide.For significant new features, I have added a section to the getting started guide.First-Time Contributor Checklist
pyproject.tomlif you wish to do so.Additional Notes for Reviewers
Ensure that:
📚 Documentation preview 📚: https://montepy--681.org.readthedocs.build/en/681/