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

Ensure that adapters can be constructed in a simpler manner than they are currently #272

Open
timkpaine opened this issue Jun 6, 2024 · 0 comments
Labels
adapter: general Issues and PRs related to input/output adapters in general type: enhancement Issues and PRs related to improvements to existing features

Comments

@timkpaine
Copy link
Member

timkpaine commented Jun 6, 2024

1. Adapters + Impls where the Impl is tiny:

class MyPullAdapterImpl(PullInputAdapter):

MyPullAdapter = py_pull_adapter_def("MyPullAdapter", MyPullAdapterImpl, ts[int], interval=timedelta, num_ticks=int)

One would expect we could do this via type annotations in some form or another, or something like pydantic since the py_pull_adapter_def mostly serves to wrap the impl inputs.

2. Minimal Managers / other places where excess classes are needed

https://github.com/Point72/csp/blob/234f94cfd9924ca479485b97d56f7cc91141f3d2/examples/04_writing_adapters/e3_adaptermanager_pullinput.py
https://github.com/Point72/csp/blob/main/examples/04_writing_adapters/e5_adaptermanager_pushinput.py

These examples requires 4+ classes (!!):

  • MyAdapterManager
  • MyAdapterManagerImpl
  • MyManagedSimAdapterImpl
  • MyManagedSimAdapter

This is pretty bad UX/design.

3. Automatic py_push_adapter_def / py_output_adapter_def, etc

Similar to the above, we often create these "anonymous" objects for binding the adapter-specific code to the engine wrapping necessary, I think we can consolidate this in some form

_kafka_input_adapter_def = input_adapter_def(

@timkpaine timkpaine added type: enhancement Issues and PRs related to improvements to existing features adapter: general Issues and PRs related to input/output adapters in general labels Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adapter: general Issues and PRs related to input/output adapters in general type: enhancement Issues and PRs related to improvements to existing features
Projects
None yet
Development

No branches or pull requests

1 participant