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

Unify help #735

Merged
merged 57 commits into from
Aug 12, 2024
Merged

Unify help #735

merged 57 commits into from
Aug 12, 2024

Conversation

dominikbach
Copy link
Contributor

@dominikbach dominikbach commented Jun 25, 2024

Fixes #23 .

Changes proposed in this pull request: Matlabbatch GUI items follow the logic of using function help wherever possible.
Exceptions:

  • generic help texts in pspm_cfg_selector_... functions
  • GUI-specific hints and help
  • data-type specific help in pspm_import, which is partly summarised in pspm_text. This will be dealt with in a separate PR.
  • pspm_review which has no function help
  • pspm_process_illuminance: function help needs to be modified for pspm_help
  • pspm_pupil_correct: function help needs to be modified for pspm_help

@dominikbach dominikbach marked this pull request as draft June 25, 2024 13:56
@dominikbach dominikbach self-assigned this Jun 25, 2024
@dominikbach dominikbach added the In Progress Currently being worked on label Jun 25, 2024
@dominikbach dominikbach added this to the v7.0 milestone Jun 25, 2024
@dominikbach dominikbach marked this pull request as ready for review July 15, 2024 11:24
@dominikbach dominikbach added Completed & Waiting for Review Completed and waiting for review Improvement A minor improvement to the project GUI Issue An issue related to the GUI and removed In Progress Currently being worked on labels Aug 8, 2024
@teddychao teddychao added Under Review and removed Completed & Waiting for Review Completed and waiting for review labels Aug 8, 2024
@teddychao
Copy link
Contributor

image

I suggest that I can update pspm_cfg_help_format to make sure the output will not start with a blank space or a dot.

% this syntax allows chaining several nested structs into one argname
evalc(sprintf('helptext = settings.help.%s.Arguments.%s;', funcname, argname));
[startindx, endindx] = regexp(helptext, '\[\s*([^\[\]]*)\s*\]'); % thanks ChatGPT for finding the regexp
helptext(startindx:endindx) = [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

startindx and endindx could be 1xn (n>1) array. I would suggest to use transpose in this occasion. Please find screenshot.

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.


ecg2hb_amri_teo_bandpass = cfg_entry;
ecg2hb_amri_teo_bandpass.name = 'TEO bandpass filter';
ecg2hb_amri_teo_bandpass.tag = 'teo_bandpass';
ecg2hb_amri_teo_bandpass.strtype = 'r';
ecg2hb_amri_teo_bandpass.num = [1 2];
ecg2hb_amri_teo_bandpass.val = {[8 40]};
ecg2hb_amri_teo_bandpass.help = {['Define the cutoff frequencies (Hz) for bandpass filter applied to filtered ECG',...
' signal before applying TEO']};
ecg2hb_amri_teo_bandpass.help = pspm_cfg_help_format('pspm_convert_ecg2hb_amri', 'options.teo_bandpass');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just now sure if this is expected...

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

@@ -18,6 +18,7 @@
% │ the first option is used, then use marker channel
% │ indexing in further processing which by default
% │ takes the first marker channel as input
% └.marker_chan_num: any number of marker channel numbers - if undefined
% └.marker_chan_num : any number of marker channel numbers - if undefined
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two duplicated lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

% ├───────.channel: [numeric/string] Channel to be preprocessed.
% Can be a channel ID or a channel name.
% Default is 'emg' (i.e. last EMG channel)
% .channel_action: ['add'/'replace'] Defines whether the new channel should
% be added or the previous outputs of this function should
% be replaced. (Default: 'replace')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line above History section. Better to delete it to avoid potential mis-recognition.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

Copy link
Contributor

@teddychao teddychao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested all the functions that use pspm_cfg_help_format and found them running ok.
Just minor changes could be useful....

@teddychao teddychao added Approved The pull request has been approved and can be checked and then merged. and removed Under Review labels Aug 11, 2024
@dominikbach dominikbach merged commit f3906bf into develop Aug 12, 2024
1 check passed
@dominikbach dominikbach deleted the unify-help branch August 12, 2024 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved The pull request has been approved and can be checked and then merged. GUI Issue An issue related to the GUI Improvement A minor improvement to the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Find a way to fix documentation duplication
2 participants