Skip to content

Conversation

@Dooruk
Copy link
Collaborator

@Dooruk Dooruk commented Aug 28, 2025

The regex change abs was replacing absoluteDynamicTopography from the ocean obs. It took me a bit to identify this bug..

@Dooruk Dooruk added the bug Something is not working label Aug 28, 2025
@Dooruk Dooruk requested review from Copilot and karpob August 28, 2025 16:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a regex bug where function names were being incorrectly matched as substrings, causing unintended replacements. The fix adds word boundaries to ensure exact function name matching in arithmetic expressions.

  • Adds word boundary anchors (\b) to regex pattern for function names in arithmetic expressions
  • Updates package version constraints in requirements file to use more flexible versioning

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/eva/transforms/arithmetic.py Fixes regex pattern to prevent partial function name matches
requirements_sles15.txt Updates package version constraints for better compatibility

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <[email protected]>
@Dooruk Dooruk requested a review from CoryMartin-NOAA August 28, 2025 16:19
@Dooruk
Copy link
Collaborator Author

Dooruk commented Aug 28, 2025

Sorry to bug you for this bug @CoryMartin-NOAA but I need write approval.

@Dooruk
Copy link
Collaborator Author

Dooruk commented Aug 28, 2025

Also @mranst apparently this was my problem with EVA, not the package versions.

GEOS-ESM/swell#549

@karpob
Copy link
Collaborator

karpob commented Aug 28, 2025

This looks reasonable to me, I feel like there must be a better way to do what arithmetic does in general. Using regex for this seems like there may be unintended consequences based on what the user may input.

@CoryMartin-NOAA CoryMartin-NOAA merged commit 55bc615 into develop Aug 28, 2025
5 checks passed
@CoryMartin-NOAA CoryMartin-NOAA deleted the bugfix/regex_arithmetic branch August 28, 2025 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is not working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants