Skip to content

Conversation

@gcaria
Copy link
Contributor

@gcaria gcaria commented Nov 27, 2020

🚀 Pull Request

Description

Resolves #3602

I have just started to work on this, and after adding a short test I get 5 failures when testing lib/iris/tests/unit/cube/test_Cube.py, all AssertionErrors similar to:

AssertionError: CML do not match: /home/gcaria/github/iris/lib/iris/tests/results/unit/cube/Cube/xml/checksum_ignores_masked_values.cml

which don't seem to be related to the test I've added. I've followed the instructions for running the tests so I'm not sure what I'm missing.

@gcaria gcaria changed the title Test string argument to remove ancilliary variable Add string arguments for Cube methods Nov 27, 2020
@rcomer
Copy link
Member

rcomer commented Nov 27, 2020

Hi @gcaria, thanks for the contribution! I’m not sure about that specific error, but I can see that your branch is a couple of commits behind the master branch. The most recent commit to master incorporates a switch from Travis-CI to Cirrus-CI to run the tests within the PR. So I suggest rebasing to pick up that change, and then we can see your test output here. So something like:

git fetch upstream
git rebase upstream/master
git push -f origin

@rcomer
Copy link
Member

rcomer commented Nov 27, 2020

Depending how and exactly when you created your python environment, it may be also be worth worth re-doing that. cftime v1.3 was recently released, and caused all sorts of failures within Iris. We’ve temporarily pinned the cftime version (#3927), but that was also after you created your branch.

So if you rebase, then create a new environment from the source, then run the tests again, you might get a different result.

@gcaria gcaria force-pushed the add_string_args_for_cube_methods branch 2 times, most recently from f122829 to f5104d4 Compare November 27, 2020 21:14
@gcaria gcaria force-pushed the add_string_args_for_cube_methods branch 3 times, most recently from 343cdf7 to 9aef112 Compare December 1, 2020 15:38
@gcaria gcaria force-pushed the add_string_args_for_cube_methods branch from 9aef112 to 8a65182 Compare December 1, 2020 15:41
@gcaria
Copy link
Contributor Author

gcaria commented Dec 1, 2020

Thanks @rcomer for the useful feedback !

In addition to changing the cftime version, I've also switched to python3.7 (was using 3.8 before) which was surely part of the problem, at least locally. Now everything works :)

I see that in #3295 the docstring for the remove_cell_measure was also expanded.
Would it be appropriate to have the same also for the modified methods of this PR ?

@rcomer
Copy link
Member

rcomer commented Dec 1, 2020

Hi @gcaria, glad you got the tests working! I don't think I'm the best person to advise on this specific change as I haven't done anything with this part of the code. Looks like @stephenworsley has done a lot in this area so hopefully he can advise.

@bjlittle bjlittle self-assigned this Dec 2, 2020
@bjlittle bjlittle added this to the v3.1.0 milestone Dec 2, 2020
Copy link
Member

@bjlittle bjlittle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gcaria Awesome contribution! Thanks for taking the time to push this fix to iris. Much appreciated 😄

Could I ask you to also make a whatsnew entry to accompany this pull-request?

Simply make the following addition to the <root-dir>/docs/iris/src/whatsnew/latest.rst file, under the section "🐛 Bugs Fixed", with something along the lines of:

* `@gcaria`_ fixed :meth:`~iris.cube.Cube.cell_measure_dims` to also accept the string name of a :class:`~iris.coords.CellMeasure`. (:pull:`3931`)
* `@gcaria`_ fixed :meth:`~iris.cube.Cube.ancillary_variable_dims` to also accept the string name of a :class:`~iris.coords.AncillaryVariable`. (:pull:`3931`)

Also, at the end of the latest.rst file add the following entry:

.. _@gcaria: https://github.com/gcaria

Then we'll be good to go! 👍

@gcaria
Copy link
Contributor Author

gcaria commented Dec 5, 2020

Oh I see this was all documented here, my bad for missing it and thanks for pointing that out!

@bjlittle
Copy link
Member

bjlittle commented Dec 7, 2020

@gcaria Perfect, thanks 👍

@bjlittle bjlittle merged commit 54b36fd into SciTools:master Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cube methods for Ancillary Variables and Cell Measures don't take names for arguments.

3 participants