Test for SRTomo class - #316
Conversation
|
@victortxa thanks for doing this! To test the Also, be careful of PEP8 issues in your code (particularly missing spaces after commas). Use |
|
@leouieda Thank you! |
|
Something like: |
| srcs = [src, src] | ||
| recs = [(0, 0), (5, 10)] | ||
| ttimes = ttime2d.straight(model, 'vp', srcs, recs) | ||
| tomo = srtomo.SRTomo(ttimes, srcs, recs, model) |
There was a problem hiding this comment.
Please create a mesh object using SquareMesh to use with the tomo class. The model object is mutable and you won't have it if you're not running a synthetic data test.
| @@ -0,0 +1,51 @@ | |||
| import numpy as np | |||
There was a problem hiding this comment.
On the first line, use the following imports for future Python 3 compatibility:
from __future__ import division, print_function
from future.builtins import range
This way you don't need to put . in all your numbers "1./2."
|
@victortxa looks good so far! It seems that line 117 is the one not covered in the tests (it's that check if the predicted is a 1D numpy array). Could you try removing that After that, I think all that is left is building the docs and checking is all docstrings and gallery plots are working correctly. |
|
I'm trying to run tests in my laptop, but I need to fix the installations (a lot of things failing here). |
|
@leouieda I think it's all working now. I removed the example from the 'docstrings' of the function (take a look if you agree). |
|
@victortxa yep, it's all looking good! Thanks! Could you please merge in the latest commits from master and create the changelog entry? Also, build the docs locally and check that everything is OK, particularly the SRTomo docs and the changelog. |
|
|
||
| **Changes**: | ||
|
|
||
| * Add test for SRTomo class. |
There was a problem hiding this comment.
Please be more detailed, for example:
Implement more unit tests for the ``fatiando.seismic.srtomo`` module. Reached 100% test coverage.
There was a problem hiding this comment.
Thank you, it was horrible! All seems fine now (docs are build properly, PEP8 is ok too).
|
@victortxa OK, perfect! Sorry, you'll need to merge in master again because #319 was just merged. After that, let me know and I'll merge this. |
|
@leouieda After checks pass, I think it's done. |
|
Merged! |
Making a test for SRTomo class. Maybe, also changes in docstring of this class to an adjustment.
Checklist:
doc/install.rst,requirements.txt,environment.yml,ci/requirements-conda.txtandci/requirements-pip.txt.cd doc; makelocally)doc/contributors.rst(leave for last to avoid conflicts)