Closed brenmous closed 4 years ago
That last merge commit was fixing a conflict in get_penetration_depth_by_index
I will have a review (For some unknown reason, I have not been receiving any notifications from github recently)
Checked out this branch and ran all unit-tests in my Ubuntu18.04 with ananconda Py3.7: ========== 192 passed, 6 skipped, 3168 warnings in 1493.93s (0:24:53) ========
(mtpy3.7) fzhang@zubuntu1804 ~/Githubz/mtpy (bren-fixtests)
$ pytest -v --ignore=tests/SmartMT tests
Will try win10 and review code changes later.
Thanks Fei, I actually forgot to test this on Windows so please let me know if there's issues
Fixes tests for Python 3.7 and switches Travis CI to Python 3.7.
Change summary:
plt.loglog
complained about there being no positive values despite X and Y both being all positive (this was on matplotlib 3.1.2). Upgrading to matplotlib 3.2.1 fixed this.penetration.get_penetration_depth
get period by providing period in seconds rather than index broke penetration depth 3D. The 3D variant was using that function to get period by index and another function (get_penetration_depth_generic
) to get period by value. I've refactored this and there are now functionsget_penetration_depth_by_period
andget_penetration_depth_by_index
. I've reimplemented the ability to get period by index for 2D by supplying theperiod_by_index
keyword argument to plot2Dprofile.make_z_mesh_new
broke a test. Because it's a class method, I removed these arguments and made it get the required parameters from the owner model instance in the body of the function. The exception isn_layers
, which is optional and the value will be taken from the model object if not provided.n_layers
is modified before being passed to the function when used inmodel.add_topography_to_model2
.data.write_data_file
tests.EDICollection.get_periods_by_stats
iterated through the periods on the stations and placed them into a dict to process how often each period occurs, then ordered by occurrence. The dict items were then placed in a list and returned. In Python 2, the periods have an arbitrary ordering and in Python 3 they are ordered by period as well as occurrence, so the test fails due to a mismatch between the data files written with Python 2 and Python 3 due to the ordering of periods. The solution is to regenerate the ModEm.dat reference files.make_z_mesh_new
. While these looked sane to me, it would be a good idea if an expert could double check they're correct - see commits 2f9afca and 6f2b5d3.PTShapefile
was expectingproject_point_ll2utm
to return UTM zone as aSpatialReference
. I've changed it create theSpatialReference
itself.That's the major changes! There were some minor syntax fixes as well.