Skip to content

Commit d6134e7

Browse files
authored
Merge branch 'main' into dependabot/pip/ase-3.29.0
2 parents ae718c3 + 7a33f31 commit d6134e7

13 files changed

Lines changed: 482 additions & 65 deletions

File tree

.github/workflows/build_docs.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ jobs:
4242
github.event.pull_request.head.sha ||
4343
github.sha
4444
}}
45+
# Required since actions/checkout began refusing fork PR code in
46+
# workflow_run jobs. Safe here: fork PRs from all external
47+
# contributors require maintainer approval before this trusted,
48+
# secret-holding run can execute (repo Actions setting).
49+
# See https://gh.io/securely-using-pull_request_target
50+
allow-unsafe-pr-checkout: true
4551
# Optional: get full history if needed
4652
fetch-depth: 0
4753

@@ -99,4 +105,4 @@ jobs:
99105
if: always()
100106
uses: ./.github/actions/multi-trigger-cleanup
101107
with:
102-
status-context: '${{ github.job }}'
108+
status-context: '${{ github.job }}'

.github/workflows/test.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ jobs:
7272
uses: actions/checkout@v7
7373
with:
7474
ref: ${{ env.HEAD_SHA }}
75+
# Required since actions/checkout began refusing fork PR code in
76+
# workflow_run jobs. Safe here: fork PRs from all external
77+
# contributors require maintainer approval before this trusted,
78+
# secret-holding run can execute (repo Actions setting).
79+
# See https://gh.io/securely-using-pull_request_target
80+
allow-unsafe-pr-checkout: true
7581
# Optional: get full history if needed
7682
fetch-depth: 0
7783

@@ -141,7 +147,7 @@ jobs:
141147
142148
- if: ${{ matrix.python_version == '3.13' }}
143149
name: codecov-coverage
144-
uses: codecov/codecov-action@v6
150+
uses: codecov/codecov-action@v7
145151
with:
146152
fail_ci_if_error: false
147153
files: ./coverage.xml
@@ -183,6 +189,9 @@ jobs:
183189
uses: actions/checkout@v7
184190
with:
185191
ref: ${{ env.HEAD_SHA }}
192+
# See the checkout step in the `test` job for why this is set
193+
# and why it is safe (external-contributor approval gate).
194+
allow-unsafe-pr-checkout: true
186195
fetch-depth: 0
187196

188197
- name: Setup
@@ -290,6 +299,12 @@ jobs:
290299
uses: actions/checkout@v7
291300
with:
292301
ref: ${{ env.HEAD_SHA }}
302+
# Required since actions/checkout began refusing fork PR code in
303+
# workflow_run jobs. Safe here: fork PRs from all external
304+
# contributors require maintainer approval before this trusted,
305+
# secret-holding run can execute (repo Actions setting).
306+
# See https://gh.io/securely-using-pull_request_target
307+
allow-unsafe-pr-checkout: true
293308
# Optional: get full history if needed
294309
fetch-depth: 0
295310

@@ -369,6 +384,9 @@ jobs:
369384
uses: actions/checkout@v7
370385
with:
371386
ref: ${{ env.HEAD_SHA }}
387+
# See the checkout step in the `test` job for why this is set
388+
# and why it is safe (external-contributor approval gate).
389+
allow-unsafe-pr-checkout: true
372390
fetch-depth: 0
373391

374392
- name: Setup
@@ -446,6 +464,12 @@ jobs:
446464
uses: actions/checkout@v7
447465
with:
448466
ref: ${{ env.HEAD_SHA }}
467+
# Required since actions/checkout began refusing fork PR code in
468+
# workflow_run jobs. Safe here: fork PRs from all external
469+
# contributors require maintainer approval before this trusted,
470+
# secret-holding run can execute (repo Actions setting).
471+
# See https://gh.io/securely-using-pull_request_target
472+
allow-unsafe-pr-checkout: true
449473
# Optional: get full history if needed
450474
fetch-depth: 0
451475

src/fairchem/applications/fastcsp/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,11 @@ FastCSP uses YAML configuration files to control all workflow parameters. Exampl
204204
`vars.{Z, spg_distribution_type, num_structures_per_spg, read_z_from_file,
205205
read_spg_from_file}`) and SLURM block
206206
- `pre_relaxation_filter`: Pre-ML deduplication
207-
(`assign_groups`, `remove_duplicates`, `ltol`/`stol`/`angle_tol`,
207+
(`assign_groups`, `remove_duplicates`, `remove_problematic`, `ltol`/`stol`/`angle_tol`,
208208
`bin_by_conf`/`bin_by_z`/`bin_by_spg`, `density_bin_size`, `density_tol`,
209-
`apply_niggli_filter`, `npartitions`)
209+
`apply_niggli_filter`, `npartitions`). Set `remove_problematic: true` to drop structures whose
210+
generation-time validity flags (`correct_z`, `molecule_matches_reference`) are False before
211+
relaxation.
210212
- `relax`: ML relaxation settings
211213
(`calculator`, `optimizer`, `fmax`, `max_steps`, `fix_symmetry`,
212214
`relax_cell`, `write_traj`, `traj_interval`) and SLURM block

src/fairchem/applications/fastcsp/core/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ genarris:
8787
pre_relaxation_filter:
8888
assign_groups: true # run dedup blocker
8989
remove_duplicates: true # drop all-but-one per group (rep = closest-to-median density)
90+
remove_problematic: false # drop structures whose generation-time validity flags are False (default: false)
9091
ltol: 0.3 # StructureMatcher tolerances (looser than post-relax)
9192
stol: 0.4
9293
angle_tol: 5

src/fairchem/applications/fastcsp/core/configs/example_config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ pre_relaxation_filter:
4747
assign_groups: true # run dedup blocker + assign group_index. Default false
4848
remove_duplicates: true # drop all-but-one per group (representative = closest
4949
# to the group-median density_generated). Default false
50+
remove_problematic: false # Remove structures that failed generation-time validity
51+
# checks (correct_z, molecule_matches_reference)
5052
# StructureMatcher tolerances (looser than post-relax)
5153
ltol: 0.3 # lattice tolerance. Default 0.2
5254
stol: 0.4 # site tolerance (Å). Default 0.3

src/fairchem/applications/fastcsp/core/utils/deduplicate.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,18 @@
1313
import os
1414
from collections import defaultdict
1515
from functools import partial
16+
from typing import TYPE_CHECKING
1617

1718
import numpy as np
18-
import pandas as pd # Noqa: TCH002
1919
from fairchem.applications.fastcsp.core.utils.logging import get_central_logger
2020
from fairchem.applications.fastcsp.core.utils.structure import get_structure_group
2121
from p_tqdm import p_map
2222
from pymatgen.analysis.structure_matcher import StructureMatcher
2323
from tqdm import tqdm
2424

25+
if TYPE_CHECKING:
26+
import pandas as pd
27+
2528

2629
def process_structure_group(
2730
group_data,

0 commit comments

Comments
 (0)