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

Tesseroid should warn if ignoring cells too small #228

Merged
merged 7 commits into from Aug 11, 2015

Conversation

Projects
None yet
1 participant
@leouieda
Member

leouieda commented Aug 11, 2015

The code currently ignores input tesseroids that are too small (sides < 1e-6 degrees or ~ 0.1m) but does so silently. It should spit out a warning so that the user this is happening.

Also, when dividing below a size 1e-6 (horizontal) I get a ZeroDivisionError. This is because I stop the small tesseroids from going into the kernel functions but there is no check when the tesseroids are being divided. The code should calculate the effects of these tesseroids without dividing and warn the user of this.

This PR implements the tests that catch these two problems and the solutions.

Checklist:

  • Make tests for new code
  • Create/update docstrings
  • Include relevant equations and citations in docstrings
  • Code follows PEP8 style conventions
  • Code and docs have been spellchecked
  • Include new dependencies in docs, requirements.txt, README, and .travis.yml
  • Documentation builds properly
  • All tests pass
  • Can be merged
  • Changelog entry (leave for last)
Tesseroid should warn if ignoring cells too small
The code ignores input tesseroids that are too small but does so
silently. It should spit out a warning.

Also, when dividing below a size 1e-6 (horizontal) I get a
ZeroDivisionError. The code should not divide such small tesseroids but
warn the user of this.

Made two tests that check this. They fail still because I haven't made
the correction.

@leouieda leouieda added this to the 0.4 milestone Aug 11, 2015

leouieda added some commits Aug 11, 2015

Stop division if tess is too small and warnings
Uses warnings if stopped dividing because of size or if ignoring the
tesseroid from the start.
Warn in func docs say 10 cm, not 1 cm
Included an image to show a tesseroid in the module docstring.

leouieda added a commit that referenced this pull request Aug 11, 2015

Merge pull request #228 from fatiando/small-tesseroid
Tesseroid should warn if ignoring cells too small

@leouieda leouieda merged commit 442de32 into master Aug 11, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@leouieda leouieda deleted the small-tesseroid branch Aug 11, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment