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

i.smap: add test file #5413

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jayneel-shah18
Copy link
Contributor

This PR introduces a comprehensive test suite for the i.smap GRASS GIS module, validating its functionality. The suite ensures the robustness of classification algorithms.

Key Updates in this PR

  • Synthetic Data Generation: Procedurally generates test data using mathematical expressions.
  • Basic Classification Test: Validates correct classification into distinct classes.
  • Goodness Map Test: Checks the accuracy of the goodness-of-fit map.
  • Maximum Likelihood Estimation Test: Ensures correct application of the -m flag.
  • Block Size Consistency Test: Evaluates the stability of results across different block sizes.

Test Case Descriptions

  1. Basic Classification Test
    • Verifies that the classification using i.smap produces the expected number of distinct classes.
  2. Goodness Map Generation
    • Assesses the correctness of the goodness map by comparing statistical properties against reference values.
  3. Maximum Likelihood Estimation Validation
    • Ensures proper application of the -m flag and evaluates the classification accuracy using r.kappa.
  4. Block Size Impact
    • Compares outputs across different block sizes to validate result consistency.

Performance

  • Windows: 2.862s
  • macOS: 1.486s
  • Ubuntu: 2.393s

This test suite significantly enhances the reliability of the i.smap module by covering both core functionalities and edge cases. Looking forward to feedback and potential refinements!

@github-actions github-actions bot added Python Related code is in Python module imagery tests Related to Test Suite labels Mar 18, 2025
cls.runModule("g.remove", flags="f", type="group", name=cls.group_name)
cls.temp_rasters.append(cls.output_map)
cls.runModule("g.remove", flags="f", type="raster", name=cls.temp_rasters)
cls.runModule("g.remove", flags="f", type="raster", name=cls.signature_file)
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be different type, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed it to use i.signatures remove.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imagery module Python Related code is in Python tests Related to Test Suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants