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

Dump optimized thresholds for buildings as a yaml file #109

Merged
merged 2 commits into from
Apr 18, 2024

Conversation

leavauchier
Copy link
Collaborator

Solves #92.

Use yaml to make it easier to copy-paste to a configuration file

TMP_DIR = Path("tmp/lidar_prod/tasks/building_validation_optimization")


def setup_module(module):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you consider using a temporary dir obtained using tempfile instead? Or is there a reason to hardcode this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the reason decided to hardcode this is to be able to have a look at the generated results (mainly in case the test fails)

TMP_DIR.mkdir(parents=True, exist_ok=True)


def test_BuildingValidationOptimizer_run(hydra_cfg):
Copy link
Collaborator

Choose a reason for hiding this comment

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

This test, while simpler, seems redundant with other tests for the BVO in https://github.com/IGNF/lidar-prod/blob/yaml-thresholds/tests/lidar_prod/test_optimization.py
It also seems that you added new optimization files to /tests/files/ instead of relying on the previous ones. Is there a reason to this?

It's probably a good reason to merge the two, and to assert the existing of output files like you do in this version.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't understand the point of merging both tests: if that test fails we know it's the save/load function, if the other fails we know it's something else. What would be the point of merging?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The point is just to avoid duplicate code by adding this new assertion on the threshold file to the already existing test

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

However, I'd rather move the test on BuildingValidationOptimizer to test_building_validation_optimization.py to ensure consistency between the test files directory and the library files directory

Copy link
Collaborator

@CharlesGaydon CharlesGaydon left a comment

Choose a reason for hiding this comment

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

The change of file format itself seems ok. However, I think you may be duplicating tests and test data for the optimization of thresholds.
I suggest simplifying the test, perhaps by simply adding more test assertions to the existing ones in test_optimization.

Current structure separes end-to-end tests (test_application,tesrt_optimization) from uni tests (in subfolder).

On a side note, it seems that there are some older test files (shapefiles) that may not be used anymore:
image

@leavauchier
Copy link
Collaborator Author

leavauchier commented Apr 18, 2024

On a side note, it seems that there are some older test files (shapefiles) that may not be used anymore:

870000_6618000.subset.postIA.las and 870000_6618000.subset.postIA.shp are used in test_application.py
the other 870000_6618000.subset.postIA.* are side files for the .shp file. So they should not be removed

@CharlesGaydon
Copy link
Collaborator

LGTM :)

@leavauchier leavauchier merged commit 969019c into main Apr 18, 2024
1 check passed
@leavauchier leavauchier deleted the yaml-thresholds branch April 18, 2024 12:45
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.

Format json pour les seuils de décision optimisé pour qu'ils soient lisibles.
3 participants