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

Prefix trimmer #138

Merged
merged 4 commits into from
Nov 28, 2022
Merged

Prefix trimmer #138

merged 4 commits into from
Nov 28, 2022

Conversation

odashi
Copy link
Collaborator

@odashi odashi commented Nov 27, 2022

Overview

Taking over #113 with more complete approaches.

This change introduces PrefixTrimmer, which prunes the attribute prefixes with the leftmost longest manner.

Details

  • PrefixTrimmer is implemented as a NodeTransformer that replaces chained Attribute nodes with trimmed subtrees.
  • Adds prefixes option to control which prefix should be trimmed. math, numpy, np are trimmed by default (to maintain the current behavior).

References

Blocked by

NA

@odashi odashi requested a review from ShigekiKarita November 27, 2022 13:53
@odashi odashi changed the title [WIP] Prefix trimmer Prefix trimmer Nov 27, 2022
@odashi odashi merged commit 7d8a436 into main Nov 28, 2022
@odashi odashi deleted the 81-prefix-trimmer branch November 28, 2022 01:42
@odashi odashi added the feature label Nov 28, 2022
@odashi odashi added this to the v0.3 milestone Nov 28, 2022
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.

Custom list of prefixes that should be trimmed Package name trimming as a NodeTransformer
2 participants