Skip to content

fix: distinguish duplicate CDecay statements - #613

Merged
eduardo-rodrigues merged 3 commits into
scikit-hep:mainfrom
jpwgnr:jherdiec/fix-duplicate-cdecay-validation
Aug 4, 2026
Merged

fix: distinguish duplicate CDecay statements#613
eduardo-rodrigues merged 3 commits into
scikit-hep:mainfrom
jpwgnr:jherdiec/fix-duplicate-cdecay-validation

Conversation

@jpwgnr

@jpwgnr jpwgnr commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

This fixes two CDecay validation issues discovered while enabling the
DecayLanguage pre-commit hook in LHCb's DecFiles repository:

  • DecFiles !2775
    exposed files that define the same particle with both Decay and CDecay.
  • DecFiles !2776
    exposed repeated CDecay statements, which were not reported separately.

DLW003 is now named decay-cdecay-conflict, matching its existing meaning.
The new DLW006 duplicate-cdecay diagnostic reports repeated CDecay
statements, and the parser retains only one statement so it cannot create
duplicate charge-conjugate decay trees.

The warning categories, CLI output, tests, and documentation have been updated.

Validation

  • Full test suite: 380 passed, 1 skipped.
  • Full pre-commit suite passed.
  • Verified against the affected DecFiles corpus.

Let me know what you think @eduardo-rodrigues.

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.62%. Comparing base (9ee93c3) to head (82289c5).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #613      +/-   ##
==========================================
+ Coverage   97.60%   97.62%   +0.02%     
==========================================
  Files           6        6              
  Lines        1209     1222      +13     
==========================================
+ Hits         1180     1193      +13     
  Misses         29       29              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@eduardo-rodrigues eduardo-rodrigues added the enhancement New feature or request label Jul 29, 2026
@eduardo-rodrigues

Copy link
Copy Markdown
Member

Hello @jpwgnr, thank you for the speedy action given our discussions. I will check more in detail as soon as possible. For now I wanted to make an annoying comment to keep some symmetry, which I like. Given that the hook is so new and only LHCb-via-you is using it for now, I think we can still afford a change of "order" in diagnostics to have the following table, which I find nicer - we can quickly release a patch version:

| DLP001 | parse-error | The file could not be read or parsed by DecFileParser. |
| DLW001 | duplicate-decay | A particle has multiple Decay blocks; only the first is retained. |
| DLW002 | duplicate-cdecay | A particle has multiple CDecay statements; only the first is retained. |
| DLW003 | decay-cdecay-conflict | A particle is defined with both Decay and CDecay; CDecay is ignored. |
| DLW004 | missing-cdecay-source | A CDecay statement has no corresponding Decay source. |
| DLW005 | self-conjugate-cdecay | A CDecay statement targets a self-conjugate particle. |
| DLW006 | missing-copydecay-source | A CopyDecay statement references a missing Decay source. |
| DLW999 | parser-warning | An otherwise unclassified warning was emitted by DecFileParser. |

WDYT?

Comment thread src/decaylanguage/dec/dec.py Outdated
@eduardo-rodrigues

Copy link
Copy Markdown
Member

Hello @jpwgnr, do let me know if you need help here, and I will try and make some time. I see that is now necessary for the LHCb work using the hook to be finalised and put into production.

@jpwgnr

jpwgnr commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Hi @eduardo-rodrigues,
I adressed both of your requests.
Please give it another careful look, not that I missed anything.

@eduardo-rodrigues eduardo-rodrigues left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super, all goods good to my eyes 👍!

Thank you. I will make a new patch release shortly so that you can go and use this in the LHCb validations.

@eduardo-rodrigues
eduardo-rodrigues merged commit 1ef404b into scikit-hep:main Aug 4, 2026
15 checks passed
@eduardo-rodrigues

Copy link
Copy Markdown
Member

Hello @GiacomoXT, this new hook, see the README, may be of use as well within Belle-II for your validations. Just thought I would drop a comment for you. Greetings.

@GiacomoXT

Copy link
Copy Markdown

Thanks a lot! @vvsagar and I will impelement this in our pipeline.

@eduardo-rodrigues

Copy link
Copy Markdown
Member

Thanks a lot! @vvsagar and I will impelement this in our pipeline.

Top. Drop a line with feedback or a all-working-fine ... Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants