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

Cif 247 increase unit test coverage for cif #75

Merged
merged 15 commits into from
Sep 13, 2024

Conversation

kcartier-wri
Copy link
Contributor

Further increasing test coverage.

Copy link
Contributor

@chrowe chrowe left a comment

Choose a reason for hiding this comment

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

There is a lot to review here. I gave it a quick pass and all seams reasonable but I don't know if it is worth reviewing every test one by one to check that it is actually testing what I think it should be.

I also ran pytest locally but it failed to run and when I tried to update my environment it failed because exactextract was not available. Maybe worth getting Github Actions to run using Conda?

@kcartier-wri
Copy link
Contributor Author

I'm now testing how to create GitHub Actions workflow using Conda.

…ons' into CIF-247-Increase-unit-test-coverage-for-CIF
@kcartier-wri kcartier-wri marked this pull request as ready for review September 13, 2024 15:28
@kcartier-wri kcartier-wri requested a review from chrowe September 13, 2024 15:28
Copy link
Contributor

@chrowe chrowe left a comment

Choose a reason for hiding this comment

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

I tried conda env update -f environment.yml --prune on my existing cities-cif Conda environment but it failed.
Then I tried creating a new Conda environment and that built fine.

All tests passed (except the 2 skipped ones). Why not just remove these since the layers are deprecated?

Copy link
Member

@jterry64 jterry64 left a comment

Choose a reason for hiding this comment

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

Some minor comments to increase clarity

tests/test_layer_dimensions.py Outdated Show resolved Hide resolved
expected_y_dimension = 20
assert data.dims == {"x": expected_x_dimension, "y": expected_y_dimension}

def test_albedo_dimensions():
Copy link
Member

Choose a reason for hiding this comment

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

Is "dimensions" abstract here or mean x/y dimensions? It feels like you're mostly test x/y dimensions, but then actually test stats about the values in these two functions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"Dimensions" was abstract and I've renamed. I also renamed the overall file to "test_layer_metrics" and added a description near top of file.

tests/test_layer_dimensions.py Outdated Show resolved Hide resolved
@kcartier-wri kcartier-wri mentioned this pull request Sep 13, 2024
@kcartier-wri
Copy link
Contributor Author

@jterry64 - Good points about the previous test_layer_dimensions.py (now test_layer_metrics) file. It is on my list of things to improve, so thank you for highlighting the file.
It may also be a good idea to include thest individual tests in the test_layers file in order to reduce testing run time.

@kcartier-wri kcartier-wri requested review from jterry64 and chrowe and removed request for chrowe and weiqi-tori September 13, 2024 21:43
@kcartier-wri kcartier-wri merged commit 50e39dc into main Sep 13, 2024
1 check passed
@kcartier-wri kcartier-wri deleted the CIF-247-Increase-unit-test-coverage-for-CIF branch September 13, 2024 23:50
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.

3 participants