Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function wrappers: remove inferences based on argument names #2

Open
aaron-schroeder opened this issue Nov 1, 2022 · 0 comments
Open
Labels

Comments

@aaron-schroeder
Copy link
Owner

I need to look into this more, but I think I'd prefer a more flexible, less-inferential wrapper to add algorithm functions to the accessor as methods.

Current behavior:

  • Algorithm functions that expect series are added as accessor methods by passing them to PositionAccessor._add_series_method.
  • This class method creates a method that infers the columns in the DataFrame to use as inputs in the function,
    based on the names of the required positional args in the input function.
  • kwargs in the input function are passed as-is.

Desired behavior:

  • Functions are replicated as accessor methods as-is , except the positional argument for the DataFrame which becomes implicit.
    Everything else works the same way.
  • If specific series are expected by the algorithm functions, don't infer their column names within the DataFrame,
    but provide functionality within _add_series_method to specify the input and output fields.
    More explicit and easier to understand.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant