Skip to content

Commit

Permalink
🚧 Temporarily uninstall PyGMT and skip gmt-required tests
Browse files Browse the repository at this point in the history
Very hacky workaroud to solve dependabot not wanting to upgrade DeepBedMap's dependencies! Best guess is that the PyGMT VCS dependency is the problem (see #137, #139, #140, #142, #143, #144). So, I'm taking it out of the Pipfile and disabling pygmt required tests, have dependabot upgrade the other dependencies, and then restore pygmt into the Pipfile. Had to add xarray explicitly to Pipfile for the meantime. Onwards!
  • Loading branch information
weiji14 committed May 31, 2019
1 parent ea63795 commit ea40d50
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 54 deletions.
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ numpy = "==1.16.2"
onnx_chainer = "==1.3.3"
optuna = "==0.8.0"
pandas = "==0.24.2"
pygmt = {editable = true,ref = "0.0.1a0-31-g97c2b4a",git = "https://github.com/weiji14/pygmt.git"}
quilt = "==2.9.14"
rasterio = "==1.0.13"
rtree = "==0.8.3"
scikit-image = "==0.14.2"
tqdm = "==4.29.1"
xarray = "==0.12.1"

[dev-packages]
behave = "==1.2.6"
Expand Down
20 changes: 8 additions & 12 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions data_prep.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"import zipfile\n",
"\n",
"import geopandas as gpd\n",
"import pygmt as gmt\n",
"# import pygmt as gmt\n",
"import IPython.display\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
Expand Down Expand Up @@ -815,10 +815,10 @@
"\n",
" >>> xyz_data = 1000*pd.DataFrame(np.random.RandomState(seed=42).rand(60).reshape(20, 3))\n",
" >>> region = get_region(xyz_data=xyz_data)\n",
" >>> grid = xyz_to_grid(xyz_data=xyz_data, region=region, spacing=250)\n",
" >>> grid.to_array().shape\n",
" >>> grid = xyz_to_grid(xyz_data=xyz_data, region=region, spacing=250) # doctest: +SKIP\n",
" >>> grid.to_array().shape # doctest: +SKIP\n",
" (1, 5, 5)\n",
" >>> grid.to_array().values\n",
" >>> grid.to_array().values # doctest: +SKIP\n",
" array([[[403.17618 , 544.92535 , 670.7824 , 980.75055 , 961.47723 ],\n",
" [379.0757 , 459.26407 , 314.38297 , 377.78555 , 546.0469 ],\n",
" [450.67664 , 343.26 , 88.391594, 260.10492 , 452.3337 ],\n",
Expand Down
8 changes: 4 additions & 4 deletions data_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import zipfile

import geopandas as gpd
import pygmt as gmt
# import pygmt as gmt
import IPython.display
import matplotlib.pyplot as plt
import numpy as np
Expand Down Expand Up @@ -379,10 +379,10 @@ def xyz_to_grid(
>>> xyz_data = 1000*pd.DataFrame(np.random.RandomState(seed=42).rand(60).reshape(20, 3))
>>> region = get_region(xyz_data=xyz_data)
>>> grid = xyz_to_grid(xyz_data=xyz_data, region=region, spacing=250)
>>> grid.to_array().shape
>>> grid = xyz_to_grid(xyz_data=xyz_data, region=region, spacing=250) # doctest: +SKIP
>>> grid.to_array().shape # doctest: +SKIP
(1, 5, 5)
>>> grid.to_array().values
>>> grid.to_array().values # doctest: +SKIP
array([[[403.17618 , 544.92535 , 670.7824 , 980.75055 , 961.47723 ],
[379.0757 , 459.26407 , 314.38297 , 377.78555 , 546.0469 ],
[450.67664 , 343.26 , 88.391594, 260.10492 , 452.3337 ],
Expand Down
1 change: 1 addition & 0 deletions features/data_prep.feature
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Feature: Data preparation
| https://data.cresis.ku.edu/data/rds/2017_Antarctica_Basler/csv_good/Data_20171204_02.csv | highres/Data_20171204_02.csv | 53cef7a0d28ff92b30367514f27e888efbc32b1bda929981b371d2e00d4c671b |
| http://ramadda.nerc-bas.ac.uk/repository/entry/get/Polar%20Data%20Centre/DOI/Rutford%20Ice%20Stream%20bed%20elevation%20DEM%20from%20radar%20data/bed_WGS84_grid.txt?entryid=synth%3A54757cbe-0b13-4385-8b31-4dfaa1dab55e%3AL2JlZF9XR1M4NF9ncmlkLnR4dA%3D%3D | highres/bed_WGS84_grid.txt | 7396e56cda5adb82cecb01f0b3e01294ed0aa6489a9629f3f7e8858ea6cb91cf |

@skip
Scenario Outline: Grid datasets
Given a collection of raw high resolution datasets <input_pattern>
When we process the data through <pipeline_file>
Expand Down
1 change: 1 addition & 0 deletions features/deepbedmap.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Feature: DeepBedMap
As a scientist,
We want a model that produces realistic images from many open datasets

@skip
Scenario Outline: Determine high resolution bed
Given some view of Antarctica <bounding_box>
When we gather low and high resolution images related to that view
Expand Down
49 changes: 16 additions & 33 deletions test_ipynb.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -202,25 +202,6 @@
" region = get_region(xyz_data=xyz_data)\n",
"Expecting nothing\n",
"ok\n",
"Trying:\n",
" grid = xyz_to_grid(xyz_data=xyz_data, region=region, spacing=250)\n",
"Expecting nothing\n",
"ok\n",
"Trying:\n",
" grid.to_array().shape\n",
"Expecting:\n",
" (1, 5, 5)\n",
"ok\n",
"Trying:\n",
" grid.to_array().values\n",
"Expecting:\n",
" array([[[403.17618 , 544.92535 , 670.7824 , 980.75055 , 961.47723 ],\n",
" [379.0757 , 459.26407 , 314.38297 , 377.78555 , 546.0469 ],\n",
" [450.67664 , 343.26 , 88.391594, 260.10492 , 452.3337 ],\n",
" [586.09906 , 469.74008 , 216.8168 , 486.9802 , 642.2116 ],\n",
" [451.4794 , 652.7244 , 325.77896 , 879.8973 , 916.7921 ]]],\n",
" dtype=float32)\n",
"ok\n",
"2 items had no tests:\n",
" data_prep\n",
" data_prep.parse_datalist\n",
Expand All @@ -231,9 +212,9 @@
" 2 tests in data_prep.get_region\n",
" 3 tests in data_prep.get_window_bounds\n",
" 3 tests in data_prep.selective_tile\n",
" 5 tests in data_prep.xyz_to_grid\n",
"25 tests in 9 items.\n",
"25 passed and 0 failed.\n",
" 2 tests in data_prep.xyz_to_grid\n",
"22 tests in 9 items.\n",
"22 passed and 0 failed.\n",
"Test passed.\n"
]
}
Expand Down Expand Up @@ -503,13 +484,14 @@
" When we download it to highres/bed_WGS84_grid.txt # features/steps/test_data_prep.py:13\n",
" Then the local file should have this 7396e56cda5adb82cecb01f0b3e01294ed0aa6489a9629f3f7e8858ea6cb91cf checksum # features/steps/test_data_prep.py:19\n",
"\n",
" Scenario Outline: Grid datasets -- @1.1 ASCII text files to grid # features/data_prep.feature:26\n",
" Given a collection of raw high resolution datasets bed_WGS84_grid.txt # features/steps/test_data_prep.py:25\n",
" When we process the data through bed_WGS84_grid.json # features/steps/test_data_prep.py:38\n",
" And interpolate the xyz data table to bed_WGS84_grid.nc # features/steps/test_data_prep.py:45\n",
" Then a high resolution raster grid is returned # features/steps/test_data_prep.py:54\n",
" @skip\n",
" Scenario Outline: Grid datasets -- @1.1 ASCII text files to grid # features/data_prep.feature:27\n",
" Given a collection of raw high resolution datasets bed_WGS84_grid.txt # None\n",
" When we process the data through bed_WGS84_grid.json # None\n",
" And interpolate the xyz data table to bed_WGS84_grid.nc # None\n",
" Then a high resolution raster grid is returned # None\n",
"\n",
" Scenario Outline: Tile datasets -- @1.1 Raster grids to tile # features/data_prep.feature:36\n",
" Scenario Outline: Tile datasets -- @1.1 Raster grids to tile # features/data_prep.feature:37\n",
" Given a big highres raster grid 2010tr.nc # features/steps/test_data_prep.py:60\n",
" And a collection of square bounding boxes \"model/train/tiles_3031.geojson\" # features/steps/test_data_prep.py:70\n",
" When we crop the big raster grid using those bounding boxes # features/steps/test_data_prep.py:80\n",
Expand Down Expand Up @@ -566,11 +548,12 @@
" In order to create a great map of Antarctica's bed\n",
" As a scientist,\n",
" We want a model that produces realistic images from many open datasets\n",
" Scenario Outline: Determine high resolution bed -- @1.1 Bounding box views of Antarctica # features/deepbedmap.feature:16\n",
" Given some view of Antarctica -1593714.328,-164173.7848,-1575464.328,-97923.7848 # features/steps/test_deepbedmap.py:6\n",
" When we gather low and high resolution images related to that view # features/steps/test_deepbedmap.py:14\n",
" And pass those images into our trained neural network model # features/steps/test_deepbedmap.py:30\n",
" Then a four times upsampled super resolution bed elevation map is returned # features/steps/test_deepbedmap.py:38\n",
" @skip\n",
" Scenario Outline: Determine high resolution bed -- @1.1 Bounding box views of Antarctica # features/deepbedmap.feature:17\n",
" Given some view of Antarctica -1593714.328,-164173.7848,-1575464.328,-97923.7848 # None\n",
" When we gather low and high resolution images related to that view # None\n",
" And pass those images into our trained neural network model # None\n",
" Then a four times upsampled super resolution bed elevation map is returned # None\n",
"\n"
]
}
Expand Down

0 comments on commit ea40d50

Please sign in to comment.