Skip to content

Conversation

bjlittle
Copy link
Member

This PR moves the iris.experimental.equalise_cubes.equalise_attributes function to iris.util.equalise_attributes.

Reference #3515

new = "iris.util.equalise_attributes"
emsg = (
f'The function "{old}" has been moved.\n'
f'Please replace "{old}(<cubes>)" with "{new}(<cubes>)".'
Copy link
Member Author

Choose a reason for hiding this comment

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

Ohhh our first f-string 🎉

Welcome to the wonderful world of Python3 (finally!)

@@ -0,0 +1,2 @@
* The :func:`iris.experimental.equalise_cubes.equalise_attributes` function has been migrated into
the core of Iris. Please use the :func:`iris.util.equalise_attributes` function instead.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure "core of Iris" means that much to someone outside the dev team.
Maybe it is clearer to say:

  • The :func:iris.experimental.equalise_cubes.equalise_attributes function has been moved from the :mod:iris.experimental module into :mod:iris.util module. Please use the :func:iris.util.equalise_attributes function instead.

# before importing anything else.
import iris.tests as tests

import numpy as np
Copy link
Contributor

Choose a reason for hiding this comment

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

The doc string in the file header still references "experimental". I think it should be iris.util.equalise_attributes:

"""
Unit tests for the :func:iris.experimental.equalise_cubes.equalise_attributes
function.
"""

cube.data = ma.masked_array(cube.data)
cube.data[points_to_mask] = ma.masked
return cube

Copy link
Contributor

@abooton abooton Nov 15, 2019

Choose a reason for hiding this comment

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

I checked this file: It is identical to before, except for syntax over multiple lines :)

Copy link
Member Author

@bjlittle bjlittle Nov 15, 2019

Choose a reason for hiding this comment

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

@abooton Yup, that's the magic of black... or should I say, black magic?! 😉

Copy link
Member

Choose a reason for hiding this comment

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

👻 👿 🙈

@abooton abooton merged commit 0b5b266 into SciTools:master Nov 15, 2019
@bjlittle bjlittle deleted the move-equalise-attributes branch November 15, 2019 09:56
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.

4 participants