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

Improvements to the dataDiffChecker.py file #119

Open
trevorb1 opened this issue Feb 4, 2022 · 0 comments
Open

Improvements to the dataDiffChecker.py file #119

trevorb1 opened this issue Feb 4, 2022 · 0 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@trevorb1
Copy link
Member

trevorb1 commented Feb 4, 2022

The module scripts/developer_tools/dataDiffCheck/ is totally functional and works great! I do have some comments/questions for improvements though :)

  1. Improve python style for looping. Instead of writing
    for i in range(0, len(LIST_OF_SHEETS)):
    oldCounterList.append(collections.Counter(oldListList[i]))
    newCounterList.append(collections.Counter(newListList[i]))

    I think we can write
 for sheet in LIST_OF_SHEETS: 
     oldCounterList.append(collections.Counter(sheet))
     newCounterList.append(collections.Counter(sheet)) 
  1. Are we able to add in a statement before here that checks if the files are different? So if there are no differences, it only prints out the one line both files are the same and we don't have to look through all the print statements to see if there are issues? Or maybe only print out where the differences are? Not sure which one is better off the top of my head?

    # Compare files
    for i in range(0, len(LIST_OF_SHEETS)):
    resultsTxt.write("\n\n" + LIST_OF_SHEETS[i] + "\n")
    if oldCounterList[i] == newCounterList[i]:
    resultsTxt.write("Both files are the same.")
    else: # oldCounterList[i] != newCounterList[i]
    resultsTxt.write("The two files are different.")

  2. In the readme, should we change the file paths to path/to/new.txt and path/to/old.txt or something more general and shorter? Like the files don't need to be named CanadaUSA.txt?

image

  1. Continuing off point 3, I really like the functionaly of this and it should work for all osemosys projects! Can we remove the places where its specific to this project? (ie. the module name and readme docs)
@trevorb1 trevorb1 added enhancement New feature or request question Further information is requested labels Feb 4, 2022
@Kiel-SFU Kiel-SFU removed their assignment Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants