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

Fix issue 668 -- added path handling in pspm_init and pspm_quit #713

Merged
merged 18 commits into from
Jul 16, 2024

Conversation

MadniAbdulWahab
Copy link
Contributor

Fixes #668 .

Changes proposed in this pull request:

  • Defined directories and added necessary paths in pspm_init.
  • Removed the paths in pspm_quit which were added in pspm_init.

@teddychao teddychao added the Changes Requested Authors are requested to make changes label Jun 10, 2024
@teddychao
Copy link
Contributor

I think the PsPM folders in this list shall be excluded into the path list for being added to MATLAB.
image
It is recommended to only add those folders instead of folders and their subfolders.

@teddychao teddychao self-requested a review June 10, 2024 15:23
src/pspm_init.m Outdated Show resolved Hide resolved
@teddychao teddychao self-assigned this Jun 17, 2024
@teddychao teddychao added In Progress Currently being worked on and removed Changes Requested Authors are requested to make changes labels Jun 17, 2024
@teddychao teddychao marked this pull request as draft June 17, 2024 15:54
@teddychao teddychao marked this pull request as ready for review July 1, 2024 01:32
@teddychao
Copy link
Contributor

This is now finished.

Before starting PsPM
image

When PsPM is running
image

After quitting PsPM
image

@teddychao teddychao added Completed & Waiting for Review Completed and waiting for review and removed In Progress Currently being worked on labels Jul 1, 2024
@teddychao
Copy link
Contributor

teddychao commented Jul 1, 2024

Discussion 01.07.2024

The key tasks

  1. The subfolders may cause issues if they are all added to MATLAB. The essential subfolders need to be identified. Other folders which may cause conflicts shall be excluded to the subfolder list (the essential subfolders).
  2. SPM may cause incompatibility when users run PsPM with SPM path added. This shall be solved by adding a warning in pspm_init and asking users to remove SPM.
  3. The subfolder list shall be updated at the beginning of pspm_init. This needs to be managed by PsPM automatically without asking users to do that.

@dominikbach
Copy link
Contributor

To add on the previous points:

  1. If SPM or Matlabbatch installations (outside PsPM folders) are on the path already, interrupt start up and give an error.
  2. If any conflicting PsPM subfolders are on the path, interrupt startup and give an error.
  3. Add root (src) folder to list of essential folders to be added to the path on startup.

@teddychao
Copy link
Contributor

teddychao commented Jul 15, 2024

This is currently finished.

The logic is

  • If MATLAB has not added any path of SPM or subfolders, PsPM will automatically add the required folders, such as Import, to the path of MATLAB. When PsPM exists, these PsPM's path will be deleted from MATLAB's path.
  • If there is SPM added to MATLAB, PsPM will ask users to delete these SPM path from MATLAB, and when PsPM quits, such SPM path will be add back.
    • If users refuse to remove SPM path, PsPM will stop and send a warning in Terminal.
  • The logic of subfolders follows the logic of SPM folder handling.

@teddychao
Copy link
Contributor

teddychao commented Jul 15, 2024

Examples

Warning dialog
image

Error
image

@teddychao
Copy link
Contributor

Hi @dominikbach This has been completed. Please may I ask you to test and let me know if you are happy with this version. Thanks.

@teddychao teddychao changed the title added path handling in pspm_init and pspm_quit Fix issue 668 -- added path handling in pspm_init and pspm_quit Jul 15, 2024
@dominikbach dominikbach merged commit 38cccad into develop Jul 16, 2024
1 check passed
@dominikbach dominikbach deleted the 668-Path-Handling branch July 16, 2024 16:46
@teddychao teddychao removed the Completed & Waiting for Review Completed and waiting for review label Aug 5, 2024
@teddychao teddychao added this to the v7.0 milestone Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Path handling in pspm_init and pspm_quit
3 participants