World Bank PIP API Stata wrapper
Note:
pipis no longer available on SSC. Please install from GitHub using one of the methods below.
We recommend installing via the github Stata command by E. F. Haghish
net install github, from("https://haghish.github.io/github/")
github install worldbank/pipIf 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/") replaceIf 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.
If none of the options above worked, you could still install pip manually following these steps,
- Click on the green icon "Clone or Download" above.
- Download the package as zip.
- Extract the files with extension
.adoand.sthlponly, and place them in the directoryc:/ado/plus/p - type
discardin Stata.
In case {pip} is not working correctly, try the following steps in order
- Uninstall
{pip}:
* If installed via the github package:
github uninstall pip
* Otherwise:
ado uninstall pip- Execute the following and see if
{pip}is still installed somewhere in your computer
which pipIf it is installed, delete all the {pip} files from wherever they are in your computer until the command above returns error.
- 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- Try to run it again and see if
{pip}fails. - 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
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 |
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.
* Unit tests only (no network needed)
do "tests/unit/test_pip_parseopts.do"
* A single integration test
do "tests/integration/test_pip_cl.do"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
...
PASS <test name>— assertion succeededFAIL <test name>: <reason>— assertion failed; the runner continues and reports all failures at the end- Exit code
9means at least one test failed
Creative Commons Attribution 4.0 International
R.Andres Castaneda
The World Bank
acastanedaa@worldbank.org
Damian Clarke
University of Chile & University of Exeter
dclarke@fen.uchile.cl
Tefera Bekele Degefu
The World Bank
tdegefu@worldbank.org
