Skip to content

Commit 1975b92

Browse files
committed
revert to if: github.repository == 'materialsproject/pymatgen' to prevent running tests on forks
1 parent b11f091 commit 1975b92

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ permissions:
2323
jobs:
2424
pytest:
2525
# prevent this action from running on forks
26-
if: ${{ !github.event.pull_request.head.repo.fork }}
26+
if: github.repository == 'materialsproject/pymatgen'
2727
strategy:
2828
fail-fast: false
2929
matrix:

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ci:
88

99
repos:
1010
- repo: https://github.com/astral-sh/ruff-pre-commit
11-
rev: v0.0.276
11+
rev: v0.0.277
1212
hooks:
1313
- id: ruff
1414
args: [--fix]
@@ -27,12 +27,12 @@ repos:
2727
- id: black
2828

2929
- repo: https://github.com/pre-commit/mirrors-mypy
30-
rev: v1.4.0
30+
rev: v1.4.1
3131
hooks:
3232
- id: mypy
3333

3434
- repo: https://github.com/codespell-project/codespell
35-
rev: v2.2.4
35+
rev: v2.2.5
3636
hooks:
3737
- id: codespell
3838
stages: [commit, commit-msg]

pymatgen/analysis/elasticity/elastic.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -979,16 +979,14 @@ def generate_pseudo(strain_states, order=3):
979979
order (int): order of pseudo-inverse to calculate
980980
981981
Returns:
982-
mis: pseudo inverses for each order tensor, these can
983-
be multiplied by the central difference derivative
984-
of the stress with respect to the strain state
985-
absent_syms: symbols of the tensor absent from the PI
986-
expression
982+
pseudo_inverses: for each order tensor, these can be multiplied by the central
983+
difference derivative of the stress with respect to the strain state
984+
absent_syms: symbols of the tensor absent from the PI expression
987985
"""
988986
s = sp.Symbol("s")
989987
nstates = len(strain_states)
990988
ni = np.array(strain_states) * s
991-
mis, absent_syms = [], []
989+
pseudo_inverses, absent_symbols = [], []
992990
for degree in range(2, order + 1):
993991
cvec, carr = get_symbol_list(degree)
994992
sarr = np.zeros((nstates, 6), dtype=object)
@@ -1000,13 +998,13 @@ def generate_pseudo(strain_states, order=3):
1000998
exps /= math.factorial(degree - 1)
1001999
sarr[n] = [sp.diff(exp, s, degree - 1) for exp in exps]
10021000
svec = sarr.ravel()
1003-
present_syms = set.union(*(exp.atoms(sp.Symbol) for exp in svec))
1004-
absent_syms += [set(cvec) - present_syms]
1001+
present_symbols = set.union(*(exp.atoms(sp.Symbol) for exp in svec))
1002+
absent_symbols += [set(cvec) - present_symbols]
10051003
m = np.zeros((6 * nstates, len(cvec)))
10061004
for n, c in enumerate(cvec):
10071005
m[:, n] = v_diff(svec, c)
1008-
mis.append(np.linalg.pinv(m))
1009-
return mis, absent_syms
1006+
pseudo_inverses.append(np.linalg.pinv(m))
1007+
return pseudo_inverses, absent_symbols
10101008

10111009

10121010
def get_symbol_list(rank, dim=6):

0 commit comments

Comments
 (0)