DeltaE / Canada-U.S.-ElecTrade

The Role of U.S.-Canada Electricity Trade in North American Decarbonization Pathways
2 stars 0 forks source link

Improvements to the dataDiffChecker.py file #119

Open trevorb1 opened 2 years ago

trevorb1 commented 2 years ago

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 https://github.com/DeltaE/Canada-U.S.-ElecTrade/blob/c8af7e64fb1d8f70ad382e66536a674784c94682/scripts/developer_tools/dataDiffCheck/CanadaUsaTxtDiffCheck.py#L105-L107 I think we can write

    for sheet in LIST_OF_SHEETS: 
     oldCounterList.append(collections.Counter(sheet))
     newCounterList.append(collections.Counter(sheet)) 
  2. 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? https://github.com/DeltaE/Canada-U.S.-ElecTrade/blob/c8af7e64fb1d8f70ad382e66536a674784c94682/scripts/developer_tools/dataDiffCheck/CanadaUsaTxtDiffCheck.py#L111-L117

  3. 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)