|
19 | 19 | import warnings |
20 | 20 |
|
21 | 21 | # Suppress specific noisy warnings from ASE CIF parser and torch_dftd |
| 22 | +warnings.filterwarnings('ignore', category=DeprecationWarning) |
22 | 23 | warnings.filterwarnings( |
23 | 24 | "ignore", |
24 | 25 | message="crystal system 'monoclinic' is not interpreted", |
|
30 | 31 | category=UserWarning, |
31 | 32 | ) |
32 | 33 |
|
| 34 | + |
33 | 35 | from pyxtal.interface.ase_opt import ASE_relax, resolve_model, DEFAULT_MODELS, get_calculator |
34 | 36 | from pyxtal.util import ase2pymatgen |
35 | 37 | from pymatgen.analysis.structure_matcher import StructureMatcher |
@@ -170,6 +172,8 @@ def _configure_worker_threads(): |
170 | 172 |
|
171 | 173 | def _init_worker(calculator, model, quick): |
172 | 174 | """Load the calculator once per worker process (safe with spawn).""" |
| 175 | + import warnings |
| 176 | + warnings.filterwarnings('ignore', category=DeprecationWarning, module='spglib') |
173 | 177 | _configure_worker_threads() |
174 | 178 | get_calculator(calculator, model=model, quick=quick) |
175 | 179 |
|
@@ -311,8 +315,8 @@ def main(cif_path, nproc=4, step=200, fmax=0.1, out_dir=None, db_file=None, ref_ |
311 | 315 | print(f'Parsed {len(entries)} blocks, {cutoff_pct:.1f} percentile energy = {threshold:.6f} eV') |
312 | 316 |
|
313 | 317 | # select those with energy < threshold |
314 | | - selected = [e for e in entries if e['energy'] is not None and e['energy'] < threshold] |
315 | | - print(f'{len(selected)} selected (energy < {cutoff_pct:.1f} percentile)') |
| 318 | + selected = [e for e in entries if e['energy'] is not None and e['energy'] <= threshold] |
| 319 | + print(f'{len(selected)} selected (energy <= {cutoff_pct:.1f} percentile)') |
316 | 320 |
|
317 | 321 | # Use a single StructureMatcher across deduplication and reference matching. |
318 | 322 | matcher = StructureMatcher(ltol=0.3, stol=0.3, angle_tol=5.0) |
@@ -510,7 +514,7 @@ def main(cif_path, nproc=4, step=200, fmax=0.1, out_dir=None, db_file=None, ref_ |
510 | 514 | sel_x = sorted(selected_ids) |
511 | 515 | sel_y = [model_energies[i] for i in sel_x] |
512 | 516 | ax_bot.plot(sel_x, sel_y, 's-', color='#008B8B', |
513 | | - label=f'{calculator} energy ({len(selected_ids)})', |
| 517 | + label=f'{calculator} energy ({len(unique_selected)} unique)', |
514 | 518 | markersize=6, zorder=1) |
515 | 519 | # Highlight relaxed structure matches on bottom if present |
516 | 520 | if sel_x: |
|
0 commit comments