Skip to content

Commit 0b9a09e

Browse files
committed
add base example
1 parent 6dfc85d commit 0b9a09e

File tree

5 files changed

+128
-100
lines changed

5 files changed

+128
-100
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ Byte-compiled / optimized
1313
docs/_build
1414
docs/_static
1515
docs/_templates
16+
17+
# eggs
18+
h5xplorer.egg-info/

example/3dechem-xplorer/3dechemxp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env python
22

33
from h5xplorer.h5xplorer import h5xplorer
4-
app = h5xplorer()
4+
app = h5xplorer()

example/h5x.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env python
2+
3+
from h5xplorer.h5xplorer import h5xplorer
4+
app = h5xplorer()

h5xplorer/default_menu.py

+19-15
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,59 @@
22
from h5xplorer.menu_tools import *
33
from h5xplorer.menu_plot import *
44

5-
def default_context_menu(self, treeview, position):
65

6+
def default_context_menu(self, treeview, position):
77
"""Generate a right-click menu for the items"""
88

9-
all_item = get_current_item(self,treeview,single=False)
9+
all_item = get_current_item(self, treeview, single=False)
1010

1111
if len(all_item) == 1:
1212

1313
item = all_item[0]
14-
data = get_group_data(get_current_hdf5_group(self,item))
14+
data = get_group_data(get_current_hdf5_group(self, item))
1515

1616
if data is None:
1717
list_operations = ['Print attrs']
1818

1919
elif data.ndim == 1:
20-
list_operations = ['Print attrs','-','Plot Hist', 'Plot Line']
20+
list_operations = ['Print attrs',
21+
'-', 'Plot Hist', 'Plot Line']
2122

2223
elif data.ndim == 2:
23-
list_operations = ['Print attrs','-','Plot Hist', 'Plot Map']
24+
list_operations = ['Print attrs',
25+
'-', 'Plot Hist', 'Plot Map']
2426

2527
else:
2628
list_operations = ['Print attrs']
2729

28-
action,actions = get_actions(treeview,position,list_operations)
30+
action, actions = get_actions(
31+
treeview, position, list_operations)
2932

3033
if action == actions['Print attrs']:
31-
send_dict_to_console(self,item,treeview)
34+
send_dict_to_console(self, item, treeview)
3235

3336
if 'Plot Hist' in actions:
3437
if action == actions['Plot Hist']:
35-
plot_histogram(self,item,treeview)
38+
plot_histogram(self, item, treeview)
3639

3740
if 'Plot Line' in actions:
3841
if action == actions['Plot Line']:
39-
plot_line(self,item,treeview)
42+
plot_line(self, item, treeview)
4043

4144
if 'Plot Map' in actions:
4245
if action == actions['Plot Map']:
43-
plot2d(self,item,treeview)
46+
plot2d(self, item, treeview)
4447

4548
elif len(all_item) == 2:
4649

47-
item0,item1 = all_item
50+
item0, item1 = all_item
4851

49-
list_operations = ['Plot Scatter','Plot Line']
50-
action,actions = get_actions(treeview,position,list_operations)
52+
list_operations = ['Plot Scatter', 'Plot Line']
53+
action, actions = get_actions(
54+
treeview, position, list_operations)
5155

5256
if action == actions['Plot Scatter']:
53-
plot1D(self,item0,item1,treeview,plot='scatter')
57+
plot1D(self, item0, item1, treeview, plot='scatter')
5458

5559
if action == actions['Plot Line']:
56-
plot1D(self,item0,item1,treeview,plot='line')
60+
plot1D(self, item0, item1, treeview, plot='line')

0 commit comments

Comments
 (0)