Skip to content

Commit 59de1c5

Browse files
authored
Cancel concurrent CI runs to save budget (#3263)
* add concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true * add commit hook https://github.com/adamchainz/blacken-docs * use assignment for single-key dict.update() * drop useless np.array calls in Lattice.selling_dist
1 parent 12626a2 commit 59de1c5

File tree

20 files changed

+346
-425
lines changed

20 files changed

+346
-425
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ on:
2222
permissions:
2323
contents: read
2424

25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.ref }}
27+
cancel-in-progress: true
28+
2529
jobs:
2630
test:
2731
# prevent this action from running on forks

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ repos:
4545
args: [--no-pycodestyle]
4646
- id: double-quote-cython-strings
4747

48+
- repo: https://github.com/adamchainz/blacken-docs
49+
rev: 1.16.0
50+
hooks:
51+
- id: blacken-docs
52+
4853
- repo: https://github.com/igorshubovych/markdownlint-cli
4954
rev: v0.35.0
5055
hooks:

docs/compatibility.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.md

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pymatgen/analysis/chempot_diagram.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def _get_2d_plot(self, elements: list[Element], label_stable: bool | None, eleme
296296
layout = plotly_layouts["default_layout_2d"].copy()
297297
layout.update(self._get_axis_layout_dict(elements))
298298
if label_stable:
299-
layout.update({"annotations": annotations})
299+
layout["annotations"] = annotations
300300

301301
data = self._get_2d_domain_lines(draw_domains)
302302

@@ -367,7 +367,7 @@ def _get_3d_plot(
367367
layout["scene"]["annotations"] = None
368368

369369
if label_stable:
370-
layout["scene"].update({"annotations": annotations})
370+
layout["scene"]["annotations"] = annotations
371371
layout["scene_camera"] = {
372372
"eye": {"x": 5, "y": 5, "z": 5}, # zoomed out
373373
"projection": {"type": "orthographic"},
@@ -565,7 +565,7 @@ def _get_annotation(ann_loc: np.ndarray, formula: str) -> dict[str, str | float]
565565
annotation = plotly_layouts["default_annotation_layout"].copy()
566566
annotation.update({"x": ann_loc[0], "y": ann_loc[1], "text": formula})
567567
if len(ann_loc) == 3:
568-
annotation.update({"z": ann_loc[2]})
568+
annotation["z"] = ann_loc[2]
569569
return annotation
570570

571571
@staticmethod

pymatgen/analysis/graphs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -943,9 +943,9 @@ def draw_graph_to_file(
943943
# edge has been added
944944
green_edges.append((u, v, k))
945945
for u, v, k in green_edges:
946-
g.edges[u, v, k].update({"color_uv": "#00ff00"})
946+
g.edges[u, v, k]["color_uv"] = "#00ff00"
947947
for u, v, k in red_edges:
948-
g.edges[u, v, k].update({"color_uv": "#ff0000"})
948+
g.edges[u, v, k]["color_uv"] = "#ff0000"
949949

950950
basename, extension = os.path.splitext(filename)
951951
extension = extension[1:]
@@ -2608,9 +2608,9 @@ def draw_graph_to_file(
26082608
# edge has been added
26092609
green_edges.append((u, v, k))
26102610
for u, v, k in green_edges:
2611-
g.edges[u, v, k].update({"color_uv": "#00ff00"})
2611+
g.edges[u, v, k]["color_uv"] = "#00ff00"
26122612
for u, v, k in red_edges:
2613-
g.edges[u, v, k].update({"color_uv": "#ff0000"})
2613+
g.edges[u, v, k]["color_uv"] = "#ff0000"
26142614

26152615
basename, extension = os.path.splitext(filename)
26162616
extension = extension[1:]

pymatgen/analysis/phase_diagram.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2617,10 +2617,10 @@ def _create_plotly_figure_layout(self, label_stable=True):
26172617
}
26182618
elif self._dim == 3 and self.ternary_style == "3d":
26192619
layout = plotly_layouts["default_ternary_3d_layout"].copy()
2620-
layout["scene"].update({"annotations": annotations_list})
2620+
layout["scene"]["annotations"] = annotations_list
26212621
elif self._dim == 4:
26222622
layout = plotly_layouts["default_quaternary_layout"].copy()
2623-
layout["scene"].update({"annotations": annotations_list})
2623+
layout["scene"]["annotations"] = annotations_list
26242624

26252625
return layout
26262626

@@ -2956,7 +2956,7 @@ def _create_plotly_element_annotations(self):
29562956
if entry.composition.is_element:
29572957
z = 0.9 * self._min_energy # place label 10% above base
29582958

2959-
annotation.update({"z": z})
2959+
annotation["z"] = z
29602960

29612961
annotations_list.append(annotation)
29622962

pymatgen/core/composition.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -403,13 +403,12 @@ def reduced_formula(self) -> str:
403403

404404
@property
405405
def hill_formula(self) -> str:
406-
""":return: Hill formula. The Hill system (or Hill notation) is a system
407-
of writing empirical chemical formulas, molecular chemical formulas and
408-
components of a condensed formula such that the number of carbon atoms
409-
in a molecule is indicated first, the number of hydrogen atoms next,
410-
and then the number of all other chemical elements subsequently, in
411-
alphabetical order of the chemical symbols. When the formula contains
412-
no carbon, all the elements, including hydrogen, are listed
406+
"""The Hill system (or Hill notation) is a system of writing empirical chemical
407+
formulas, molecular chemical formulas and components of a condensed formula such
408+
that the number of carbon atoms in a molecule is indicated first, the number of
409+
hydrogen atoms next, and then the number of all other chemical elements
410+
subsequently, in alphabetical order of the chemical symbols. When the formula
411+
contains no carbon, all the elements, including hydrogen, are listed
413412
alphabetically.
414413
"""
415414
elem_comp = self.element_composition

0 commit comments

Comments
 (0)