[Code scan] Missing NVE systems crash stability scoring instead of receiving the failure penalty

Open Beginner friendly
#440 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python
Domain
data

Research direction

Start in lambench/metrics/vishelper/metrics_calculations.py at the linked _calculate_instability_error() code and inspect how DataFrame.from_dict creates missing cells. Add a regression test with one model missing a system present for another, then verify that non-dict, null, and NaN cells receive the failure penalty of 5 instead of crashing.

Written by the indexing model from the issue text.

Description

This issue was found by a Codex global repository scan of tracked non-test files at commit 8c93925cb10b401b2b83c738bd9263fd74474468.

Relevant code

https://github.com/deepmodeling/LAMBench/blob/8c93925cb10b401b2b83c738bd9263fd74474468/lambench/metrics/vishelper/metrics_calculations.py#L166-L189

Impact

DataFrame.from_dict(..., orient="index") fills missing per-system NVE entries with NaN. _calculate_instability_error() handles None, but then calls cell.get(...) on the cell value. For NaN, that raises AttributeError instead of returning the documented failure penalty.

A model with one missing NVE system can crash stability scoring rather than receiving the intended penalty.

Suggested fix

Treat non-dict, null, and NaN cells as failed simulations and return 5. Add a regression test where one model is missing a system present for another model.

Dominant language
Python
Stars
20
Forks
11
Avg merge
30m
Merged PRs (30d)
4

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from deepmodeling/LAMBench

All issues in deepmodeling/LAMBench

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.