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 T015–T017 to clean three ADB ATO data sets #78

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

HannaMorde
Copy link

Data cleaning of "ATO Workbook (TRANSPORT ACTIVITY & SERVICES (TAS))2023.xlsx" was done and merged the output into the cleaned "master dataset.csv".

@khaeru
Copy link
Contributor

khaeru commented Dec 11, 2023

Hi @hannamm —thank you very much for your contributions to the iTEM Open Data code! We appreciate that members of the community, such as yourself, make efforts to expand the scope and quality of the data included in this shared resource.

In this review, I will do a few things:

  1. Summarize what I think is being added by the commits on this branch. (This is information that should go in the description of the pull request. If I am guessing incorrectly, please correct me by providing the correct explanation.)
  2. Identify TODOs to merge this branch/PR.
  3. Identify TODOs for further clean-up (after the branch is merged).

To be clear, I understand from you and @soniayeh that the course in which you did this work is coming to an end, so you may not have dedicated time to do (2) or (3). So those TODOs are mentioned without saying who will do them or when—it could be you, me, or someone else; sooner or later.

What is added

  • Three data-cleaning modules: item.historical.{T015,T016,T017}.
  • Each cleans one data flow from the Asian Development Bank (ADB) Asian Transport Outlook (ATO); I guess the 2023 edition:
    • T015 → TAS-FRA-005(3)
    • T016 → TAS-VEP-005(1)
    • T017 → TAS-VEP-020

TODOs to merge the branch

  • Deduplicate the code in the 3 added modules. For instance, the files T015.py and T016.py are about around 420 lines, but >300 of these lines are identical in both files; this makes it difficult to identify which steps are common versus specific to each input data flow. One way to achieve this would be to define the class AtoWorkbook in a single file, then import it in each of the 3 modules, setting some different parameters or creating a subclass.
  • Provide a single entry-point in each module. Existing data modules like T000 do not execute any code when they are imported; they instead provide a function like process() that triggers processing of the data.
  • Create a pull request in transportenergy/metadata. I see this branch has updated the contents of the Git submodule at item/data, and then updated the pointer to a new commit. This is the correct approach—very good! However, in order for those added contents (I guess including files like "T015_input.xlsx") to be available, they must be pushed to a branch visible in GitHub; and then to be permanent they must be PR's into the main branch of transportenergy/metadata.
  • Add documentation, for instance in the docstring at the top of each module. Explain, at least, which specific data are used: at what URL can the original input data be found? This will also clarify which edition of the ATO is handled by the code.
  • Ensure the tests pass. This can be started by rebasing the branch on transportenergy:main.

TODOs for follow-up

  • Consider overlap with the transport_data.adb code maintained by the Transport Data Commons, here; make use of the TDC code where possible, and keep the features specific to iTEM Open Data.
  • Consider overlap with e.g. the class ItemTransformer added in Add T018–T020 to clean three ADB ATO data sets #80; merge common actions to common code.
  • Add the new modules to the test suite. item.tests.test_historical contains tests of the existing (T000–T010, T012) data modules, and these tests should be expanded to test the modules added in this PR.

@khaeru khaeru changed the title Feature for cleaning of ATO Workbook dataset related to t015 t016 t017 Add T015–T017 to clean three ADB ATO data sets Dec 11, 2023
@khaeru khaeru added enh Enhancements & new features historical Historical transport statistics labels Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enh Enhancements & new features help wanted historical Historical transport statistics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants