Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify signatures of graph_replace and clone_replace #398

Merged
merged 3 commits into from
Jul 26, 2023

Conversation

ferrine
Copy link
Member

@ferrine ferrine commented Jul 25, 2023

Motivation for these changes

pytensor.graph_replace and pytensor.clone_replace have different signatures yet provide similar functionality. Sometimes it is handy to decide on which one to use, but since signatures are different it is hard to make changes.

Implementation details

I've changed typing to use overload in the appropriate places.

Checklist

Major / Breaking Changes

  • Old code should not be affected

New features

  • Extended public API to handle more cases

@ricardoV94 ricardoV94 changed the title unify signatures Unify signatures of graph_replace and clone_replace Jul 26, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #398 (abf41dc) into main (673c1ac) will decrease coverage by 0.01%.
Report is 1 commits behind head on main.
The diff coverage is 80.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #398      +/-   ##
==========================================
- Coverage   80.47%   80.47%   -0.01%     
==========================================
  Files         156      156              
  Lines       45519    45554      +35     
  Branches    11149    11159      +10     
==========================================
+ Hits        36631    36658      +27     
- Misses       6686     6694       +8     
  Partials     2202     2202              
Files Changed Coverage Δ
pytensor/compile/function/pfunc.py 83.17% <69.23%> (-1.02%) ⬇️
pytensor/graph/replace.py 83.87% <83.78%> (-0.75%) ⬇️

@ricardoV94 ricardoV94 merged commit 14d2454 into main Jul 26, 2023
52 checks passed
@ricardoV94 ricardoV94 deleted the graph-replace-signature branch June 13, 2024 12:44
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.

3 participants