Skip to content
This repository was archived by the owner on Nov 23, 2024. It is now read-only.
This repository was archived by the owner on Nov 23, 2024. It is now read-only.

Propagation error #299

Open
Open
@lukarade

Description

@lukarade

Describe the bug

In some cases, the reasons of impurity are not propagated at all. This is undesirable because it will lead to impure functions wrongly being classified as pure.
Here are some examples of these cases:

# seaborn_v0.12.2._core.properties.get_mapping.764.4
def get_mapping(self, scale: Scale, data: Series) -> Mapping:
    """Return a function that maps each data value to True or False."""
    boolean_scale = isinstance(scale, Boolean)
    order = getattr(scale, "order", [True, False] if boolean_scale else None) # Impure Builtin not propagated
    levels = categorical_order(data, order)
    values = self._get_values(scale, levels) # Impure Call not propagated
# seaborn_v0.12.2._core.properties._get_nominal_mapping.223.4
def _get_nominal_mapping(self, scale: Nominal, data: Series) -> Mapping:
     """Identify evenly-spaced values using interval or explicit mapping."""
    levels = categorical_order(data, scale.order)
    values = self._get_values(scale, levels) # Impure Call not propagated

Others:

# seaborn_v0.12.2.widgets.choose_colorbrewer_palette.47.0
# pandas_v2.0.3.core._numba.executor.generate_shared_aggregator.16.0
# pandas_v2.0.3.core.window.numba_.generate_manual_numpy_nan_agg_with_axis.243.0

To Reproduce

  1. Run purity analysis on the libraries
  2. Check the result file

Expected behavior

The reasons of impurity must be propagated correctly.

Screenshots (optional)

No response

Additional Context (optional)

There is no pattern detectable in which the reasons are not propagated correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🪲Something isn't workingpurityInferring the purity of functions

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions