inducer / inducer/pytato

`NodeCountMapper` doesn't count nodes inside functions

Open
#513 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
15
Forks
16
Avg merge
17m
Merged PRs (30d)
1

Description

Comparing my concatenation changes with `main` reminded me that `NodeCountMapper` doesn't currently accumulate node counts from functions into the overall count. It should be given a `map_function_definition` method that does something similar to `CallSiteCountMapper`: https://github.com/inducer/pytato/blob/78b43c197390d7aee1ec86357660d833223ddb69/pytato/analysis/__init__.py#L435-L446
I wonder if the default `map_function_definition` implementation in `CachedWalkMapper` should be disabled, to avoid bugs like this? Maybe a default implementation could be provided in a separate method, e.g. `_basic_map_function_definition`, for convenience in mappers that don't need special behavior.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.