Skip to content

Updates to calculate_xr and addition of tests

Fraser William Goldsworth requested to merge m301014/pyicon-fraser:master into master

There's a few changes here, namely:

  • pytest tests for calculate_xr module
  • updated convert_tgrid to check whether the grid has previously been converted
  • updated crop_tgrid to work on both pyicon datasets (converted grids) and tgrid datasets
  • a bit of refactoring here and there

In theory it should be possible to make the pytest tests run automatically on gitlab and to get a test report upon branches being merged, but I haven't implemented that here. This would enable quick checking of whether any code changes 'break' the code.

The tests run on a sample ICON grid file which is automatically downloaded if it's not present. They then check the convert_tgrid and crop_tgrid functions work as expected when applied to the downloaded grid file.

It should be relatively easy to create tests for other functions in the calculate_xr package if significant changes are made in the future.

Edited by Fraser William Goldsworth

Merge request reports