pyhyp icon indicating copy to clipboard operation
pyhyp copied to clipboard

Mesh check error printout

Open hajdik opened this issue 2 years ago • 2 comments

Purpose

This changes the logic for error printouts for boundary condition checks and topology errors so all errors present in the mesh will print out. The previous behavior was to exit on the first issue, making it hard to fix multiple errors at once.

I also changed the printout that shows up at the start of a case. Originally it printed the case name as the name of the input file, but when running pyHyp with patch input there's no input file. I changed this to print the output file when there isn't an input file.

Expected time until merged

None

Type of change

  • [ ] Bugfix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (non-backwards-compatible fix or feature)
  • [ ] Code style update (formatting, renaming)
  • [ ] Refactoring (no functional changes, no API changes)
  • [ ] Documentation update
  • [ ] Maintenance update
  • [ ] Other (please describe)

Testing

Run this with a broken mesh to see if all expected errors are printed out

Checklist

  • [ ] I have run flake8 and black to make sure the Python code adheres to PEP-8 and is consistently formatted
  • [x] I have formatted the Fortran code with fprettify or C/C++ code with clang-format as applicable
  • [x] I have run unit and regression tests which pass locally with my changes
  • [ ] I have added new tests that prove my fix is effective or that my feature works
  • [ ] I have added necessary documentation

hajdik avatar Jan 23 '24 18:01 hajdik

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 79.24%. Comparing base (ba26b6e) to head (6031b0b). Report is 1 commits behind head on main.

Files Patch % Lines
pyhyp/pyHyp.py 75.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #81      +/-   ##
==========================================
- Coverage   79.48%   79.24%   -0.24%     
==========================================
  Files           4        4              
  Lines         424      424              
==========================================
- Hits          337      336       -1     
- Misses         87       88       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jan 23 '24 18:01 codecov[bot]

Do you have a mesh that we can add as tests that catch these cases?

I think I could find one that captures one of the errors somewhere in my computer backup but it's ~800k cells, probably too big for the tests. I never had a mesh that would trip all of the errors at once.

Would also be good to add printout to the PR description.

Are you saying to add the text that I added for the error printout so it's documented here?

hajdik avatar Aug 05 '24 13:08 hajdik

Wow, if the input meshes are this large, then yes this is way too big. I was hoping for something manageable to improve testing. Right, triggering everything with an actual mesh is probably not realistic, and we probably need to do this in smaller pieces, or manufacture something. Ideally, we should unittests this, although this will take a lot more effort. Given that this is not a runtime critical application, I am approving for now. But if you have other ideas, feel free to create an issue or update this PR.

Are you saying to add the text that I added for the error printout so it's documented here?

Yes, I was just thinking of some type of documentation here as to what is expected as I dont have anything to run this with.

eirikurj avatar Aug 19 '24 11:08 eirikurj