Skip to content

Warn if LUT keys are close to known geometry keys#664

Merged
pgbrodrick merged 2 commits into
isofit:devfrom
jammont:issues/602
Apr 21, 2025
Merged

Warn if LUT keys are close to known geometry keys#664
pgbrodrick merged 2 commits into
isofit:devfrom
jammont:issues/602

Conversation

@jammont

@jammont jammont commented Apr 7, 2025

Copy link
Copy Markdown
Collaborator

Addresses an issue in #602 where a LUT had the key surface_elevation but ISOFIT expects it to be named surface_elevation_km. This PR implements a function in core/common.py to compare LUT keys with the known geometry keys and if there's an 80% match, output a warning to the user to possibly change it

James Montgomery added 2 commits April 7, 2025 13:29
@pgbrodrick

Copy link
Copy Markdown
Collaborator

Thanks!

Is the logic behind the 80% match to be fuzzy on syntax? And....do we want that, or should we force things to be exact? I assume from the implementation you had a case in mind, can you elaborate?

@jammont

jammont commented Apr 8, 2025

Copy link
Copy Markdown
Collaborator Author

Yes, I made it fuzzy so that we can attempt to detect close to but not exact keys in the lut_grid config to those in the geometry keys list. The example in the ticket had surface_elevation, but it needed to be surface_elevation_km. In this case, we could do a simple is in for detection, but I figure a fuzzy match allows us to catch typos as well, like surface_elevation_kn

@pgbrodrick pgbrodrick merged commit 559bc12 into isofit:dev Apr 21, 2025
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