Skip to content

Comments

Derive Categorical from Argmin/Argmax#8072

Open
ricardoV94 wants to merge 4 commits intopymc-devs:mainfrom
ricardoV94:categorical_derived_rvs
Open

Derive Categorical from Argmin/Argmax#8072
ricardoV94 wants to merge 4 commits intopymc-devs:mainfrom
ricardoV94:categorical_derived_rvs

Conversation

@ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Jan 25, 2026

Couldn't resist the temptation...

Needed some import shuffling so that I'm allowed to import a SymbolicRandomVariable in logprob rewrites

@codecov
Copy link

codecov bot commented Jan 25, 2026

Codecov Report

❌ Patch coverage is 90.08264% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.80%. Comparing base (5ff12c8) to head (edd4bc7).

Files with missing lines Patch % Lines
pymc/logprob/order.py 89.28% 12 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8072      +/-   ##
==========================================
- Coverage   90.80%   90.80%   -0.01%     
==========================================
  Files         121      121              
  Lines       19443    19555     +112     
==========================================
+ Hits        17656    17756     +100     
- Misses       1787     1799      +12     
Files with missing lines Coverage Δ
pymc/distributions/custom.py 95.54% <100.00%> (+0.01%) ⬆️
pymc/distributions/distribution.py 94.50% <100.00%> (ø)
pymc/distributions/shape_utils.py 91.87% <100.00%> (ø)
pymc/logprob/transforms.py 95.64% <100.00%> (ø)
pymc/logprob/order.py 91.90% <89.28%> (-4.87%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ricardoV94
Copy link
Member Author

CC @eclipse1605 if you want to review / ask questions

import numpy as np
import pytensor.tensor as pt

from numpy.lib._array_utils_impl import normalize_axis_tuple
Copy link
Contributor

Choose a reason for hiding this comment

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

why are we importing it from a priv numpy module instead of using numpy.lib.array_utils.normalize_axis_tuple?

Copy link
Member Author

@ricardoV94 ricardoV94 Jan 28, 2026

Choose a reason for hiding this comment

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

My editor chose that import automatically, you're right

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants