Skip to content

Commit

Permalink
fix copy-paste error continue-on-error: true in test.yml's pytest step
Browse files Browse the repository at this point in the history
meant failed test would still show as green in CI!!
  • Loading branch information
janosh committed Nov 8, 2022
1 parent fee74a3 commit 31b4191
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ jobs:
# to update the test durations, run
# pytest --store-durations --durations-path test_files/.pytest-split-durations
# and commit the results
continue-on-error: true
run: |
pytest --cov=pymatgen --splits 10 --group ${{ matrix.split }} --durations-path test_files/.pytest-split-durations
- name: Upload coverage
Expand Down
8 changes: 4 additions & 4 deletions pymatgen/core/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1867,23 +1867,23 @@ def copy(self, site_properties=None, sanitize=False):
A copy of the Structure, with optionally new site_properties and
optionally sanitized.
"""
site_props = self.site_properties
props = self.site_properties
if site_properties:
site_props.update(site_properties)
props.update(site_properties)
if not sanitize:
return self.__class__(
self._lattice,
self.species_and_occu,
self.frac_coords,
charge=self._charge,
site_properties=site_props,
site_properties=props,
)
reduced_latt = self._lattice.get_lll_reduced_lattice()
new_sites = []
for idx, site in enumerate(self):
frac_coords = reduced_latt.get_fractional_coords(site.coords)
site_props = {}
for prop, val in site_props.items():
for prop, val in props.items():
site_props[prop] = val[idx]
new_sites.append(
PeriodicSite(
Expand Down
10 changes: 5 additions & 5 deletions pymatgen/entries/computed_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import os
import warnings
from itertools import combinations
from typing import Literal
from typing import Literal, cast

import numpy as np
from monty.json import MontyDecoder, MontyEncoder, MSONable
Expand Down Expand Up @@ -142,7 +142,7 @@ def explain(self):
"""
Return an explanation of how the energy adjustment is calculated.
"""
return self.description + f" ({self.value:.3f} eV)"
return f"{self.description} ({self.value:.3f} eV)"

def normalize(self, factor):
"""
Expand Down Expand Up @@ -222,7 +222,7 @@ def explain(self):
"""
Return an explanation of how the energy adjustment is calculated.
"""
return self.description + f" ({self._adj_per_atom:.3f} eV/atom x {self.n_atoms} atoms)"
return f"{self.description} ({self._adj_per_atom:.3f} eV/atom x {self.n_atoms} atoms)"

def normalize(self, factor):
"""
Expand Down Expand Up @@ -289,7 +289,7 @@ def explain(self):
"""
Return an explanation of how the energy adjustment is calculated.
"""
return self.description + f" ({self._adj_per_deg:.4f} eV/K/atom x {self.temp} K x {self.n_atoms} atoms)"
return f"{self.description} ({self._adj_per_deg:.4f} eV/K/atom x {self.temp} K x {self.n_atoms} atoms)"

def normalize(self, factor):
"""
Expand Down Expand Up @@ -491,7 +491,7 @@ def __eq__(self, other: object) -> bool:
if not all(hasattr(other, attr) for attr in needed_attrs):
return NotImplemented

assert isinstance(other, ComputedEntry) # mypy type narrowing
other = cast(ComputedEntry, other)

# Equality is defined based on composition and energy
# If structures are involved, it is assumed that a {composition, energy} is
Expand Down

0 comments on commit 31b4191

Please sign in to comment.