Skip to content

Pfunit tests Part I

Sebastian Müller requested to merge pfunit_tests into develop

Update Summary for FORCES pFUnit tests Part 1

Unit-tests:

  1. test_mo_anneal, converted
    1. Only changed to pFUnit assertion.
    2. Print outs of initialization and annealing results still kept.
  2. test_mo_append, converted
    1. Added tests for additional data types: i8, sp, dp, logical.
    2. Added test for:
      1. Appending non-allocated vector with scalars.
      2. Appending non-allocated matrix with a matrix.
      3. Appending matrices with larger/smaller columns with filler values. Note: Exception outcome w/o filler values cannot be tested.
      4. Appending 3d matrix; non-allocated and matrix with equal size in 2nd and 3rd component. For dp, along a component of choice idim.
      5. Pasting matrix by scalar and vector; non-allocated, different row size, and nodata.
      6. Pasting 3d matrix; non-allocated and nodata.
      7. Pasting 4d matrix; non-allocated and nodata. For dp, along a component of choice idim.
  3. test_mo_append, converted
    1. Added function append_i4_3d for the append() interface.
    2. Added tests for additional data types: i8, sp, dp, logical.
    3. Added test for:
      1. Appending non-allocated vector with scalars.
      2. Appending non-allocated matrix with a matrix.
      3. Appending matrices with larger/smaller columns with filler values. Note: Exception outcome w/o filler values cannot be tested.
      4. Appending 3d matrix; non-allocated and matrix with equal size in 2nd and 3rd component. For dp, along a component of choice idim.
      5. Pasting matrix by scalar and vector; non-allocated, different row size, and nodata.
      6. Pasting 3d matrix; non-allocated and nodata.
      7. Pasting 4d matrix; non-allocated and nodata. For dp, along a component of choice idim.
  4. test_mo_boxcox, converted
    1. Added test for masked data and small exponent power for boxcox transform.
  5. test_mo_corr, converted
    1. Added test for masked data.
  6. test_mo_dds, converted
    1. Only changed to pFUnit assertion.
    2. Print outs of initialization and DDS algorithm results still kept.
  7. test_mo_errormeasures, converted
    1. Added tests for error measures KGEnocorr, wNSE.
    2. Added tests for masked/unmasked data.
  8. test_mo_finish, removed
    1. Removed as module is deemed redundant.
  9. test_mo_julian, converted
    1. Only changed to pFUnit assertion.
  10. test_mo_linfit, converted
    1. Only changed to pFUnit assertion.
  11. test_mo_mcmc, converted
    1. Only changed to pFUnit assertion.
  12. test_mo_moment, converted
    1. Only changed to pFUnit assertion.
  13. test_mo_ncread, converted
    1. Only changed to pFUnit assertion.
  14. test_mo_netcdf, converted
    1. Only changed to pFUnit assertion.
  15. test_mo_nml, converted
    1. Only changed to pFUnit assertion.
  16. test_mo_orderpack, converted
    1. Only changed to pFUnit assertion.
  17. test_mo_percentile, converted
    1. Added tests for odd numbers of data points.
    2. Added tests for masked data percentile, n_element, median, and qmedian.
    3. Added tests for 0d data for all functions.
    4. Added tests for different modes in sp data type.
  18. test_mo_poly, converted
    1. Added test for the evaluation of point at the vertex.
  19. test_mo_sce, converted
    1. Added SCE test for griewank function.
  20. test_mo_spatialsimilarity, converted
    1. Only changed to pFUnit assertion.
  21. test_mo_standard_score, converted
    1. Added test for masked data with classified standard score.
  22. test_mo_string_utils, converted
    1. Only changed to pFUnit assertion.
  23. test_mo_temporal_aggregation, created
    1. Monthly average calculation for daily data.
    2. Hourly average calculation for hourly data.
    3. Optional input for missing value substitute untested.
  24. test_mo_timer, converted
    1. Removed timer printout.
    2. Perform simple time sanity check.
  25. test_mo_utils, converted
    1. Only changed to pFUnit assertion.
    2. Since mo_utils has many functionality as logical operators, most assertion used are simple logical, i.e. assertTrue() and assertFalse()
  26. test_mo_xor4096, converted
    1. Only changed to pFUnit assertion.

Modules:

  1. mo_append, modified
    1. Added function append_i4_3d for the append() interface.
  2. mo_percentile, modified
    1. Fixed a typo in the module function n_elements() so that masking works properly.
  3. mo_xor4096, modified
    1. Implemented a fix by Mathias Cuntz to solve overflow on RNG.

Data files:

  1. namelist.txt, moved
    1. Moved to pf_tests/files for use in test_mo_nml.
  2. field.dat, moved
    1. Moved to pf_tests/files for use in test_mo_errormeasures.
  3. field_maskf90.dat, moved
    1. Moved to pf_tests/files for use in test_mo_errormeasures.
  4. period10day.dat, created
    1. 10 day hourly data from date 01.01.2021 for use in test_mo_temporal_aggregation.
  5. year.dat, created
    1. daily data from 01.01.2021 to 31.12.2021 for use in test_mo_temporal_aggregation.
  6. year_leap.dat, created
    1. daily data from 01.01.2020 to 31.12.2020 for use in test_mo_temporal_aggregation.
Edited by Sebastian Müller

Merge request reports