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

revise strings comparison in src/+parameters/loadParameters.m #250

Merged
merged 2 commits into from
Aug 22, 2024

Conversation

Crystal-szj
Copy link
Contributor

@Crystal-szj Crystal-szj commented Aug 11, 2024

Description

This pull request is used to revise the function for comparing two strings in loadParameters.m. The modification aims to enable STEMMUS-SCOPE to throw warming messages under the following conditions:

  1. variables defined in ScopeParameters are not found at the input_data.xlsx,
  2. extra parameters are added in ScopeParameters.

This modification will not change the outputs of STEMMUS-SCOPE.

Checklist

  • Add a reference to related issues.
  • @mentions of the person or team responsible for reviewing proposed changes.
  • This pull request has a descriptive title.
  • Code is written according to the guidelines.
  • The checks by MISS_HIT style checker and linter, below the pull request, are successful (green).
  • Documentation is available.
  • Add changes to the changelog file under section Unreleased.
  • Model runs successfully.
  • Ask a meinatainer to re-generate exe file if matlab codes are changed. About how to create an exe file, see exe readme.

closes #248

@Crystal-szj Crystal-szj mentioned this pull request Aug 11, 2024
9 tasks
@Crystal-szj Crystal-szj self-assigned this Aug 11, 2024
@Crystal-szj Crystal-szj added the bug Something isn't working label Aug 11, 2024
@Crystal-szj
Copy link
Contributor Author

Hi @SarahAlidoost, could you please help to review this pull request?

@MostafaGomaa93
Copy link
Contributor

Hi @Crystal-szj, I have also checked your PR and it looks fine. You mainly change the sign (==) with the strcmp() method for string comparison. Maybe one thing if you could help clarify, what was the reason of the error message in the related issue 248?

@Crystal-szj
Copy link
Contributor Author

Crystal-szj commented Aug 16, 2024

Hi @Crystal-szj, I have also checked your PR and it looks fine. You mainly change the sign (==) with the strcmp() method for string comparison. Maybe one thing if you could help clarify, what was the reason of the error message in the related issue 248?

Hi @MostafaGomaa93 thanks a lot for your help and reviewing.
The issue #248 is used to check if the variables defined in ScopeParametersNames are initialized in the input_data.xlsx file.

ScopeParametersNames = {
'Cab', 'Cca', 'Cdm', 'Cw', 'Cs', 'N', 'rho_thermal', 'tau_thermal', ...
'Vcmo', 'm', 'Type', 'kV', 'Rdparam', 'Tparam', 'fqe', 'spectrum', ...
'rss', 'rs_thermal', 'cs', 'rhos', 'lambdas', 'LAI', 'hc', 'zo', 'd', ...
'LIDFa', 'LIDFb', 'leafwidth', 'z', 'Rin', 'Ta', 'Rli', 'p', 'ea', 'u', ...
'Ca', 'Oa', 'rb', 'Cd', 'CR', 'CD1', 'Psicor', 'CSSOIL', 'rbs', 'rwc', ...
'startDOY', 'endDOY', 'LAT', 'LON', 'timezn', 'tts', 'tto', 'psi', 'SMC', ...
'Tyear', 'beta', 'kNPQs', 'qLs', 'stressfactor', 'Cant', 'BSMBrightness', ...
'BSMlat', 'BSMlon', 'BallBerry0'
};

For example, if we add one parameter named g1 in ScopeParametersNames in the code, but don't add it in the input_data.xlsx file, or we only add g1 in the input_data.xlsx but without setting an initial value for it, there should be a warming message to remind us to set an initial value for the newly added variable g1.

@SarahAlidoost
Copy link
Member

SarahAlidoost commented Aug 19, 2024

Hi @SarahAlidoost, could you please help to review this pull request?

@Crystal-szj Thanks for the fixes, please go ahead with merging. 👍

@Crystal-szj Crystal-szj merged commit dd4764b into main Aug 22, 2024
1 check passed
@Crystal-szj Crystal-szj deleted the issue248 branch August 22, 2024 12:33
Crystal-szj added a commit that referenced this pull request Aug 26, 2024
Merge pull request #250 fro EcoExtreML/issue248
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Arrays have incompatible sizes for this operation" errror on strings comparison
3 participants