cerfacs-globc/icclim

ENH: [API] - Make a function for each index

bzah opened this issue · 0 comments

bzah commented
  • icclim version: 5.0.2
  • Python version: all supported

Description

It would seem it's a common expectation from users to have independent functions for each index. Indeed this is what xclim virtual module named "icclim" provides and this is what C3S prefers as well.

We already have a way to auto-generate these function with tools/extract-icclim-funs.py.
The output module could simply be part of icclim as is, we just need a way to forbid (or strongly discourage) any edition to this module because when adding new indices, we would simply rerun extract-icclim-funs and override the whole module.

Additionally, we should run this script within our CI.

  1. It would ensure it's always working fine, which is needed future C3S update
  2. It would avoid having generated code polluting our sources, which could lead to problems in the futur (manual edition of generated code, large git diffs when modifying the generator, an oversight of generating the code when needed...)

Note

This would not remove the existing icclim.index public API endpoint. Expert users of icclim are already used to it, there is no point on forcing them to change their scripts.