Skip to content

Conversation

@bjlittle
Copy link
Member

🚀 Pull Request

Description

This PR bumps the version of the black pre-commit hook, and adds format changes to files for the new version standard.


Consult Iris pull request check list

Copy link
Contributor

@trexfeathers trexfeathers left a comment

Choose a reason for hiding this comment

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

In some places the new formatting looks really horrible, is less readable and seems gratuitous - see the specific sections I have marked. Is there a configuration we can use to make Black less zealous?

Comment on lines +45 to +178
(
"first_validity_time",
(
21,
22,
23,
24,
25,
26,
27,
),
),
(
"last_validity_time",
(
28,
29,
30,
31,
32,
33,
34,
),
),
(
"misc_validity_time",
(
35,
36,
37,
38,
39,
40,
41,
),
),
(
"integer_constants",
(
100,
101,
),
),
(
"real_constants",
(
105,
106,
),
),
(
"level_dependent_constants",
(
110,
111,
112,
),
),
(
"row_dependent_constants",
(
115,
116,
117,
),
),
(
"column_dependent_constants",
(
120,
121,
122,
),
),
(
"fields_of_constants",
(
125,
126,
127,
),
),
(
"extra_constants",
(
130,
131,
),
),
(
"temp_historyfile",
(
135,
136,
),
),
(
"compressed_field_index1",
(
140,
141,
),
),
(
"compressed_field_index2",
(
142,
143,
),
),
(
"compressed_field_index3",
(
144,
145,
),
),
(
"lookup_table",
(
150,
151,
152,
),
),
("total_prognostic_fields", (153,)),
("data", (160, 161, 162,)),
(
"data",
(
160,
161,
162,
),
),
Copy link
Contributor

@trexfeathers trexfeathers Sep 17, 2020

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

😱

Copy link
Member Author

Choose a reason for hiding this comment

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

I know, right...

Copy link
Member

Choose a reason for hiding this comment

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

Almost wondering if it's a bug in black? Would anyone really choose this?

Copy link
Contributor

Choose a reason for hiding this comment

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

@bjlittle will likely be able to explain all once he pushes the fixing commit. He does know what's wrong

Comment on lines +108 to +138
(
"lbrsvd",
(
34,
35,
36,
37,
),
),
("lbsrce", (38,)),
("lbuser", (39, 40, 41, 42, 43, 44, 45,)),
("brsvd", (46, 47, 48, 49,)),
(
"lbuser",
(
39,
40,
41,
42,
43,
44,
45,
),
),
(
"brsvd",
(
46,
47,
48,
49,
),
),
Copy link
Contributor

@trexfeathers trexfeathers Sep 17, 2020

Choose a reason for hiding this comment

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

Comment on lines +193 to +223
(
"lbrsvd",
(
34,
35,
36,
37,
),
),
("lbsrce", (38,)),
("lbuser", (39, 40, 41, 42, 43, 44, 45,)),
("brsvd", (46, 47, 48, 49,)),
(
"lbuser",
(
39,
40,
41,
42,
43,
44,
45,
),
),
(
"brsvd",
(
46,
47,
48,
49,
),
),
Copy link
Contributor

@trexfeathers trexfeathers Sep 17, 2020

Choose a reason for hiding this comment

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

Comment on lines +354 to +359
np.logical_and(
mask_invert[
:-1,
],
diffs_along_y,
)
Copy link
Contributor

@trexfeathers trexfeathers Sep 17, 2020

Choose a reason for hiding this comment

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

Comment on lines +1138 to +1144
lat_cube = next(
self.cube.slices(
[
"grid_latitude",
]
)
)
Copy link
Contributor

@trexfeathers trexfeathers Sep 17, 2020

Choose a reason for hiding this comment

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

Comment on lines +327 to +329
points=[
15,
],
Copy link
Contributor

@trexfeathers trexfeathers Sep 17, 2020

Choose a reason for hiding this comment

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

Comment on lines +227 to +229
len(
set(test_date_ints),
),
Copy link
Contributor

@trexfeathers trexfeathers Sep 17, 2020

Choose a reason for hiding this comment

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

Comment on lines +98 to +104
self.assertEqual(
shape,
(
2,
3,
),
)
Copy link
Contributor

@trexfeathers trexfeathers Sep 17, 2020

Choose a reason for hiding this comment

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

Comment on lines +124 to +130
self.assertEqual(
shape,
(
2,
3,
),
)
Copy link
Contributor

@trexfeathers trexfeathers Sep 17, 2020

Choose a reason for hiding this comment

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

Comment on lines +110 to +112
Index[
(2, 0, 1),
],
Copy link
Contributor

@trexfeathers trexfeathers Sep 17, 2020

Choose a reason for hiding this comment

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

@bjlittle
Copy link
Member Author

@trexfeathers Yeah, I tend to agree... I am slightly upset with its choices... I'll tinker under the hood and experiment a little with what controls black provides to see if it alleviates these changes.

@bjlittle bjlittle mentioned this pull request Sep 17, 2020
@bjlittle
Copy link
Member Author

@trexfeathers I'm closing this in favour of #3866... it just make life easier 😉

@bjlittle bjlittle closed this Sep 17, 2020
@bjlittle bjlittle deleted the update-black branch October 1, 2020 12:45
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.

3 participants