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

Towards a "functional" approach #32

Open
benkrikler opened this issue May 16, 2019 · 2 comments
Open

Towards a "functional" approach #32

benkrikler opened this issue May 16, 2019 · 2 comments

Comments

@benkrikler
Copy link
Member

Imported from gitlab issue 32

A more functional approach would be helpful in removing state and making it easier to pipeline and optimise the stage sequence.

There are a few changes to the existing code that would help move us in that direction:

  • stages' event method should become __call__: if the method that actually manipulates the data were just __call__ rather than event existing stages would behave like functors, indistinguishably to a direct function call.
  • Replace the __init__ method of a stage with a factory function which returns a configured function / immutable functor. Keeping this pickleable will be important for current alphatwirl, although perhaps this restraint might be relaxed in the future too.
  • The config file should allow stages to be defined without any additional configuration.
@benkrikler
Copy link
Member Author

On 2019-04-22 Benjamin Krikler (bkrikler) wrote:

changed milestone to %2

@kreczko
Copy link
Contributor

kreczko commented Dec 8, 2020

From my first look at awkward 1.0.0 it looks like #141 would benefit from the approach discussed here. Removing state would make things a lot easier.

Could you please expand on what you mean with

The config file should allow stages to be defined without any additional configuration.

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants