Fix parameter name and return type in eleven fix_metadata docstrings - #3189
Fix parameter name and return type in eleven fix_metadata docstrings#3189karpovantonme wants to merge 1 commit into
Conversation
Eleven overrides of Fix.fix_metadata document their argument as 'cube' while the method takes 'cubes', and nine of them promise to return an iris.cube.Cube while they return a CubeList. The rest of the package already does this correctly: the base class in esmvalcore/cmor/_fixes/fix.py and the other overrides use 'cubes' and iris.cube.CubeList. In gfdl_esm2g.py and noresm1_me.py the correct and the incorrect form sit in the same file.
97d9095 to
8b73c49
Compare
valeriupredoi
left a comment
There was a problem hiding this comment.
this PR is generated by an AI agent/bot (that has links to Telegram, no less), at the moment we do not accept such contributions. Until further decisions, I am putting a hold on this PR.
|
Understood, your call Two small corrections for the record. I checked your contributing guide before opening this, and there is no policy on AI assistance in it. The CLA is signed and all checks are green. And I have no Telegram anywhere on my profile or in this PR, so that part may have come from somewhere else. The change itself is eleven docstrings naming a parameter the method does not take, with the base class right there doing it correctly. If the project would rather wait for the policy to land, I will close it myself and stay out of the repository. Either way, thanks for the time 🙏🏼 |
Description
Eleven overrides of
Fix.fix_metadatadocument their argument ascube, but the method takescubes. Nine of those same docstrings promise aniris.cube.Cubeback while the code returns aCubeList.The rest of the package already gets this right. The base class in
esmvalcore/cmor/_fixes/fix.pywritescubes, and so does every other override that documents the argument at all. Ingfdl_esm2g.pyandnoresm1_me.pyboth spellings live in the same file, so the correct version is sitting a few lines above the wrong one.Worth saying what this does not do. These modules are not listed in
doc/api, so nothing changes on readthedocs. What changes is the source people read:doc/develop/fixing_data.rstasks contributors to write their own dataset fixes, and the natural way to start one is to copy the nearest existing fix.Docstrings only, no code path touched. In the same files
fix_data(self, cube)documentscube: iris.cube.Cubeand that one is correct, so I left it alone.One thing to flag: the guidelines ask for a few files per pull request and this is seven. It is the same one-line change in each and there is no code in it, but I can split it per dataset if that reads better for review.
Link to documentation: https://docs.esmvaltool.org/projects/ESMValCore/en/latest/develop/fixing_data.html
Checklist
documentationis the one that fitsruff checkandruff formatare clean on the changed files