cerfacs-globc / icclim

icclim: Python library for climate indices and climate indicators calculation.
https://icclim.readthedocs.io/en/latest/
Apache License 2.0
82 stars 31 forks source link

Fix/unit for diff based indices #258

Closed bzah closed 1 year ago

bzah commented 1 year ago

Pull Request to resolve #255

Describe the changes you made

Indicators computing the difference between two variables must first convert the units of input variables to the expected output unit in order to avoid converting the output which would be a relative "temperature". In other words: a 15 Kelvin difference is equivalent to a 15 degC and is not to a -258.15 degC.

github-actions[bot] commented 1 year ago

Coverage

Report
FileStmtsMissCoverMissing
icclim
   icclim_exceptions.py7186%20
   icclim_logger.py852966%24, 43, 65, 70–95, 105, 111–142, 150–155
   main.py2772691%119, 128, 404, 489, 515–516, 518–519, 521, 523–524, 526–527, 546–553, 611–616, 697, 704, 708
   utils.py37586%22, 33–34, 36–37
icclim/ecad
   xclim_binding.py48688%39, 43, 68, 72, 97, 101
icclim/generic_indices
   generic_indicators.py4828582%57, 60, 77, 81, 85, 98, 104, 178, 218, 225, 359, 388, 678, 709, 715, 723, 743, 906, 911, 931–937, 941, 971, 973, 1038–1039, 1072–1099, 1126–1147, 1163, 1172–1173, 1199–1229, 1235–1239, 1263
   standard_variable.py48198%19
   threshold.py3982195%199, 219, 223, 271, 287–290, 305, 312, 388, 529, 598, 694, 897, 919, 925, 999, 1002, 1101–1103
icclim/models
   cf_calendar.py35197%20
   climate_variable.py1001090%103, 162, 173, 207, 213, 251, 255, 283–284, 321
   frequency.py1761194%167–170, 314–316, 323, 401, 427, 432
   index_group.py34197%33
   operator.py29197%14
   standard_index.py28389%56, 59, 63
icclim/pre_processing
   input_parsing.py1953781%74, 78–79, 84, 103, 167, 172, 178, 187, 200, 229, 245, 259, 279, 287, 289, 298, 307, 325, 339–347, 356–373, 395
   rechunk.py86298%38, 132
TOTAL256424091% 

Test results

Tests Skipped Failures Errors Time
187 0 :zzz: 0 :x: 0 :fire: 2m 0s :stopwatch: