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

Propagation error #299

Open
lukarade opened this issue Aug 30, 2024 · 0 comments
Open

Propagation error #299

lukarade opened this issue Aug 30, 2024 · 0 comments
Labels
bug 🪲 Something isn't working purity Inferring the purity of functions

Comments

@lukarade
Copy link
Contributor

lukarade commented Aug 30, 2024

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.

@lukarade lukarade added the bug 🪲 Something isn't working label Aug 30, 2024
@lukarade lukarade added the purity Inferring the purity of functions label Aug 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug 🪲 Something isn't working purity Inferring the purity of functions
Projects
Status: Backlog
Development

No branches or pull requests

1 participant