Skip to content
New issue

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

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

Already on GitHub? # to your account

Refactoring proposal #465

Merged
merged 3 commits into from
Feb 10, 2021
Merged

Refactoring proposal #465

merged 3 commits into from
Feb 10, 2021

Conversation

ValentinMouret
Copy link
Contributor

Hey :)

First, thank you very much for your work with Our World in Data. It rocked from day 1 and helped me a lot to understand the pandemic when it started out.

This pull-request is a proposal to streamline the pipelines.
It leverages higher-level Pandas APIs that allow decomposing said pipelines in series of functional steps.

Since steps are decoupled, they are easier to reason about, test, and reuse (e.g. in notebooks for explorations or development or across pipelines). Also, it limits mutable states to a minimum.

Probably it also makes it easier to scan through files to find patterns and set and enforce behaviors across pipelines.

Also, it adds Python type hints, which make it easier to understand the code and leverage autocompletion and such.

If you think there is value in doing that, I can take care of all the pipelines.
Since it takes some time to do, I wanted your feedback on a proof of concept before refactoring all of them. 😄

Signed-off-by: ValentinMouret <valentin.mou@gmail.com>
Signed-off-by: ValentinMouret <valentin.mou@gmail.com>
Signed-off-by: ValentinMouret <valentin.mou@gmail.com>
@edomt
Copy link
Collaborator

edomt commented Feb 10, 2021

Salut Valentin !

This is absolutely great, thank you so much for doing this! Some of this formatting is fairly new to me, so I can't promise I'll be able to 100% match the cleanliness of this in the future scripts I'll write, but I'll try my best ;)

I'll merge this now (also because I need to make some changes to the script for Austria, and I want to do them on the basis of your improvements), and yes feel free to open another PR (or multiple) for other scripts.

Again, thank you!

@edomt edomt merged commit c1b7a6a into owid:master Feb 10, 2021
@ValentinMouret ValentinMouret deleted the use-piping branch February 10, 2021 10:53
@lucasrodes lucasrodes mentioned this pull request Feb 19, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants