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

Refactor using functools.partial #868

Open
ns-rse opened this issue Jul 2, 2024 · 0 comments
Open

Refactor using functools.partial #868

ns-rse opened this issue Jul 2, 2024 · 0 comments
Labels
Low Priority refactor Refactoring of code

Comments

@ns-rse
Copy link
Collaborator

ns-rse commented Jul 2, 2024

@MaxGamill-Sheffield has been looking at using functools.partial to control workflows based on OrderedDict dictionaries which can be derived from YAML configuration files.

An example of how this can work is shown in the Gist Use the functools partial function to refactor and setup a TopoStats filters pipeline by reading in an "OrderedDict"

@MaxGamill-Sheffield : It looks like the key around this is the mapping() function where the available_steps are ordered into available_steps.

The use of functools.partial() is required so that not all arguments need explicitly provided and *args / **kwargs are used instead to pass defaults (we already leverage functools.partial() in run_topostats.run_topostats.py to handle multi-processing).

Do you have any resources and other examples that informed your Gist that might be useful?

Because of the large number of outstanding issues and current work I've marked this as Low Priorit and added it to Milestone 4.

@ns-rse ns-rse added Low Priority refactor Refactoring of code labels Jul 2, 2024
@ns-rse ns-rse added this to the M4 : On-going Refactoring milestone Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Low Priority refactor Refactoring of code
Projects
None yet
Development

No branches or pull requests

1 participant