Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable export fitting when no file is loaded #882

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyrs/interface/peak_fitting/event_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def load_and_plot(self, hidra_file_name):
o_gui.enabled_sub_runs_interation_widgets(True)
# o_gui.enabled_fitting_widgets(True)
o_gui.enabled_data_fit_plot(True)
o_gui.enabled_export_csv_widgets(False)
o_gui.enabled_peak_ranges_widgets(True)
o_gui.enabled_1dplot_widgets(True)

Expand Down
29 changes: 16 additions & 13 deletions pyrs/interface/peak_fitting/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,22 @@ def select_output_folder(self):
self._csv_file_name = os.path.join(out_folder, self.parent._project_name + '.csv')

def create_csv(self):
peaks = self.parent.fit_result.peakcollections
sample_logs = self.parent.hidra_workspace._sample_logs

print("sample_log: {}".format(sample_logs))

generator = SummaryGenerator(self._csv_file_name,
log_list=sample_logs.keys())
generator.setHeaderInformation(dict())
generator.write_csv(sample_logs, peaks)

new_message = self.parent.current_root_statusbar_message + "\t\t\t\t Last Exported CSV: {}" \
"".format(self._csv_file_name)
self.parent.ui.statusbar.showMessage(new_message)
try:
peaks = self.parent.fit_result.peakcollections
sample_logs = self.parent.hidra_workspace._sample_logs

print("sample_log: {}".format(sample_logs))

generator = SummaryGenerator(self._csv_file_name,
log_list=sample_logs.keys())
generator.setHeaderInformation(dict())
generator.write_csv(sample_logs, peaks)

new_message = self.parent.current_root_statusbar_message + "\t\t\t\t Last Exported CSV: {}" \
"".format(self._csv_file_name)
self.parent.ui.statusbar.showMessage(new_message)
except AttributeError:
pass

def _retrieve_project(self):
_hidra_project_file = self.parent.hidra_workspace._project_file
Expand Down
Loading