Skip to content

Conversation

ninsbl
Copy link
Member

@ninsbl ninsbl commented Sep 2, 2025

This PR appends semantic labels to the basename when expression is given for extraction of raster maps and handles fully qualified STRDS names more reliably. It also adds a pytest based testcase.

Fixes #6254

@ninsbl ninsbl requested review from echoix and wenzeslaus September 2, 2025 19:34
@ninsbl ninsbl added bug Something isn't working temporal Related to temporal data processing Python Related code is in Python libraries labels Sep 2, 2025
@ninsbl ninsbl added this to the 8.4.2 milestone Sep 2, 2025
Comment on lines 167 to 170
for k, v in expected_info.items():
assert (
strds_info[k] == v
), f"Expected value for key '{k}' is {v}. Got: {strds_info[k]}"
Copy link
Member

Choose a reason for hiding this comment

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

Was the default behavior of pytest not enough for dictionaries when developing your tests?

(Like for a bad value, missing, and extra keys)

Copy link
Member Author

Choose a reason for hiding this comment

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

I wanted to check only a subset of the metadata keys. And unfortunately, it did not print out the key when I compared values are as expected. Are you aware of any build-in methods in pytest that would allow to test if a dictionary is covered by another (regardless of the order of keys and the like...)? I would be happy to adjust and drop the loop...

@github-actions github-actions bot added module tests Related to Test Suite labels Sep 2, 2025
Copy link
Member

@wenzeslaus wenzeslaus left a comment

Choose a reason for hiding this comment

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

I didn't check this 100%, but generally it looks good.

ninsbl and others added 4 commits October 14, 2025 09:27
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@ninsbl
Copy link
Member Author

ninsbl commented Oct 18, 2025

I had to address semantic_labels better as well. They were introduced after the extract module was created... The new tests cover semantic labels...

@ninsbl ninsbl requested a review from wenzeslaus October 18, 2025 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working libraries module Python Related code is in Python temporal Related to temporal data processing tests Related to Test Suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] t.rast.extract: expression fails with fully qualified STRDS name if STRDS and mapset name are identical

3 participants