Conversation
| # Test circular longitude does not cause a crash. | ||
| res = 5 | ||
| lat = DimCoord(np.arange(-90, 91, res), 'latitude', | ||
| units='degrees_north') |
There was a problem hiding this comment.
E127 continuation line over-indented for visual indent
| lat = DimCoord(np.arange(-90, 91, res), 'latitude', | ||
| units='degrees_north') | ||
| lon = DimCoord(np.arange(0, 360, res), 'longitude', | ||
| units='degrees_east') |
There was a problem hiding this comment.
E127 continuation line over-indented for visual indent
| u_arr = np.ones((nlat, nlon)) | ||
| v_arr = np.ones((nlat, nlon)) | ||
| u_cube = Cube(u_arr, dim_coords_and_dims=[(lat, 0), (lon, 1)], | ||
| standard_name='eastward_wind') |
There was a problem hiding this comment.
E127 continuation line over-indented for visual indent
| u_cube = Cube(u_arr, dim_coords_and_dims=[(lat, 0), (lon, 1)], | ||
| standard_name='eastward_wind') | ||
| v_cube = Cube(v_arr, dim_coords_and_dims=[(lat, 0), (lon, 1)], | ||
| standard_name='northward_wind') |
There was a problem hiding this comment.
E127 continuation line over-indented for visual indent
trexfeathers
left a comment
There was a problem hiding this comment.
Nice addition @stephenworsley 👍
I believe the test should have an assertion of success/non-error?
|
@trexfeathers thanks. |
OK, sounds good to me 😊 |
lbdreyer
left a comment
There was a problem hiding this comment.
Thanks @stephenworsley !
Just a small change needed then this should be good to go
| standard_name='eastward_wind') | ||
| v_cube = Cube(v_arr, dim_coords_and_dims=[(lat, 0), (lon, 1)], | ||
| standard_name='northward_wind') | ||
| u_cube.coord('longitude').circular = True |
There was a problem hiding this comment.
Could you also set circular=True for v_cube?
I know we don't explicitly do a compatibility check for the u_cube and v_cube as it is still a TODO but once that is fixed, it would throw up an error about the longitude coordinates being different on u_cube and v_cube.
Also, you could do it when you initialise the lon, i.e.:
lon = DimCoord(np.arange(0, 360, res), 'longitude',
units='degrees_east', circular=True)
As that would apply to both u_cube and v_cube
|
Great! Thanks @stephenworsley ! |
Fixes bug in #3340.