Skip to content

Commit

Permalink
refactor: created a proper project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubenknex committed Jul 22, 2016
1 parent 18c0cf9 commit b49d827
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion qtplot.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python "%~dp0qtplot.py" %1
python "%~dp0qtplot/qtplot.py" %1
2 changes: 1 addition & 1 deletion canvas.py → qtplot/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def __init__(self, parent=None):
self.data_program = gloo.Program(data_vert, data_frag)

path = os.path.dirname(os.path.realpath(__file__))
path = os.path.join(path, 'colormaps/transform/Seismic.npy')
path = os.path.join(path, '../colormaps/transform/Seismic.npy')
self.colormap = Colormap(path)

self.colormap_program = gloo.Program(colormap_vert, colormap_frag)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 7 additions & 2 deletions qtplot.py → qtplot/qtplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,18 @@ def init_ui(self):
self.cb_cmaps.activated.connect(self.on_cmap_change)

path = os.path.dirname(os.path.realpath(__file__))
path = os.path.join(path, 'colormaps')
path = os.path.join(path, '../colormaps')

cmap_files = []
for dir, _, files in os.walk(path):
for filename in files:
reldir = os.path.relpath(dir, path)
relfile = os.path.join(reldir, filename)

# Remove .\ for files in the root of the directory
if relfile[:2] == '.\\':
relfile = relfile[2:]

cmap_files.append(relfile)

self.cb_cmaps.addItems(cmap_files)
Expand Down Expand Up @@ -501,7 +506,7 @@ def on_cmap_change(self, event):
selected_cmap = str(self.cb_cmaps.currentText())

path = os.path.dirname(os.path.realpath(__file__))
path = os.path.join(path, 'colormaps', selected_cmap)
path = os.path.join(path, '../colormaps', selected_cmap)

new_colormap = Colormap(path)

Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
numpy
scipy
pandas
matplotlib
pyopengl
vispy
Empty file added setup.py
Empty file.
File renamed without changes.

0 comments on commit b49d827

Please sign in to comment.