Skip to content

Input damages pytests#68

Merged
kemccusker merged 36 commits intodscim-v0.4.0from
input_damages_pytests
May 3, 2023
Merged

Input damages pytests#68
kemccusker merged 36 commits intodscim-v0.4.0from
input_damages_pytests

Conversation

@davidrzhdu
Copy link
Copy Markdown
Contributor

@davidrzhdu davidrzhdu commented Feb 1, 2023

This pull request adds pytests for processing all sector spatial input damages.

@JMGilbert
Copy link
Copy Markdown
Contributor

Currently the below lines of code are not being tested in one of the functions that you wrote a test for:

except Exception as e:
logger.error(f"Error in batch{i}: {e}")
pass

It's relatively minor, but writing a case for this intended error is what we have been doing.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 9, 2023

Codecov Report

Merging #68 (8bdc1ee) into dscim-v0.4.0 (096042f) will increase coverage by 12.12%.
The diff coverage is 100.00%.

@@                Coverage Diff                @@
##           dscim-v0.4.0      #68       +/-   ##
=================================================
+ Coverage         55.87%   67.99%   +12.12%     
=================================================
  Files                17       17               
  Lines              1865     1859        -6     
=================================================
+ Hits               1042     1264      +222     
+ Misses              823      595      -228     
Impacted Files Coverage Δ
src/dscim/preprocessing/input_damages.py 88.37% <100.00%> (+88.37%) ⬆️

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@davidrzhdu davidrzhdu changed the title Input damages pytests Draft-Input damages pytests Feb 16, 2023
@kemccusker kemccusker changed the title Draft-Input damages pytests Draft: Input damages pytests Feb 16, 2023
@kemccusker kemccusker marked this pull request as draft February 16, 2023 20:12
@davidrzhdu davidrzhdu changed the title Draft: Input damages pytests Input damages pytests Feb 17, 2023
@davidrzhdu davidrzhdu force-pushed the input_damages_pytests branch from 5b7b71c to e17ee3d Compare April 21, 2023 20:19
@davidrzhdu
Copy link
Copy Markdown
Contributor Author

davidrzhdu commented Apr 26, 2023

Nested functions are currently not tested (lines 321-366).

Error raised by coastal_inputs function will depend on what version of xarray the user has. The most recent version of xarray handles the zarr GroupNotFoundError error with a more informative FileNotFoundError.

try:
d = xr.open_zarr(f"{path}/coastal_damages_{version}.zarr")
except GroupNotFoundError:
print(f"Zarr not found: {path}/coastal_damages_{version}.zarr")
exit()

@davidrzhdu davidrzhdu marked this pull request as ready for review April 26, 2023 19:37
Copy link
Copy Markdown
Member

@kemccusker kemccusker left a comment

Choose a reason for hiding this comment

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

yeah! thank you!

@kemccusker kemccusker merged commit 152ae4f into dscim-v0.4.0 May 3, 2023
@kemccusker kemccusker deleted the input_damages_pytests branch May 3, 2023 22:23
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.

4 participants