Skip to content

Update python handling and tests#658

Merged
dominikbach merged 37 commits intodevelopfrom
649-tests_for_pspm_check_python_and_pspm_check_python_modules
Apr 17, 2024
Merged

Update python handling and tests#658
dominikbach merged 37 commits intodevelopfrom
649-tests_for_pspm_check_python_and_pspm_check_python_modules

Conversation

@MadniAbdulWahab
Copy link
Copy Markdown
Contributor

@MadniAbdulWahab MadniAbdulWahab commented Mar 14, 2024

Fixes #649.

Summary

  • Created test functions for pspm_check_python and pspm_check_python_modules.

New files

  • src/py_find_location.py
    • This python file can detect the location of python source in the system.
  • pspm_check_python.m
    • The file can check if python environment has been set up in the system.
  • test/pspm_check_python
    • The test function can automatically detect python in any system by using pspm_find_python. No user specification is required. However, it needs that Python has been installed in the system.
  • test/pspm_check_python_modules_test
    • Due to complexity, I disabled the checking of "no module". The Python library in the GitHub environment seems to have got some packages, and it is tricky to remove them first.
  • src/pspm_find_python.m
    • This is a new file that can detect python package in the system with two modes
      • Mode 1: automatically load from system. This mode only relies on src/py_find_location.py and do not require users to specify first.
      • Mode 2: it load python from a specific path. If users have previously defined python path (in this case the path will be saved as py_loc.txt), the function can use this saved text file to load python.
    • This function has been updated to support both windows and unix.

Minor changes

  • main.yml (Github actions)
    • Python environment was set up by updating the main.yml file.
  • .gitignore
    • The Python location file has been ignored.
  • src/pspm_cfg/pspm_cfg_python.m
    • The description of Python environment has been adjusted. Users do not need to specify Python before they can use the auto detection feature. The python detection code is done with Python's own script and does not need users to specify first.
  • src/pspm_cfg/pspm_cfg_run_pp_heart_data.m
    • Now the auto mode can detect python correctly.

@MadniAbdulWahab MadniAbdulWahab added the Completed & Waiting for Review Completed and waiting for review label Mar 14, 2024
@dominikbach dominikbach requested a review from teddphil March 14, 2024 15:16
Comment thread test/pspm_check_python_modules_test.m Outdated
Comment thread test/pspm_check_python_test.m Outdated
@teddphil
Copy link
Copy Markdown

I am not sure I understand what test functions want to test, such as whether it wants to test if they are able to detect the python packages or what platforms they want to test.

Copy link
Copy Markdown

@teddphil teddphil left a comment

Choose a reason for hiding this comment

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

@MadniAbdulWahab Would you mind listing some goals of these test functions? Some specifications may be helpful, such as whether it wants to detect python path itself or it wants users to specify them. Thank you.

@teddphil teddphil added Waiting for Feedbacks Waiting for feedbacks from the user Changes Requested Authors are requested to make changes and removed Completed & Waiting for Review Completed and waiting for review Waiting for Feedbacks Waiting for feedbacks from the user labels Mar 16, 2024
@teddphil teddphil self-assigned this Apr 8, 2024
@teddphil teddphil added In Progress Currently being worked on and removed Changes Requested Authors are requested to make changes labels Apr 8, 2024
@teddphil teddphil changed the title Test functions for pspm_check_python and pspm_check_python_modules Update python handling and tests Apr 15, 2024
@teddphil teddphil requested a review from dominikbach April 15, 2024 15:21
@teddphil teddphil added Completed & Waiting for Review Completed and waiting for review and removed In Progress Currently being worked on labels Apr 15, 2024
@teddphil
Copy link
Copy Markdown

Updated UI
Now users will have to specify the path of python before run heart data pre-processing with heartPy
image

image

Teddy added 3 commits April 16, 2024 18:44
help text was inappropriate, and the auto mode should be deleted
@dominikbach dominikbach dismissed teddphil’s stale review April 17, 2024 05:33

Reviewer & assignee changed.

@dominikbach dominikbach merged commit b768954 into develop Apr 17, 2024
@dominikbach dominikbach deleted the 649-tests_for_pspm_check_python_and_pspm_check_python_modules branch April 17, 2024 05:33
@teddphil teddphil removed the Completed & Waiting for Review Completed and waiting for review label Jun 2, 2024
@teddphil teddphil added this to the v7.0 milestone Sep 30, 2024
@teddphil teddphil mentioned this pull request Sep 30, 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.

create tests for pspm_check_python and pspm_check_python_modules

3 participants