Skip to content

Commit 06caf28

Browse files
committed
CI: Reorganized the list of data files for caching as a workaround for issue #3170
1 parent 70d666e commit 06caf28

File tree

1 file changed

+58
-61
lines changed

1 file changed

+58
-61
lines changed

pygmt/helpers/caching.py

Lines changed: 58 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -9,89 +9,80 @@ def cache_data():
99
"""
1010
Download GMT remote data files used in PyGMT tests and docs to cache folder.
1111
"""
12-
# List of datasets to download
12+
# List of GMT remote datasets.
1313
datasets = [
14-
# Earth relief grids
14+
"@earth_age_01d_g",
15+
"@earth_day_01d_p",
16+
"@earth_faa_01d_g",
1517
"@earth_gebco_01d_g",
1618
"@earth_gebcosi_01d_g",
1719
"@earth_gebcosi_15m_p",
18-
"@earth_relief_01d_p",
19-
"@earth_relief_01d_g",
20-
"@earth_relief_30m_p",
21-
"@earth_relief_30m_g",
22-
"@earth_relief_10m_p",
23-
"@earth_relief_10m_g",
24-
"@earth_relief_05m_p",
25-
"@earth_relief_05m_g",
26-
"@earth_synbath_01d_g",
27-
# List of tiles of 03s srtm data.
28-
# Names like @N35E135.earth_relief_03s_g.nc are for internal use only.
29-
# The naming scheme may change. DO NOT USE IT IN YOUR SCRIPTS.
30-
"@N30W120.earth_relief_15s_p.nc",
31-
"@N35E135.earth_relief_03s_g.nc",
32-
"@N37W120.earth_relief_03s_g.nc",
33-
"@N00W090.earth_relief_03m_p.nc",
34-
"@N00E135.earth_relief_30s_g.nc",
35-
"@N00W010.earth_relief_15s_p.nc", # Specific grid for 15s test
36-
"@N04W010.earth_relief_03s_g.nc", # Specific grid for 03s test
37-
# Earth synbath relief grid
38-
"@S15W105.earth_synbath_30s_p.nc",
39-
# Earth seafloor age grids
40-
"@earth_age_01d_g",
41-
"@N00W030.earth_age_01m_g.nc", # Specific grid for 01m test
42-
# Earth geoid grids
4320
"@earth_geoid_01d_g",
44-
"@N00W030.earth_geoid_01m_g.nc", # Specific grid for 01m test
45-
# Earth magnetic anomaly grids
46-
"@earth_mag_01d_g",
47-
"@S30W060.earth_mag_02m_p.nc", # Specific grid for 02m test
4821
"@earth_mag4km_01d_g",
49-
"@S30W120.earth_mag4km_02m_p.nc", # Specific grid for 02m test
50-
# Earth mask grid
22+
"@earth_mag_01d_g",
5123
"@earth_mask_01d_g",
52-
# Earth free-air anomaly grids
53-
"@earth_faa_01d_g",
54-
"@N00W030.earth_faa_01m_p.nc", # Specific grid for 01m test
55-
# Earth vertical gravity gradient grids
24+
"@earth_relief_01d_g",
25+
"@earth_relief_01d_p",
26+
"@earth_relief_10m_g",
27+
"@earth_relief_10m_p",
28+
"@earth_relief_30m_g",
29+
"@earth_relief_30m_p",
30+
"@earth_synbath_01d_g",
5631
"@earth_vgg_01d_g",
57-
"@N00W030.earth_vgg_01m_p.nc", # Specific grid for 01m test
58-
# Earth WDMAM grids
5932
"@earth_wdmam_01d_g",
60-
"@S90E000.earth_wdmam_03m_g.nc", # Specific grid for 03m test
61-
# Earth day/night images
62-
"@earth_day_01d_p",
63-
# Mars relief grids
6433
"@mars_relief_01d_g",
65-
"@N00W030.mars_relief_01m_g.nc", # Specific grid for 01m tes
66-
# Mercury relief grids
6734
"@mercury_relief_01d_g",
68-
"@N00W030.mercury_relief_01m_p.nc", # Specific grid for 01m test
69-
# Moon relief grids
7035
"@moon_relief_01d_g",
71-
"@N00W030.moon_relief_01m_p.nc", # Specific grid for 01m test
72-
# Pluto relief grids
7336
"@pluto_relief_01d_g",
74-
"@N00W030.pluto_relief_01m_p.nc", # Specific grid for 01m test
75-
# Venus relief grids
7637
"@venus_relief_01d_g",
77-
"@N00W030.venus_relief_01m_g.nc", # Specific grid for 01m test
78-
# Other cache files
79-
"@capitals.gmt",
80-
"@circuit.png",
81-
"@earth_relief_20m_holes.grd",
38+
]
39+
40+
# List of tiled remote datasets.
41+
# Names like @N35E135.earth_relief_03s_g.nc are for internal use only. The naming
42+
# scheme may change. DO NOT USE IT IN YOUR SCRIPTS.
43+
tiles = [
44+
"@N00W030.earth_age_01m_g.nc",
45+
"@N00W030.earth_faa_01m_p.nc",
46+
"@N00W030.earth_geoid_01m_g.nc",
47+
"@S30W060.earth_mag_02m_p.nc",
48+
"@S30W120.earth_mag4km_02m_p.nc",
49+
"@earth_relief_05m_g", # All tiles are requested for earth_relief_05m dataset.
50+
"@earth_relief_05m_p",
51+
"@N00W090.earth_relief_03m_p.nc",
52+
"@N00E135.earth_relief_30s_g.nc",
53+
"@N00W010.earth_relief_15s_p.nc",
54+
"@N30W120.earth_relief_15s_p.nc",
55+
"@N04W010.earth_relief_03s_g.nc",
56+
"@N35E135.earth_relief_03s_g.nc",
57+
"@N37W120.earth_relief_03s_g.nc",
58+
"@S15W105.earth_synbath_30s_p.nc",
59+
"@S90E000.earth_wdmam_03m_g.nc",
60+
"@N00W030.earth_vgg_01m_p.nc",
61+
"@N00W030.mars_relief_01m_g.nc",
62+
"@N00W030.mercury_relief_01m_p.nc",
63+
"@N00W030.moon_relief_01m_p.nc",
64+
"@N00W030.pluto_relief_01m_p.nc",
65+
"@N00W030.venus_relief_01m_g.nc",
66+
]
67+
68+
# List of cache files to download.
69+
caches = [
8270
"@EGM96_to_36.txt",
8371
"@MaunaLoa_CO2.txt",
84-
"@RidgeTest.shp",
85-
"@RidgeTest.shx",
8672
"@RidgeTest.dbf",
8773
"@RidgeTest.prj",
74+
"@RidgeTest.shp",
75+
"@RidgeTest.shx",
8876
"@Table_5_11.txt",
8977
"@Table_5_11_mean.xyz",
78+
"@capitals.gmt",
79+
"@circuit.png",
80+
"@earth_relief_20m_holes.grd",
9081
"@fractures_06.txt",
9182
"@hotspots.txt",
92-
"@ridge.txt",
9383
"@mars370d.txt",
94-
"@srtm_tiles.nc", # needed for 03s and 01s relief data
84+
"@ridge.txt",
85+
"@srtm_tiles.nc", # Needed for earth relief 03s and 01s data.
9586
"@static_earth_relief.nc",
9687
"@ternary.txt",
9788
"@test.dat.nc",
@@ -100,4 +91,10 @@ def cache_data():
10091
"@tut_ship.xyz",
10192
"@usgs_quakes_22.txt",
10293
]
103-
which(fname=datasets, download="a")
94+
95+
which(fname=datasets + caches, download="a")
96+
97+
# We can't download a list of tiled grids due to bug reported in
98+
# https://github.com/GenericMappingTools/pygmt/issues/3170
99+
for tile in tiles:
100+
which(fname=tile, download="a")

0 commit comments

Comments
 (0)