Skip to content

Update loadPSCMfile.m#2664

Merged
farid-zare merged 1 commit into
opencobra:developfrom
bramnap:develop
May 29, 2026
Merged

Update loadPSCMfile.m#2664
farid-zare merged 1 commit into
opencobra:developfrom
bramnap:develop

Conversation

@bramnap
Copy link
Copy Markdown
Contributor

@bramnap bramnap commented May 28, 2026

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:

  • Tested my code on my own machine
  • Followed the guidelines in the Contributing Guide
  • Selected develop as a target branch (top left drop-down menu)

@farid-zare
Copy link
Copy Markdown
Collaborator

@codex

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@github-actions
Copy link
Copy Markdown
Contributor

Summary:

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️
257 222 0 35

Failed Tests:

No failed tests ✨

Github Test Reporter by CTRF 💚

@farid-zare farid-zare merged commit 53e7feb into opencobra:develop May 29, 2026
1 check passed
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.

2 participants