Skip to content

[MNT]: Scale val_in_range method #31286

Closed

Description

@scottshambaugh

Summary

From @timhoffm's comment: #31061 (comment)

Should we grow a method Scale.val_in_range(val). This seems like a logically meaningful API. ScaleBase could implement this as a generic fallback via limit_range_for_scale to support existing third-party scales. But specific scales could implement their logic much more efficiently; e.g. LinearScale would just return True, and LogScale would return val > 0.

Should be cleaner logic and faster computation.

Proposed fix

Implement and update Axes._point_in_data_domain to use it.

Activity

  1. changed the title [-][MNT]: Scale.val_in_range method[/-] [+][MNT]: Scale `val_in_range` method[/+] on Mar 11, 2026
  2. null-dreams commented on Mar 14, 2026

    @null-dreams
    Contributor

    Hi @scottshambaugh! I would like work on this fix if it's still open.
    I have implemented val_in_range in ScaleBase with a fallback and added optimized overrides in LinearScale, LogScale and LogitScale. I have also refactored _point_in_data_domain to use this new change. I'll open a draft PR shortly. I would appreciate any guidance regarding documentation and docstring updates. Thank you.

  3. added this to the v3.11.0 milestone on Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions