Skip to content

Commit c2b6824

Browse files
committed
Rename .adb to .ato
- Update docs description of the data provider. - Add "Changes" section to doc/ato.rst to record changes. - Update base URL for remote files. - Update org ID and contacts. - Update tests.
1 parent 515a4a1 commit c2b6824

16 files changed

+59
-51
lines changed

doc/api.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
:toctree: _api
55
:recursive:
66

7-
adb
7+
ato
88
cli
99
config
1010
estat

doc/adb.rst doc/ato.rst

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
Asian Development Bank
2-
**********************
1+
Asian Transport Observatory
2+
****************************
33

4-
This module handles the `Asian Transport Outlook (ATO) <https://asiantransportoutlook.com>`_ source maintained by the Asian Development Bank (ADB, initially) and Asian Infrastructure Investment Bank (AIIB, more recently), specifically the `ATO National Database <https://asiantransportoutlook.com/snd/>`_.
4+
This module handles data provided by the `Asian Transport Observatory (ATO) <https://asiantransportobservatory.org>`_, an organization supported by, but distinct from the Asian Development Bank (ADB, initially) and Asian Infrastructure Investment Bank (AIIB, more recently).
55

6-
In particular, it converts data from the :ref:`ATO native Excel file format <ato-format>`—both the 2022-10-07 and 2024-05-20 formats—to SDMX and extracts metadata.
6+
In particular it handles the `Asian Transport Outlook (also ‘ATO’) National Database <https://asiantransportobservatory.org/snd/>`_, and supports converting data from the :ref:`ATO native Excel file format <ato-format>`—including slight variations used in 2022-10-07, 2024-05-20, 2024-11-14, and 2025-02-17 data releases—to SDMX and extracts metadata.
77

88
.. _ato-format:
99

@@ -32,4 +32,9 @@ There is an `ATO National Database User Guide <https://asiantransportoutlook.com
3232
- 2022-10-07
3333
- 2024-05-20.
3434

35-
.. include:: _api/transport_data.adb.rst
35+
.. include:: _api/transport_data.ato.rst
36+
37+
Changes
38+
=======
39+
40+
- 2025-02-24 (:pull:`47`, :issue:`46`): Rename module from :py:`transport_data.adb` to :py:`transport_data.ato` to reflect the current identity of the data provider.

doc/dev.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ The :mod:`transport_data` code is:
77
This means its features are not stable and may change at any time.
88
For example, portions of the code may be migrated to other repositories and packages without advance notice or deprecation.
99
- **Unofficial.**
10-
The TDCI *handles* data from data providers such as :mod:`.adb`, :mod:`.jrc`, and others.
10+
The TDCI *handles* data from data providers such as :mod:`.ato`, :mod:`.jrc`, and others.
1111
However, the derived data products—in particular, SDMX-formatted data and structures—produced by :mod:`transport_data` are strictly unofficial and, unless explicitly stated, have not been checked or validated by the original providers.
1212

1313
Design goals
1414
============
1515

1616
- The code is simple, modular, and flat.
17-
- There is one module per data provider (e.g. :mod:`.adb`, :mod:`.estat`, :mod:`.jrc`).
17+
- There is one module per data provider (e.g. :mod:`.ato`, :mod:`.estat`, :mod:`.jrc`).
1818

1919
- This makes possible the process that:
2020

doc/index.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ They handle tasks including:
5353
:caption: Data and metadata
5454
:hidden:
5555

56-
adb
56+
ato
5757
estat
5858
giz
5959
iamc
@@ -65,7 +65,7 @@ They handle tasks including:
6565
org
6666
proto
6767

68-
- :mod:`.adb`: :doc:`adb`
68+
- :mod:`.ato`: :doc:`ato`
6969
- :mod:`.estat`: :doc:`estat`
7070
- :doc:`giz`
7171
- :mod:`.iamc`: :doc:`iamc`

doc/usage.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Each subcommand has its own :program:`--help` and page in this documentation::
4646
--help Show this message and exit.
4747

4848
Commands:
49-
adb CLI for :mod:`.adb`.
49+
ato CLI for :mod:`.ato`.
5050
config Manipulate configuration.
5151
estat Eurostat (ESTAT) provider.
5252
iamc Demonstrate IAMC structure generation.

transport_data/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
# Register plugin hooks
1919
register_internal(
20-
"adb",
20+
"ato",
2121
"iamc",
2222
"ipcc",
2323
"iso",

transport_data/adb/__init__.py transport_data/ato/__init__.py

+16-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Asian Development Bank (ADB) provider."""
1+
"""Asian Transport Observatory (ATO) provider."""
22

33
from collections import defaultdict
44
from itertools import chain, product
@@ -13,7 +13,7 @@
1313
from transport_data.util.pooch import Pooch
1414
from transport_data.util.sdmx import anno_generated
1515

16-
BASE_URL = "https://asiantransportoutlook.com/exportdl?orig=1"
16+
BASE_URL = "https://asiantransportobservatory.org/exportdl?orig=1"
1717

1818
#: List of all "ECONOMY" codes appearing in processed data.
1919
CL_ECONOMY = m.Codelist(
@@ -30,7 +30,7 @@
3030
id="MEASURE",
3131
name="Asian Transport Outlook measures (indicators)",
3232
description="Item are automatically generated by the TDCI tools. Currently no "
33-
"correspondence with the list provided directly by ADB is checked or enforced.",
33+
"correspondence with the list provided directly by ATO is checked or enforced.",
3434
)
3535

3636
#: Mapping from short codes for ATO data categories to file names.
@@ -216,7 +216,7 @@ def dataset_to_metadata_reports(
216216
mdr.metadata.append(make_ra(mda_id, value))
217217

218218
# Retrieve the MEASURE from CS_MEASURE
219-
cs_measure = STORE.get("ConceptScheme=ADB:MEASURE(0.1.0)")
219+
cs_measure = STORE.get("ConceptScheme=ATO:MEASURE(0.1.0)")
220220
measure_concept = cs_measure[dsd.id]
221221
# Construct a metadata attribute
222222
mdr.metadata.append(make_ra("MEASURE", measure_concept.name))
@@ -310,16 +310,19 @@ def format_data_provider(value: str) -> str:
310310
@hookimpl
311311
def get_agencies():
312312
a = m.Agency(
313-
id="ADB",
314-
name="Asian Transport Outlook team at the Asian Development Bank",
315-
description="""See https://www.adb.org/what-we-do/topics/transport/asian-transport-outlook""", # noqa: E501
313+
id="ATO",
314+
name="Asian Transport Observatory",
315+
description="""See https://asiantransportobservatory.org/aboutus/""", # noqa: E501
316+
contact=[
317+
m.Contact(email=["[email protected]"]),
318+
m.Contact(name="Sudhir Gota", email=["[email protected]"]),
319+
# NB Affiliated with ADB, which supports ATO
320+
# m.Contact(name="James Leather", email=["[email protected]"]),
321+
# NB No longer formally affiliated with ATO
322+
# m.Contact(name="Cornie Huizenga", email=["[email protected]"]),
323+
],
316324
)
317325

318-
c1 = m.Contact(name="James Leather", email=["[email protected]"])
319-
c2 = m.Contact(name="Cornie Huizenga", email=["[email protected]"])
320-
c3 = m.Contact(name="Sudhir Gota", email=["[email protected]"])
321-
a.contact.extend([c1, c2, c3])
322-
323326
return (a,)
324327

325328

@@ -349,7 +352,7 @@ def prepare(aa: m.AnnotableArtefact) -> Tuple[m.DataSet, Callable]:
349352
CS_MEASURE.append(c)
350353

351354
# Data structure definition with an ID matching the measure
352-
# NB here we set ADB as the maintainer. Precisely, ADB establishes the data
355+
# NB here we set ATO as the maintainer. Precisely, ATO establishes the data
353356
# structure, but TDCI is maintaining the SDMX representation of it.
354357
ma_args = dict(maintainer=get_agencies()[0], version=VERSION)
355358
dsd = m.DataStructureDefinition(id=measure_id, **ma_args)

transport_data/adb/cli.py transport_data/ato/cli.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
"""CLI for :mod:`.adb`.
1+
"""CLI for :mod:`.ato`.
22
33
.. runblock:: console
44
5-
$ tdc adb --help
5+
$ tdc ato --help
66
77
.. runblock:: console
88
99
$ tdc add fetch --help
1010
1111
.. runblock:: console
1212
13-
$ tdc adb convert --help
13+
$ tdc ato convert --help
1414
"""
1515

1616
import click
1717

1818
from . import FILES, convert, fetch
1919

2020

21-
@click.group("adb")
21+
@click.group("ato")
2222
def main():
23-
"""Asian Development Bank (ADB) provider."""
23+
"""Asian Transport Observatory (ATO) provider."""
2424

2525

2626
@main.command("fetch")

transport_data/cli/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def main():
1616
#: List of (sub)modules that define CLI (sub)commands. Each should contain a
1717
#: @click.command() named "main".
1818
MODULES_WITH_CLI = [
19-
"adb.cli",
19+
"ato.cli",
2020
"config",
2121
"cli.interactive",
2222
"estat",

transport_data/jrc/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -465,14 +465,14 @@ def convert(geo):
465465

466466

467467
def prepare(measure_concept, dims):
468-
# TODO merge with the similar function in .adb.__init__
468+
# TODO merge with the similar function in .ato.__init__
469469

470470
measure_id = measure_concept.id
471471
c = measure_concept
472472
aa = measure_concept
473473

474474
# Data structure definition with an ID matching the measure
475-
# NB here we set ADB as the maintainer. Precisely, ADB establishes the data
475+
# NB here we set JRC as the maintainer. Precisely, JRC establishes the data
476476
# structure, but TDCI is maintaining the SDMX representation of it.
477477
dsd = m.DataStructureDefinition(
478478
id=measure_id, maintainer=get_agencies()[0], version="0.0.0"

transport_data/org/metadata/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,9 @@ def unique_dfd_id(mdr: "v21.MetadataReport", existing: set[str]) -> str:
304304

305305

306306
def merge_ato(mds: "v21.MetadataSet") -> None:
307-
"""Extend `mds` with metadata reports for ADB ATO data flows."""
307+
"""Extend `mds` with metadata reports for ATO/ATO data flows."""
308308
from transport_data import STORE
309-
from transport_data.adb import dataset_to_metadata_reports
309+
from transport_data.ato import dataset_to_metadata_reports
310310

311311
assert mds.structured_by
312312

@@ -325,7 +325,7 @@ def merge_ato(mds: "v21.MetadataSet") -> None:
325325
filter(
326326
lambda k: True, # All results
327327
# lambda k: "-VEP-" in k, # DEBUG Filter for a subset of data sets
328-
STORE.list(v21.DataSet, maintainer="ADB"),
328+
STORE.list(v21.DataSet, maintainer="ATO"),
329329
),
330330
):
331331
try:

transport_data/proto/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
33
Use::
44
5-
$ tdc adb fetch --all --go
6-
$ tdc adb convert TAS
5+
$ tdc ato fetch --all --go
6+
$ tdc ato convert TAS
77
$ tdc jrc fetch --all --go
88
$ tdc jrc convert --all
99
"""

transport_data/proto/cli.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@click.command("proto")
1313
def main(): # pragma: no cover
1414
"""TDC prototype debugging."""
15-
# from transport_data import adb
15+
# from transport_data import ato
1616
from transport_data import jrc
1717

1818
# # commented: this fetches *all* data, and should not be done too often
@@ -24,7 +24,7 @@ def main(): # pragma: no cover
2424

2525
print(jrc.read("AT"))
2626

27-
# # commented: uncomment this statement to fetch ADB ATO data files
28-
# adb.get()
27+
# # commented: uncomment this statement to fetch ATO ATO data files
28+
# ato.get()
2929

30-
# adb.convert_all()
30+
# ato.convert_all()

transport_data/tests/org/test_metadata.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from transport_data.org.metadata import contains_data_for, groupby, merge_ato, report
77
from transport_data.org.metadata.spreadsheet import make_workbook, read_workbook
88
from transport_data.testing import MARK
9-
from transport_data.tests.test_adb import ato_converted_data # noqa: F401
9+
from transport_data.tests.test_ato import ato_converted_data # noqa: F401
1010

1111
#: Number of metadata reports in the test specimen for which contains_data_for() returns
1212
#: :any:`True`.

transport_data/tests/test_adb.py transport_data/tests/test_ato.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pytest
22
from sdmx.model import v21
33

4-
from transport_data.adb import convert, dataset_to_metadata_reports
4+
from transport_data.ato import convert, dataset_to_metadata_reports
55
from transport_data.testing import MARK
66

77

@@ -21,24 +21,24 @@ def ato_converted_data(tmp_store):
2121
# dest_dir = tmp_store.store["local"].path
2222

2323
# def predicate(p: Path) -> bool:
24-
# return "ADB:" in p.name
24+
# return "ATO:" in p.name
2525

2626
# for p in filter(predicate, source_dir.iterdir()):
2727
# copyfile(p, dest_dir.joinpath(p.name))
2828

2929

3030
@pytest.fixture
31-
def ato_any_dataset(ato_converted_data) -> "v21.DataSet":
31+
def ato_any_dataset(ato_converted_data) -> "v21.DataSet": # pragma: no cover
3232
"""One (any) ATO data set."""
3333
from transport_data import STORE
3434

35-
key = STORE.list(v21.DataSet, maintainer="ADB")[0]
35+
key = STORE.list(v21.DataSet, maintainer="ATO")[0]
3636
return STORE.get(key)
3737

3838

3939
@MARK[0]
4040
def test_convert0(ato_converted_data):
41-
"""Test that :func:`.adb.convert` works for certain parts."""
41+
"""Test that :func:`.ato.convert` works for certain parts."""
4242
# Nothing in particular: simply request the fixture that generates the parts
4343
# TODO Add assertions about the numbers of data structures and sets converted
4444

@@ -60,7 +60,7 @@ def test_dataset_to_metadata_reports():
6060

6161
# Retrieve one particular converted data set
6262
datasets = filter(
63-
lambda k: "TAS-VEP-001" in k, STORE.list(v21.DataSet, maintainer="ADB")
63+
lambda k: "TAS-VEP-001" in k, STORE.list(v21.DataSet, maintainer="ATO")
6464
)
6565
ds = STORE.get(next(datasets))
6666

transport_data/tests/test_cli.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"command",
1313
(
1414
("--help",),
15-
("adb", "--help"),
16-
("adb", "fetch", "--all"),
15+
("ato", "--help"),
16+
("ato", "fetch", "--all"),
1717
("check", "--help"),
1818
("config", "--help"),
1919
("estat", "--help"),

0 commit comments

Comments
 (0)