Skip to content

Commit

Permalink
trying to fix display bug but without success so far. this refs #91
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanBilheux committed Feb 1, 2022
1 parent 7e37348 commit 4f1ff42
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ dependencies:
- tk=8.5.18=0
- wheel=0.29.0=py27_0
- zlib=1.2.8=0

- pyqtgraph=0.12.1
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pandas==0.19.2
Pillow==8.3.2
progressbar2==3.6.2
#pyfits==3.4
pyqtgraph==0.9.10
pyqtgraph==0.12.1
pytest==2.9.1
scikit-image==0.12.3
scipy==0.19.0
Expand Down
2 changes: 1 addition & 1 deletion requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pillow=3.4.2=py27_0
pip=8.1.1=py27_1
ptyprocess=0.5=py27_0
pyqt=4.11.4=py27_4
pyqtgraph=0.9.10=py27_1
pyqtgraph=0.12.1
python=2.7.11=0
python-dateutil=2.5.2=py27_0
pytz=2016.3=py27_0
Expand Down
5 changes: 5 additions & 0 deletions src/iBeatles/fitting/initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ def run_all(self):
self.global_data()
self.statusbar()
self.matplotlib()
self.tab()

def tab(self):
self.parent.ui.tabWidget.setTabIndex(1)
self.parent.ui.tabWidget.setTabEnabled(0, False)

def statusbar(self):
self.parent.eventProgress = QProgressBar(self.parent.ui.statusbar)
Expand Down
1 change: 1 addition & 0 deletions src/iBeatles/iBeatles.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ def list_of_element_index_changed(self, index):
BraggEdgeElementHandler(parent=self)
o_plot = Step1Plot(parent=self, data_type='sample')
o_plot.display_general_bragg_edge()
self.roi_image_view_changed()
self.ui.list_of_elements_2.blockSignals(False)

def list_of_element_2_index_changed(self, index):
Expand Down
5 changes: 3 additions & 2 deletions src/iBeatles/step1/data_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def import_files_from_folder(self, folder='', extension=".fits"):
logging.info(f"importing files from folder with extension: {extension}")
if folder == '':
self.user_canceled = True
return ''
return False

if type(extension) is list:
for _ext in extension:
Expand All @@ -70,7 +70,7 @@ def import_files_from_folder(self, folder='', extension=".fits"):
message=f"Folder selected is empty or contains the wrong file formats!",
status=StatusMessageStatus.error,
duration_s=5)
return
return False

logging.info(f" len(list_of_files) = {len(list_of_files)}")
if len(list_of_files) > 2:
Expand All @@ -80,6 +80,7 @@ def import_files_from_folder(self, folder='', extension=".fits"):
else:
logging.info(f" list_of_files = {list_of_files}")
self.load_files(list_of_files)
return True

def import_time_spectra(self):
if not (self.parent.data_metadata[self.data_type]['data'] is None):
Expand Down
6 changes: 4 additions & 2 deletions src/iBeatles/step1/event_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ def import_button_clicked(self):
o_load = DataHandler(parent=self.parent,
data_type=self.data_type)
_folder = o_load.select_folder()
o_load.import_files_from_folder(folder=_folder)
state = o_load.import_files_from_folder(folder=_folder)

if self.parent.data_metadata[self.data_type]['data'].any():
if state:
# if self.parent.data_metadata[self.data_type]['data']:
# # if self.parent.data_metadata[self.data_type]['data'].any():

o_load.import_time_spectra()
self.parent.select_load_data_row(data_type=self.data_type, row=0)
Expand Down

0 comments on commit 4f1ff42

Please sign in to comment.