Skip to content

Fix #73: avoid division-by-zero warning in L1rel/L2rel adaptivity#234

Merged
IshaanDesai merged 6 commits intoprecice:developfrom
PranjalManhgaye:fix-73-division-warning
Mar 10, 2026
Merged

Fix #73: avoid division-by-zero warning in L1rel/L2rel adaptivity#234
IshaanDesai merged 6 commits intoprecice:developfrom
PranjalManhgaye:fix-73-division-warning

Conversation

@PranjalManhgaye
Copy link
Copy Markdown
Contributor

@PranjalManhgaye PranjalManhgaye commented Mar 8, 2026

Fix #73: Invalid value in division warning in adaptivity functionality

  • Add epsilon to denominator in _l1rel and _l2rel to avoid division by zero when adaptivity data contains zeros
  • Add regression test test_adaptivity_norms_with_zeros_no_warning
image

Checklist:

  • I made sure that the CI passed before I ask for a review.
  • I added a summary of the changes (compared to the last release) in the CHANGELOG.md.
  • If necessary, I made changes to the documentation and/or added new content.
  • I will remember to squash-and-merge, providing a useful summary of the changes of this PR.

- Add epsilon to denominator in _l1rel and _l2rel to prevent invalid value warning when data contains zeros
- Add regression test test_adaptivity_norms_with_zeros_no_warning
- Add epsilon to denominator in _l1rel and _l2rel to prevent invalid value warning when data contains zeros
- Add regression test test_adaptivity_norms_with_zeros_no_warning
@PranjalManhgaye PranjalManhgaye force-pushed the fix-73-division-warning branch from 6d9a1fa to 9596f33 Compare March 10, 2026 03:58
Copy link
Copy Markdown
Member

@IshaanDesai IshaanDesai left a comment

Choose a reason for hiding this comment

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

Thanks for this contribution! The solution is great, I just have a few minor suggestions regarding comments. Once they are incorporated, I will merge.

Comment thread tests/unit/test_adaptivity_serial.py Outdated
Comment thread tests/unit/test_adaptivity_serial.py Outdated
Comment thread tests/unit/test_adaptivity_serial.py Outdated
PranjalManhgaye and others added 3 commits March 10, 2026 11:52
Co-authored-by: Ishaan Desai <ishaan.desai@ipvs.uni-stuttgart.de>
Co-authored-by: Ishaan Desai <ishaan.desai@ipvs.uni-stuttgart.de>
Co-authored-by: Ishaan Desai <ishaan.desai@ipvs.uni-stuttgart.de>
@PranjalManhgaye
Copy link
Copy Markdown
Contributor Author

@IshaanDesai i have commited your suggestions , Thanks

@IshaanDesai IshaanDesai merged commit a99ac74 into precice:develop Mar 10, 2026
8 checks passed
@MakisH MakisH added the GSoC Contributed in the context of the Google Summer of Code label Mar 14, 2026
@IshaanDesai IshaanDesai mentioned this pull request Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GSoC Contributed in the context of the Google Summer of Code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid value in division warning in adaptivity functionality

3 participants