Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Fixes error with tesseroid modeling on latest numba - #328

Merged
leouieda merged 15 commits into
masterfrom
tesseroid-numba-latest
Nov 26, 2016
Merged

Fixes error with tesseroid modeling on latest numba#328
leouieda merged 15 commits into
masterfrom
tesseroid-numba-latest

Conversation

@leouieda

@leouieda leouieda commented Sep 28, 2016

Copy link
Copy Markdown
Member

The fatiando.gravmag.tesseroid code fails with the latest numba (0.28). This
was uncaught because installing Mayavi limits numba to 0.26, where the error
doesn't occur. The problem was in the engine_factory function. The looplift
argument to numba.jit doesn't seem to work anymore. The fix was to move the
array allocations out of the jitted function into the calling Python function.
This breaks the numpy only functions. They were too slow to be usable anyway so
I removed them from the code.

Caught the error by running the CI builds without installing Mayavi, but kept a
separate build with Mayavi to generate the documentation HTML. This forced to
configure the CI builds. Now there are separate builds for compiling the docs,
testing in Linux, and testing in OSX.

Checklist:

  • Make tests for new code (at least 80% coverage)
  • Create/update docstrings
  • Include relevant equations and citations in docstrings
  • Docstrings follow the style conventions
  • Code follows PEP8 style conventions
  • Code and docs have been spellchecked
  • Include new dependencies in doc/install.rst, requirements.txt, environment.yml, ci/requirements-conda.txt and ci/requirements-pip.txt.
  • Documentation builds properly (run cd doc; make locally)
  • Changelog entry (leave for last to avoid conflicts)

@leouieda leouieda added the bug label Sep 28, 2016
@leouieda leouieda added this to the 0.5 milestone Sep 28, 2016
@leouieda leouieda mentioned this pull request Sep 28, 2016
10 tasks
@leouieda
leouieda force-pushed the tesseroid-numba-latest branch from 6ce847d to 426b5e4 Compare November 26, 2016 18:31
Only install Mayavi on the build that makes the docs. Run without on
others to catch a bug in the tesseroid code with the latest numba.
The allocations were pushed the calling Python function. This breaks the
numpy version of the code, which I disabled because it was practically
unusable (so slow).
Also simplifies the ci shell scripts and use "set -e" to make them fail
if any command inside fails.
Add some more verbosity to the script as well.
Of course putting it in ci/requirements-pip.txt wouldn't get run when
running coverage, only when building the docs.
Add "set +e" to the end of scripts as suggested in
travis-ci/travis-ci#6522
@leouieda
leouieda force-pushed the tesseroid-numba-latest branch from 25691b2 to 0a257b3 Compare November 26, 2016 19:34
@leouieda
leouieda merged commit e15f498 into master Nov 26, 2016
@leouieda
leouieda deleted the tesseroid-numba-latest branch November 26, 2016 19:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant