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

Bugfix when reading mapping table in lai lulc workflow #290

Merged
merged 4 commits into from
Sep 12, 2024
Merged

Conversation

shartgring
Copy link
Collaborator

Issue addressed

Fixes #289

Explanation

An error was raised because the columns 1 to 12 could not be found. This is caused by reading them as a string. This is solved by checking if there are digit columns and converting them to integers. This has been tested with a Wflow model for which a mapping table was created with setup_lulcmaps, and which is read by setup_laimaps_from_lulc_mapping in lai_mapping_fn.

Checklist

  • Updated tests or added new tests
  • Branch is up to date with main
  • Tests & pre-commit hooks pass
  • Updated documentation if needed

Additional Notes (optional)

Add any additional notes or information that may be helpful.

@shartgring shartgring changed the title convert columns from str to int in lai lulc workflow Bugfix when reading mapping table in lai lulc workflow Sep 11, 2024
@shartgring
Copy link
Collaborator Author

shartgring commented Sep 11, 2024

First test failed as it now had trouble reading integer columns! Not anymore now

I tried to keep it a simple bugfix, hence converting it to string to do .isdigit(). It covers now both int and str columns. Don't think we need more support within this workflow?

@shartgring shartgring requested a review from hboisgon September 11, 2024 14:37
Copy link
Contributor

@hboisgon hboisgon left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for fixing it @shartgring !

@shartgring shartgring merged commit 6010782 into main Sep 12, 2024
6 checks passed
@shartgring shartgring deleted the bugfix_lai branch September 12, 2024 07:15
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.

Parameter(s) missing in mapping file: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
2 participants