Skip to content

Raise error on coord/variable name collisions#8093

Open
Chirag3841 wants to merge 4 commits intopymc-devs:mainfrom
Chirag3841:pymc
Open

Raise error on coord/variable name collisions#8093
Chirag3841 wants to merge 4 commits intopymc-devs:mainfrom
Chirag3841:pymc

Conversation

@Chirag3841
Copy link

@Chirag3841 Chirag3841 commented Feb 6, 2026

Description

Related Issue

Checklist

Type of change

  • New feature / enhancement
  • [ x] Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

Description

It adds explicit validation checks in:
Model.add_coord: raises if a coord name already exists in Model.named_vars
Model.add_named_variable: raises if a variable name already exists in Model.coords
This ensures invalid models fail early and avoids silent downstream issues .

@welcome
Copy link

welcome bot commented Feb 6, 2026

Thank You Banner]
💖 Thanks for opening this pull request! 💖 The PyMC community really appreciates your time and effort to contribute to the project. Please make sure you have read our Contributing Guidelines and filled in our pull request template to the best of your ability.

@github-actions github-actions bot added the bug label Feb 6, 2026
@Chirag3841
Copy link
Author

Chirag3841 commented Feb 6, 2026

@drbenvincent
I have implemented the changes and added tests too. Please have a look.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Missing check for collision between coord name and data variable name

1 participant