creativecommons / quantifying

quantify the size and diversity of the commons--the collection of works that are openly licensed or in the public domain
MIT License
23 stars 31 forks source link

Fixed: Refactor scripts #91, Adds logging #85 and Cleans code and comments #86 by Putting it in a Shared Library/Module #96

Closed IamMQaisar closed 6 months ago

IamMQaisar commented 6 months ago

Fixes

Description

The shared code including Logging from various scripts has been moved to a shared library named quantify.py.

  1. This Fix maintains all the comments and reorganization issues mentioned in #86
  2. This Fix adds a Feature of logging to the codebase as mentioned in #85
  3. This Fix adds a Feature of Shared library/module in the codebase as mentioned in #91

Technical details

  1. To Handle PYTHONPATH, sys.path.append has been used.
  2. logger is used in a shared module that logs Date ,time , module_name from where error generated and error msg.
  3. PATH_WORK_DIR exclusively handled as the sharing module quantify.py would have only shared it's own Path and not individual....Hard Coding the directory name would have negated the overall usage of getting the path from OS.PATH .

Checklist

Developer Certificate of Origin

For the purposes of this DCO, "license" is equivalent to "license or public domain dedication," and "open source license" is equivalent to "open content license or public domain dedication."

Developer Certificate of Origin ``` Developer Certificate of Origin Version 1.1 Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 1 Letterman Drive Suite D4700 San Francisco, CA, 94129 Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. ```
IamMQaisar commented 6 months ago

Hi, @TimidRobot,

I've taken another look at the code myself and would greatly appreciate your input. If you could kindly review it and provide any feedback or suggestions for improvement. I closed other Pull Requests and concisely combined those changes into one. Hope it will ease your review and going through the code.

naishasinha commented 6 months ago

Hi! Not to be that person, but because I'm tagged in this PR, I got a notification of your latest commit (around 5 - 10 minutes ago), and noticed that it was updating the README to include the logging, like my pull request did; however, your changes were the exact same format and wording as mine, as well as the exact same link that I searched for and included, indicating that my work was copied and pasted to be included in your PR:

I'm not too sure how plagiarism is handled with CC, but I would request you to possibly update your README with your own work, especially since the pull requests haven't been merged yet. Thank you for understanding!

IamMQaisar commented 6 months ago

Yes, I saw your pull, right, and yes I saw your added readme.md ...... My approach of adding logger is totally different than yours and to be mentioned that is adding readme.md doesn't necessarily states that I've copied your code or file. Kindly see the links as that is also different from yours. It's a readme file, how's it that it's plagiarized?

naishasinha commented 6 months ago

Yes, I saw your pull, right, and yes I saw your added readme.md ...... My approach of adding logger is totally different than yours and to be mentioned that is adding readme.md doesn't necessarily states that I've copied your code or file. Kindly see the links as that is also different from yours. It's a readme file, how's it that it's plagiarized?

I'm not saying that your code was plagiarized, I know that is original. I'm saying that your updates to README were the exact same as mine, and the sentence has the exact same words that I put in mine: "Built-in Python logging module to implement a flexible logging system across shared modules." and this is the link I also used: "[logging]: https://docs.python.org/3/howto/logging.html"

This was added to your PR after I submitted my PR, so I'm saying those lines were taken off of mine. Again, I'm not saying that your code was plagiarized, just wanted to clear up any confusion there!

Screenshot 2024-03-18 at 1 06 09 AM
IamMQaisar commented 6 months ago

I eventually cllosed my own 2 pull requests my self and merged that into one....so that it will not be some randomly modification again and again happening in all the pull requests, as first if loggers were added in all files and then again @TimidRobot had to review another pull and got them removed when a shared module is made then it will be a total waste of his time to go through same thing and get it change in other pull.

In that case did I copied myself and did plagiarism? 🤔No, I am just making life of the maintainer easy that He won't have to do it again and again. Same in my case and on reminding about the readme.md, I also did added that too. Which I eventually have added 2 lines myself but just went to sleep and did it on waking up now.

IamMQaisar commented 6 months ago

Yes, I saw your pull, right, and yes I saw your added readme.md ...... My approach of adding logger is totally different than yours and to be mentioned that is adding readme.md doesn't necessarily states that I've copied your code or file. Kindly see the links as that is also different from yours. It's a readme file, how's it that it's plagiarized?

I'm not saying that your code was plagiarized, I know that is original. I'm saying that your updates to README were the exact same as mine, and the sentence has the exact same words that I put in mine: "Built-in Python logging module to implement a flexible logging system across shared modules." and this is the link I also used: "[logging]: https://docs.python.org/3/howto/logging.html"

This was added to your PR after I submitted my PR, so I'm saying those lines were taken off of mine. Again, I'm not saying that your code was plagiarized, just wanted to clear up any confusion there!

Screenshot 2024-03-18 at 1 06 09 AM

Okay then let me change it for you, I just saw your pull and added my own readme.md too !

naishasinha commented 6 months ago

Okay then let me change it for you, I just saw your pull and added my own readme.md too !

Thank you, I appreciate it!

IamMQaisar commented 6 months ago

Updated the readme.md , eventually it's not that I meant to do any copy, and I didn't even had the idea of plagiarism being considered on GitHub means it's all PUBLIC....Also, I go through all pulls to take ideas and update myself for learning purposes and when I encounter mistakes in there, I help those Pull Request makers too. Like yesterday in #92 , I just intend to help others contributors and maintainers and nothing else. Hope you understand !

naishasinha commented 6 months ago

No worries, thank you for changing it!

IamMQaisar commented 6 months ago

Hi @TimidRobot , Have you reviewed the pull and does it require any changes?

TimidRobot commented 6 months ago

This size/scope of this PR makes it difficult to review.

Please resolve conflicts.

IamMQaisar commented 6 months ago

Hi @TimidRobot , I know, I've tried to resolve 3 PRs here but more likely it's actually better in sense the code won't be changing on each pull....., I will resolve the conflicts if there are any, just let me know of them. is the wikipedia_scratcher.py having any conflict as it has been recently merged as new code into the main repo?

IamMQaisar commented 6 months ago

wikipedia_scratcher.py updated to the latest merge and other merge conflicts are also resolved. Let me know of any other changes if required.