Update loadPSCMfile.m#2664
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ae35fcc467
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| % Check if fileName can be found | ||
| if isempty(which(nameOfWBM)) | ||
| if ~isfile(nameOfWBM) |
There was a problem hiding this comment.
Restore MATLAB-path lookup for default WBM loads
When loadPSCMfile('Harvey') or loadPSCMfile('Harvetta') is called without searchDirectory, findLatestWBM searches the toolbox data directory on the MATLAB path but returns only the bare filename; isfile(nameOfWBM) only checks that name in the current folder or an explicit path, so the code falls into the empty-searchDirectory error even though the .mat is on the MATLAB path. This regresses the documented default path search and affects existing callers such as persWBM and setInSilicoDiet unless MATLAB happens to be running from the WBM data folder.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Checked on my machine and this is not a problem as line 72-76 the search directory is searched if the file name exists and if the the directory is not added on the file name it does so in line 76.
Summary:
Failed Tests:No failed tests ✨ Github Test Reporter by CTRF 💚 |
Changed code to use isfile instead of which.
This removes a bug where the WBM cannot be read if it is not on the path, but it does exist locally on the machine reducing confusion why models cannot be loaded.
I hereby confirm that I have:
developas a target branch (top left drop-down menu)