Skip to content

Latest commit

 

History

723 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

pip : Stata module to access World Bank’s Global Poverty and Inequality data

Description

World Bank PIP API Stata wrapper

Installation

Note: pip is no longer available on SSC. Please install from GitHub using one of the methods below.

From GitHub (recommended)

We recommend installing via the github Stata command by E. F. Haghish

net install github, from("https://haghish.github.io/github/")
github install worldbank/pip

From GitHub (without the github package)

If you cannot or prefer not to install the github package, you can install pip directly:

net install pip, from("https://raw.githubusercontent.com/worldbank/pip/main/") replace

If you get an error similar to the image below, it might be the case that downloading from Github is not available in your computer due to firewall restrictions. Try disconnecting from the VPN and installing {pip} again.

image

If none of the options above worked, you could still install pip manually following these steps,

  1. Click on the green icon "Clone or Download" above.
  2. Download the package as zip.
  3. Extract the files with extension .ado and .sthlp only, and place them in the directory c:/ado/plus/p
  4. type discard in Stata.

Troubleshooting

In case {pip} is not working correctly, try the following steps in order

  1. Uninstall {pip}:
* If installed via the github package:
github uninstall pip

* Otherwise:
ado uninstall pip
  1. Execute the following and see if {pip} is still installed somewhere in your computer
which pip

If it is installed, delete all the {pip} files from wherever they are in your computer until the command above returns error.

  1. Install {pip} again and check the version number. It should be the same as the most recent release
* Option A: using the github package (recommended)
github install worldbank/pip

* Option B: without the github package
net install pip, from("https://raw.githubusercontent.com/worldbank/pip/main/") replace

discard
which pip
  1. Try to run it again and see if {pip} fails.
  2. If it is still failing, please run the code below--making sure your replace the commented line--and send the test.log file to pip@worldbank.org
log using "test.log", name(pip_test) text replace // this is in your cd
cret list
clear all
which pip
set tracedepth 4
set traceexpand on 
set traceindent on 
set tracenumber on
set trace on
cap noi // pip command that is not working
set trace off
log close pip_test

Running Tests

The test suite lives in tests/ and is split into two categories:

Suite Location Purpose
Unit tests/unit/ Fast, offline — no internet needed
Integration tests/integration/ Requires a live connection to the PIP API

Run all tests

do "tests/run_all_tests.do"

Or from within the tests/ directory:

do "run_all_tests.do"

The runner discovers all test_*.do files in unit/, integration/, and the tests/ root, runs them in order, and prints a pass/fail summary.

Run a single suite

* Unit tests only (no network needed)
do "tests/unit/test_pip_parseopts.do"

* A single integration test
do "tests/integration/test_pip_cl.do"

Test layout

tests/
  test_helpers.do          ← shared assertion programs (loaded automatically)
  run_all_tests.do         ← master runner
  unit/                    ← 16 offline tests
    test_pip_parseopts.do
    test_pip_cache.do
    test_pip_fun_mata.do
    ...
  integration/             ← 13 live API tests
    test_pip_cl.do
    test_pip_wb.do
    test_pip_dispatcher.do
    ...

Interpreting results

  • PASS <test name> — assertion succeeded
  • FAIL <test name>: <reason> — assertion failed; the runner continues and reports all failures at the end
  • Exit code 9 means at least one test failed

License

Creative Commons Attribution 4.0 International

Authors

R.Andres Castaneda
The World Bank
acastanedaa@worldbank.org

Damian Clarke University of Chile & University of Exeter
dclarke@fen.uchile.cl

Contributors

Tefera Bekele Degefu
The World Bank
tdegefu@worldbank.org

About

Stata module to access World Bank’s Global Poverty and Inequality data

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

13 stars

Watchers

4 watching

Forks

Releases

Used by

Contributors

Languages