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

Add loading and exporting functions to utils #83

Conversation

shashank-iitbhu
Copy link
Contributor

@shashank-iitbhu shashank-iitbhu commented Feb 27, 2024

Contributor checklist


Description

Added common functions for loading and exporting data to utils.py.
Added get_language_dir_path, load_queried_data, export_formatted_data in utils.py .

Related issue

Signed-off-by: Shashank Mittal <[email protected]>
Copy link

github-actions bot commented Feb 27, 2024

Thank you for the pull request!

The Scribe team will do our best to address your contribution as soon as we can. The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)

If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the General and Data rooms once you're in. It'd be great to have you!

Maintainer checklist

  • The commit messages for the remote branch should be checked to make sure the contributor's email is set up correctly so that they receive credit for their contribution

    • The contributor's name and icon in remote commits should be the same as what appears in the PR
    • If there's a mismatch, the contributor needs to make sure that the email they use for GitHub matches what they have for git config user.email in their local Scribe-Data repo
  • The CHANGELOG has been updated with a description of the changes for the upcoming release and the corresponding issue (if necessary)

@shashank-iitbhu shashank-iitbhu changed the title added common funcs to utils.py [WIP] added common funcs to utils.py Feb 27, 2024
@shashank-iitbhu
Copy link
Contributor Author

Hey @andrewtavis ! Added these three functions get_language_dir_path, load_queried_data, export_formatted_data in utils.py . Also used them in the format files in the latest commit.
The update_data.py is querying and formatting the data of these languages as expected even after the changes.
Please review whenever you get time.

@wkyoshida
Copy link
Member

Hey @shashank-iitbhu! 👋
Sorry - just to confirm with you, is this PR good now to start reviewing?
Just wanted to check first due to the "[WIP]" still in the PR title 😄

@shashank-iitbhu
Copy link
Contributor Author

Hey @shashank-iitbhu! 👋 Sorry - just to confirm with you, is this PR good now to start reviewing? Just wanted to check first due to the "[WIP]" still in the PR title 😄

Yes, this can be reviewed. Haven't added the doc strings yet. Also, let me know if tests should be added for these functions?

…m:shashank-iitbhu/Scribe-Data into add-common-func-for-loading-and-exporting
@shashank-iitbhu
Copy link
Contributor Author

The newly added function get_language_dir_path is also required by #88 and #89 . So when this branch is merged, I will have to rebase from main and make changes to PR 88 and 89.

@shashank-iitbhu shashank-iitbhu changed the title [WIP] added common funcs to utils.py Add loading and exporting functions to utils Mar 6, 2024
Signed-off-by: Shashank Mittal <[email protected]>
Signed-off-by: Shashank Mittal <[email protected]>
@andrewtavis andrewtavis self-requested a review March 9, 2024 13:23
@andrewtavis
Copy link
Member

This is really great, @shashank-iitbhu :) Minor inline comments coming shortly 😊

@andrewtavis
Copy link
Member

Am thinking that the above changes should be pretty straightforward, @shashank-iitbhu 😊 Happy to merge once they come through!

Signed-off-by: Shashank Mittal <[email protected]>
Signed-off-by: Shashank Mittal <[email protected]>
@andrewtavis
Copy link
Member

I added in a couple of changes here to bring our tooling a bit into the next generation: specifically adopting Ruff over Black for formatting. @shashank-iitbhu, I'd suggest you to install the VS Code extension for Ruff so that formatting is taken care of for you :)

Aside from this the only changes to the committed code was to make all arguments for the functions be explicitly passed 😊

Copy link
Member

@andrewtavis andrewtavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for this, @shashank-iitbhu! All of this refactoring is really coming along! 🚀 Will send a message to the data channel with some info about some of the other changes I included in here :)

@andrewtavis andrewtavis merged commit 1eb18d9 into scribe-org:main Mar 17, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extract Wikidata loading and data exporting to utils.py
3 participants