Skip to content

Commit

Permalink
patch on List available volunteer display and new publish
Browse files Browse the repository at this point in the history
  • Loading branch information
seb5g committed Sep 30, 2021
1 parent 05a372a commit 7e1035b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Byte-compiled / optimized / DLL files
__pycache__/


*.pyc

*.py[cod]
*$py.class
Expand Down Expand Up @@ -121,3 +121,4 @@ venv.bak/
.tox
*.h5
src/gevt.egg-info/PKG-INFO
src/gevt/__pycache__/gevt.cpython-38.pyc
2 changes: 1 addition & 1 deletion src/gevt/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.15
0.1.16
Binary file modified src/gevt/__pycache__/gevt.cpython-38.pyc
Binary file not shown.
14 changes: 7 additions & 7 deletions src/gevt/gevt.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,8 @@ def data(self, index=QtCore.QModelIndex(), role=QtCore.Qt.DisplayRole):

else:
ind_time = index.column() - 2
start = self.volunteer_table[index.row()]['time_start'][ind_time]
stop = self.volunteer_table[index.row()]['time_end'][ind_time]
start = self.volunteer_table[self.list_ids[index.row()]]['time_start'][ind_time]
stop = self.volunteer_table[self.list_ids[index.row()]]['time_end'][ind_time]
if not (start == -1 or stop == -1):
s = datetime.datetime.fromtimestamp(start).strftime(
'%H:%M') + ' -> ' + datetime.datetime.fromtimestamp(stop).strftime('%H:%M')
Expand Down Expand Up @@ -1485,12 +1485,12 @@ def __init__(self, row=None, ts=None, te=None, picker_type='task', h5file=None,
self.add = True # True if pick dialog is called to add some element of the list,

if h5file is not None:
self.task_table=self.h5file.get_node('/tasks/tasks_table')
self.volunteer_table=self.h5file.get_node('/volunteers/volunteer_table')
self.task_table = self.h5file.get_node('/tasks/tasks_table')
self.volunteer_table = self.h5file.get_node('/volunteers/volunteer_table')
else:
raise Exception('No valid h5 file')
if row is not None and ts is not None and te is not None:
self.list_ids = self.check_availlable(row,ts,te)
self.list_ids = self.check_availlable(row, ts, te)
else:
self.list_ids = ids

Expand Down Expand Up @@ -1533,7 +1533,7 @@ def check_availlable(self,vol_row,time_start,time_end,selected_ids=[], id_to_not
task['idnumber'] in affected_tasks_ids]
#TODO check if below is correct in differents cases
test = []
for ind in range (vol_row['time_start'].size):
for ind in range(vol_row['time_start'].size):
overlap = get_overlap([time_start, time_end], [vol_row['time_start'][ind], vol_row['time_end'][ind]])
test.append(overlap >= (time_end - time_start))
#µtest = np.stack((time_start >= vol_row['time_start'], time_end <= vol_row['time_end'])) # test if this task (time_start,time_send) is compatible with volunteer presence
Expand Down Expand Up @@ -2401,7 +2401,7 @@ def new_file(self):
event_save_dir = Path(event_save_dir)


self.h5file = tables.open_file(event_save_dir.joinpath(event_name+'.gev'), mode='w', title='List of Tasks and volunteers for '+
self.h5file = tables.open_file(str(event_save_dir.joinpath(event_name+'.gev')), mode='w', title='List of Tasks and volunteers for '+
event_name)
self.h5file.root._v_attrs['event_save_dir'] = event_save_dir
self.h5file.root._v_attrs['event_name'] = event_name
Expand Down

0 comments on commit 7e1035b

Please sign in to comment.