diff --git a/cf/mixin/propertiesdata.py b/cf/mixin/propertiesdata.py index 949e411811..63102ef032 100644 --- a/cf/mixin/propertiesdata.py +++ b/cf/mixin/propertiesdata.py @@ -3282,7 +3282,7 @@ def equivalent(self, other, rtol=None, atol=None, traceback=False): return True # Check that each instance is the same type - if type(self) != type(other): + if type(self) is not type(other): print( f"{self.__class__.__name__}: Different types: " f"{self.__class__.__name__}, {other.__class__.__name__}" diff --git a/cf/mixin/propertiesdatabounds.py b/cf/mixin/propertiesdatabounds.py index 020e373d56..e51c61e8aa 100644 --- a/cf/mixin/propertiesdatabounds.py +++ b/cf/mixin/propertiesdatabounds.py @@ -1734,7 +1734,7 @@ def equivalent(self, other, rtol=None, atol=None, traceback=False): return True # Check that each instance is the same type - if type(self) != type(other): + if type(self) is not type(other): print( f"{self.__class__.__name__}: Different types: " f"{self.__class__.__name__}, {other.__class__.__name__}" diff --git a/docs/2_to_3_changes.html b/docs/2_to_3_changes.html index 4b1b3d902e..bfabf7b2cb 100644 --- a/docs/2_to_3_changes.html +++ b/docs/2_to_3_changes.html @@ -44,7 +44,7 @@ -

cf 3.15.3

+

cf 3.15.4

@@ -142,7 +142,7 @@

Python

In-place operations

-

At version 3.x, in-place operations return None, rather than the +

At version 3.x, in-place operations return None, rather than the modified construct. The keyword that defines the operation to be in-place is now inplace (rather than i).

>>> g = f.tranpose()
@@ -491,7 +491,7 @@ 

Changes to the API of existing methods

-

Conversion to int, float, str and bool is with the usual +

Conversion to int, float, str and bool is with the usual built-in functions:

>>> c = cf.Constant(1.2)
 >>> int(c)
@@ -194,7 +194,7 @@ 

cf.Constant'New_New_'

-

Care is required when the right hand side operand is a numpy +

Care is required when the right hand side operand is a numpy array

>>> c * numpy.array([1, 2, 3])
 array([20, 40, 60])
@@ -205,7 +205,7 @@ 

cf.Constantint

-

Unary arithmetic operations (+, -, abs) are equivalent +

Unary arithmetic operations (+, -, abs) are equivalent to the operation acting on the Constant object’s value attribute:

>>> c = cf.Constant(-20)
@@ -331,7 +331,7 @@ 

Special

__deepcopy__

-

Called by the copy.deepcopy function.

+

Called by the copy.deepcopy function.

__enter__

Enter the runtime context.

@@ -340,10 +340,10 @@

Special

__repr__

-

Called by the repr built-in function.

+

Called by the repr built-in function.

__str__

-

Called by the str built-in function.

+

Called by the str built-in function.

@@ -358,7 +358,7 @@

Special

-
to_memory: bool, optional

If True then ensure that the original data are in +

to_memory: bool, optional

If True then ensure that the original data are in memory, rather than on disk.

If the original data are on disk, then reading data into memory during initialisation will slow down the @@ -342,7 +342,7 @@

cf.DataNew in version 3.14.0.

-
init_options: dict, optional

Provide optional keyword arguments to methods and +

init_options: dict, optional

Provide optional keyword arguments to methods and functions called during the initialisation process. A dictionary key identifies a method or function. The corresponding value is another dictionary whose @@ -401,7 +401,7 @@

Inspection

dtype

-

The numpy data-type of the data.

+

The numpy data-type of the data.

ndim

Number of dimensions in the data array.

@@ -1195,13 +1195,13 @@

Order statistics

maximum

-

Alias for max

+

Alias for max

maximum_absolute_value

Calculate maximum absolute values.

minimum

-

Alias for min

+

Alias for min

minimum_absolute_value

Calculate minimum absolute values.

@@ -1619,7 +1619,7 @@

Element-wise arithmetic, bit and comparison operations

__bool__

-

Truth value testing and the built-in operation bool

+

Truth value testing and the built-in operation bool

@@ -1837,28 +1837,28 @@

Specialin

__deepcopy__

-

Called by the copy.deepcopy function.

+

Called by the copy.deepcopy function.

__getitem__

Return a subspace of the data defined by indices.

__hash__

-

The built-in function hash.

+

The built-in function hash.

__iter__

Called when an iterator is required.

__len__

-

Called to implement the built-in function len.

+

Called to implement the built-in function len.

__repr__

-

Called by the repr built-in function.

+

Called by the repr built-in function.

__setitem__

Implement indexed assignment.

__str__

-

Called by the str built-in function.

+

Called by the str built-in function.

__array__

The numpy array interface.

@@ -1972,7 +1972,7 @@

Deprecated

-
copy: bool, optional

If True (the default) then deep copy the input +

copy: bool, optional

If True (the default) then deep copy the input parameters prior to initialisation. By default the parameters are not deep copied.

New in version (cfdm): 1.10.0.0

-
size: int

Deprecated at version 1.10.0.0. Ignored if set.

+
size: int

Deprecated at version 1.10.0.0. Ignored if set.

Number of elements in the uncompressed array.

-
ndim: int

Deprecated at version 1.10.0.0. Ignored if set.

+
ndim: int

Deprecated at version 1.10.0.0. Ignored if set.

The number of uncompressed array dimensions

@@ -310,7 +308,7 @@

cf.GatheredArray -
units: str or None, optional

The units of the netCDF variable. Set to None to +

units: str or None, optional

The units of the netCDF variable. Set to None to indicate that there are no units. If unset then the units will be set during the first __getitem__ call.

New in version (cfdm): 1.10.0.1

-
calendar: str or None, optional

The calendar of the netCDF variable. By default, or if -set to None, then the CF default calendar is +

calendar: str or None, optional

The calendar of the netCDF variable. By default, or if +set to None, then the CF default calendar is assumed, if applicable. If unset then the calendar will be set during the first __getitem__ call.

New in version (cfdm): 1.10.0.1

-
missing_values: dict, optional

The missing value indicators defined by the netCDF +

missing_values: dict, optional

The missing value indicators defined by the netCDF variable attributes. See get_missing_values for details.

@@ -208,7 +208,7 @@

cf.NetCDFArrayNew in version (cfdm): 1.10.0.0

-
copy: bool, optional

If True (the default) then deep copy the input +

copy: bool, optional

If True (the default) then deep copy the input parameters prior to initialisation. By default the parameters are not deep copied.

@@ -362,7 +362,7 @@

Special

-
copy: bool, optional

If True (the default) then deep copy the input +

copy: bool, optional

If True (the default) then deep copy the input parameters prior to initialisation. By default the parameters are not deep copied.

New in version (cfdm): 1.10.0.0

-
size: int

Deprecated at version 1.10.0.0. Ignored if set.

+
size: int

Deprecated at version 1.10.0.0. Ignored if set.

Number of elements in the uncompressed array.

-
ndim: int

Deprecated at version 1.10.0.0. Ignored if set.

+
ndim: int

Deprecated at version 1.10.0.0. Ignored if set.

The number of uncompressed array dimensions.

@@ -301,7 +301,7 @@

cf.RaggedIndexedArray -
copy: bool, optional

If True (the default) then deep copy the input +

copy: bool, optional

If True (the default) then deep copy the input parameters prior to initialisation. By default the parameters are not deep copied.

New in version (cfdm): 1.10.0.0

-
size: int

Deprecated at version 1.10.0.0. Ignored if set.

+
size: int

Deprecated at version 1.10.0.0. Ignored if set.

Number of elements in the uncompressed array.

-
ndim: int

Deprecated at version 1.10.0.0. Ignored if set.

+
ndim: int

Deprecated at version 1.10.0.0. Ignored if set.

The number of uncompressed array dimensions.

@@ -307,7 +307,7 @@

cf.RaggedIndexedContiguousArray