Skip to content

Commit b2b3da7

Browse files
committed
2 parents bd8d9b2 + 563af75 commit b2b3da7

8 files changed

+56
-35
lines changed

.travis.yml

+19-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ python:
55
sudo: false
66

77
env:
8-
- TEST_DIR="tests"
8+
global:
9+
- PYPI_PY=3.6 # deploy to pypi from python 3.6
10+
11+
env:
12+
- TEST_DIR="tests"
913

1014
# Setup anaconda
1115
before_install:
@@ -18,7 +22,20 @@ install:
1822

1923
# Run test
2024
script:
21-
- nosetests $TEST_DIR -v -s
25+
- travis_wait 30 nosetests $TEST_DIR -v -s
26+
27+
# upload to pypi on success
28+
after_success:
29+
#deploy to pypi
30+
- if [ $TRAVIS_PYTHON_VERSION == $PYPI_PY ]; then
31+
if [ "$TRAVIS_TAG" = "true" ]; then
32+
openssl aes-256-cbc -K $encrypted_bc303f70394a_key -iv $encrypted_bc303f70394a_iv -in credentials.tar.gz.enc -out credentials.tar.gz -d;
33+
tar -xzf credentials.tar.gz;
34+
mv credentials/.pypirc ~/.pypirc ;
35+
python setup.py sdist bdist_wheel ;
36+
travis_wait 20 twine upload -r pypi --skip-existing dist/* ;
37+
fi
38+
fi
2239

2340
notifications:
2441
slack: ubcgif:1Z2lR3XYRSM3GHflG71ZHEN6

Notebooks/GPR_Lab6_FitData.ipynb

+8-26
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,10 @@
6262
"execution_count": 2,
6363
"metadata": {},
6464
"outputs": [
65-
{
66-
"name": "stdout",
67-
"output_type": "stream",
68-
"text": [
69-
"Downloading https://github.com/geoscixyz/gpgLabs/raw/master/figures/GPR/ubc_GPRdata.png\n",
70-
" saved to: C:\\Users\\Devin\\Documents\\GPGlabs\\notebooks\\ubc_GPRdata.png\n",
71-
"Download completed!\n"
72-
]
73-
},
7465
{
7566
"data": {
7667
"application/vnd.jupyter.widget-view+json": {
77-
"model_id": "cc6ed9543d7f44a7b23e1bfeafc7f59d"
68+
"model_id": "94b533cad0a54e598df4e27ade6ebe50"
7869
}
7970
},
8071
"metadata": {},
@@ -92,8 +83,8 @@
9283
}
9384
],
9485
"source": [
95-
"radargramImagePath = \"https://github.com/geoscixyz/gpgLabs/raw/master/figures/GPR/ubc_GPRdata.png\"\n",
96-
"radargramImage = download(radargramImagePath,overwrite=True,verbose=False)\n",
86+
"URL = \"https://github.com/geoscixyz/gpgLabs/raw/master/figures/GPR/ubc_GPRdata.png\"\n",
87+
"radargramImage = downloadRadargramImage(URL)\n",
9788
"PipeWidget(radargramImage)"
9889
]
9990
},
@@ -117,24 +108,15 @@
117108
},
118109
{
119110
"cell_type": "code",
120-
"execution_count": 3,
111+
"execution_count": 4,
121112
"metadata": {
122113
"scrolled": true
123114
},
124115
"outputs": [
125-
{
126-
"name": "stdout",
127-
"output_type": "stream",
128-
"text": [
129-
"Downloading https://github.com/geoscixyz/gpgLabs/raw/master/figures/GPR/ubc_GPRdata.png\n",
130-
" saved to: C:\\Users\\Devin\\Documents\\GPGlabs\\notebooks\\ubc_GPRdata.png\n",
131-
"Download completed!\n"
132-
]
133-
},
134116
{
135117
"data": {
136118
"application/vnd.jupyter.widget-view+json": {
137-
"model_id": "8db9b8cc34f44b068c390baa85ce9635"
119+
"model_id": "9b6c195504c14ea38c09ac60dd1cc3c6"
138120
}
139121
},
140122
"metadata": {},
@@ -146,14 +128,14 @@
146128
"<function gpgLabs.GPR.GPRlab1.WallWidgetFcn>"
147129
]
148130
},
149-
"execution_count": 3,
131+
"execution_count": 4,
150132
"metadata": {},
151133
"output_type": "execute_result"
152134
}
153135
],
154136
"source": [
155-
"radargramImagePath = \"https://github.com/geoscixyz/gpgLabs/raw/master/figures/GPR/ubc_GPRdata.png\"\n",
156-
"radargramImage = download(radargramImagePath,overwrite=True,verbose=False)\n",
137+
"URL = \"https://github.com/geoscixyz/gpgLabs/raw/master/figures/GPR/ubc_GPRdata.png\"\n",
138+
"radargramImage = downloadRadargramImage(URL)\n",
157139
"WallWidget(radargramImage)"
158140
]
159141
},

Notebooks/shot_raypaths.npy

-1.16 MB
Binary file not shown.

Notebooks/time.npy

-11.8 KB
Binary file not shown.

Notebooks/ubc_GPRcmp.png

-243 KB
Binary file not shown.

Notebooks/ubc_GPRdata.png

-981 KB
Binary file not shown.

credentials.tar.gz.enc

272 Bytes
Binary file not shown.

gpgLabs/GPR/GPRlab1.py

+29-7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,24 @@
88

99
from .Wiggle import wiggle, PrimaryWave, ReflectedWave
1010

11+
import requests
12+
from io import BytesIO
13+
14+
15+
########################################
16+
# DOWNLOAD FUNCTIONS
17+
########################################
18+
19+
def downloadRadargramImage(URL):
20+
21+
urlObj = requests.get(URL)
22+
imgcmp = Image.open(BytesIO(urlObj.content))
23+
24+
return imgcmp
25+
26+
27+
28+
1129
########################################
1230
# WIDGETS
1331
########################################
@@ -43,23 +61,25 @@ def PipeWidget(radargramImage):
4361
h=(0.1, 2.0, 0.1),
4462
xc=(0., 40., 0.2),
4563
r=(0.1, 3, 0.1),
46-
dataImage=fixed(radargramImage))
64+
imgcmp=fixed(radargramImage))
4765

4866
return i
4967

5068

51-
def WallWidget(radargramImage):
69+
def WallWidget(radargramImagePath):
5270

5371
i = interact(WallWidgetFcn,
5472
epsr = (0, 100, 1),
5573
h=(0.1, 2.0, 0.1),
5674
x1=(1, 35, 1),
5775
x2=(20, 40, 1),
58-
dataImage=fixed(radargramImage))
76+
imgcmp=fixed(radargramImagePath))
5977

6078
return i
6179

6280

81+
82+
6383
########################################
6484
# FUNCTIONS
6585
########################################
@@ -121,8 +141,9 @@ def PrimaryFieldWidgetFcn(tinterp, epsr, radgramImg):
121141
plt.show()
122142

123143

124-
def PipeWidgetFcn(epsr, h, xc, r, dataImage):
125-
imgcmp = Image.open(dataImage)
144+
def PipeWidgetFcn(epsr, h, xc, r, imgcmp):
145+
146+
# imgcmp = Image.open(dataImage)
126147
imgcmp = imgcmp.resize((600, 800))
127148
fig = plt.figure(figsize = (9,11))
128149
ax = plt.subplot(111)
@@ -143,8 +164,9 @@ def PipeWidgetFcn(epsr, h, xc, r, dataImage):
143164
plt.show()
144165

145166

146-
def WallWidgetFcn(epsr, h, x1, x2, dataImage):
147-
imgcmp = Image.open(dataImage)
167+
def WallWidgetFcn(epsr, h, x1, x2, imgcmp):
168+
169+
# imgcmp = Image.open(dataImage)
148170
imgcmp = imgcmp.resize((600, 800))
149171
fig = plt.figure(figsize = (9,11))
150172
ax = plt.subplot(111)

0 commit comments

Comments
 (0)