Skip to content

Commit 8961e23

Browse files
cwrodDouglas Densmore
authored andcommitted
Files for binary dists
1 parent 9e6ad2c commit 8961e23

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

DAFD_GUI.spec

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# -*- mode: python -*-
2+
3+
block_cipher = None
4+
5+
6+
a = Analysis(['DAFD_GUI.py'],
7+
pathex=['/Users/CIDARLAB/Desktop/DAFD'],
8+
binaries=[],
9+
datas=[('MicroFluidics_Random.csv','.')],
10+
hiddenimports=[],
11+
hookspath=[],
12+
runtime_hooks=[],
13+
excludes=[],
14+
win_no_prefer_redirects=False,
15+
win_private_assemblies=False,
16+
cipher=block_cipher)
17+
pyz = PYZ(a.pure, a.zipped_data,
18+
cipher=block_cipher)
19+
exe = EXE(pyz,
20+
a.scripts,
21+
exclude_binaries=True,
22+
name='DAFD_GUI',
23+
debug=False,
24+
strip=False,
25+
upx=True,
26+
console=True )
27+
coll = COLLECT(exe,
28+
a.binaries,
29+
a.zipfiles,
30+
a.datas,
31+
strip=False,
32+
upx=True,
33+
name='DAFD_GUI')

InterModel.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@
66
from scipy.optimize import minimize
77
import numpy
88
import csv
9+
import sys
10+
import os
11+
12+
def resource_path(relative_path):
13+
""" Get absolute path to resource, works for dev and for PyInstaller """
14+
try:
15+
# PyInstaller creates a temp folder and stores path in _MEIPASS
16+
base_path = sys._MEIPASS
17+
except Exception:
18+
base_path = os.path.abspath(".")
19+
20+
return os.path.join(base_path, relative_path)
921

1022
class InterModel:
1123
"""The interpolation models plus wrapper functions to use them"""
@@ -19,7 +31,7 @@ def __init__(self):
1931
self.ranges_dict = {} #The min and max of each input type
2032
values_dict = {} #Temporary variable used for calculating ranges. Dict with input header as key and a list of all values of that header as values
2133

22-
with open('MicroFluidics_Random.csv') as f:
34+
with open(resource_path('MicroFluidics_Random.csv')) as f:
2335
#Make a list of lists of our csv data
2436
lines = csv.reader(f, delimiter=',')
2537

0 commit comments

Comments
 (0)