idaholab / MontePy

MontePy is the most user friendly Python library (API) to read, edit, and write MCNP input files.
https://www.montepy.org/
MIT License
27 stars 6 forks source link

Fixing all issues found through developing Testing - [merged] #212

Closed MicahGale closed 8 months ago

MicahGale commented 2 years ago

Merges fixUnit -> issue5ReadCard

All passes now.

MicahGale commented 2 years ago

added 13 commits

Compare with previous version

MicahGale commented 2 years ago

marked this merge request as ready

MicahGale commented 2 years ago

changed target branch from develop to issue5ReadCard

MicahGale commented 2 years ago

changed target branch from issue5ReadCard to testing

MicahGale commented 2 years ago

changed target branch from testing to issue5ReadCard

MicahGale commented 2 years ago

In GitLab by @tjlaboss on Feb 19, 2022, 09:36

Commented on tests/test_integration.py line 8

One thing I like to do is store file paths as constants in a module.

MicahGale commented 2 years ago

Good point. Does it matter too much though for a test suite? This won't be shipping with the packages.

MicahGale commented 2 years ago

In GitLab by @tjlaboss on Feb 19, 2022, 11:10

Commented on tests/test_data_cards.py line 65

ident is not used. This does not test uppercase (and it breaks when it does).

MicahGale commented 2 years ago

In GitLab by @tjlaboss on Feb 19, 2022, 11:10

Commented on tests/test_material.py line 11

Suggest making these classes available in mcnpy namespace. I'll submit a merge request doing the following:

# __init__.py
from .data_cards.thermal_scattering import ThermalScatteringLaw
MicahGale commented 2 years ago

In GitLab by @tjlaboss on Feb 19, 2022, 11:10

Commented on tests/test_material.py line 19

Rather than initializing Material(input_card, None), define

Class Material(input_card, comment: str=None)
MicahGale commented 2 years ago

In GitLab by @tjlaboss on Feb 19, 2022, 11:10

Commented on tests/testCellProblem.py line 48

This won't work for imp:n,p=1

MicahGale commented 2 years ago

In GitLab by @tjlaboss on Feb 19, 2022, 11:14

Commented on tests/test_integration.py line 8

It does not matter too much.

MicahGale commented 2 years ago

In GitLab by @tjlaboss on Feb 19, 2022, 11:14

Commented on tests/test_data_cards.py line 65

See !10 0ef01f8659324e0963b53ec8b0e5dafae5fc8b16.

MicahGale commented 2 years ago

I wrote these tests a bit fast and dirty as you can tell.

MicahGale commented 2 years ago

Right. I currently don't like this dictionary approach to parameters and want to change it to something more custom. So I'm not sure how much effort we want to sink into this method right now.

MicahGale commented 2 years ago

Yes this should be fixed. Though it's actually a Comment object.

MicahGale commented 2 years ago
  1. I'm hesitant to add too much to the main namespace and congest it for the users.
  2. I'm avoiding relative imports as much as possible because it commonly breaks circular imports.
MicahGale commented 2 years ago

changed this line in version 6 of the diff

MicahGale commented 2 years ago

added 11 commits

Compare with previous version

MicahGale commented 2 years ago

Let's punt this discussion to another MR for now.

MicahGale commented 2 years ago

resolved all threads

MicahGale commented 2 years ago

changed this line in version 7 of the diff

MicahGale commented 2 years ago

changed this line in version 7 of the diff

MicahGale commented 2 years ago

changed this line in version 7 of the diff

MicahGale commented 2 years ago

changed this line in version 8 of the diff

MicahGale commented 2 years ago

added 9 commits

Compare with previous version

MicahGale commented 2 years ago

mentioned in commit 82aa26bd8229c1890f7f598dbaf164e9600151a1