Commit 206102d
Han Wang
fix(dpmodel): reject an intensive/extensive composition at construction
get_intensive aggregated with all(), so a composition mixing an intensive
with an extensive child quietly reported False -- the same
plausible-default failure mode as the capability gaps fixed alongside it.
Such a sum is not physically meaningful, so the composition must not exist
at all: LinearAtomicModel.__init__ now validates that every child agrees,
next to the existing mixed-type check, and raises naming the offenders.
The accessor is then a plain read of an invariant rather than a vote.
Regression asserts CONSTRUCTION raises, with an anti-vacuity check that
agreeing children still compose and report their value.1 parent 963b284 commit 206102d
2 files changed
Lines changed: 36 additions & 3 deletions
File tree
- deepmd/dpmodel/atomic_model
- source/tests/common/dpmodel
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
87 | 97 | | |
88 | 98 | | |
89 | 99 | | |
| |||
613 | 623 | | |
614 | 624 | | |
615 | 625 | | |
616 | | - | |
617 | | - | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
618 | 629 | | |
619 | | - | |
| 630 | + | |
620 | 631 | | |
621 | 632 | | |
622 | 633 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
499 | 499 | | |
500 | 500 | | |
501 | 501 | | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
502 | 524 | | |
503 | 525 | | |
504 | 526 | | |
| |||
0 commit comments