Skip to content

Diagonal gate predicate function #15

@meson800

Description

@meson800

If people are doing diagonal gates, it would be great to actually do said diagonal gates in Python.
Inspired by matplotlib.pyplot.axline, the easiest way to do this in log space would be to let the user specify two points on the line to compute the diagonal line.

The signature of such a function would be

# in rd.flow
def diagonal_gate(df: pd.DataFrame, x_col: str, y_col: str, xy1: Tuple[float,float], xy2: Tuple[float,float]) -> pd.Series:
  # Computes if, in log space, each row in the data frame is above or below the line. The returned series is just
  # a series of booleans so you can use it for slicing
  pass

You would use it like

df = df[rd.flow.diagonal_gate(df, 'FSC-A', 'mGL-A', (250, 250), (2500, 1000))]

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions