Build - USEPA/USEEIO_API GitHub Wiki
Local Installation for software programmers
Please refer to the User Manual (UM) and LMMD Software Configuration Management (SCM)[Internal EPA link only] SOP for more information.
Export the model files and create the models.csv metadata file first
To build the USEEIO API from source, you must have generated data for the USEEIO models to be provided in the specified format. This should be performed using the IO Model Builder matio module. Assume 'eeio_model' is already created like in the IO-Model-Builder example
import iomb.matio
model_matrices = matio.Matrices(eeio_model)
#Assume the data_dir is the same 'data' directory for USEEIO API model data
#exportDQImatrices is a parameter than specifies whether the data quality
#matrices should be exported
model_matrices.export_for_api(data_dir,exportDQImatrices=True)
This will export all the data files needed for the USEEIO API except:
- demands.csv and demand json files
- models.csv
The demand files can be created using a csv file in the standard iomb demand format and the prepare_demands.py script.
The models.csv file must be created manually to define the models to be included.
Prerequisites
- Python 3x
- [IO Model Builder] >= v1.2(https://github.com/USEPA/IO-Model-Builder/)
Build the API documentation
The files in the apidoc folder generate
the documentation files of the USEEIO API from
a Swagger (OpenAPI) document:
apidoc.yaml. You can directly copy and edit the apidoc.yaml
file in the Swagger Editor. We use
Gulp and the
bootprint-openapi to build the
HTML page (with CSS and JavaScript) from this specification. So if you have
npm and Gulp installed, you can switch to the apidoc
folder, install the respective node modules with npm, and finally run the build using gulp:
Prerequisites npm/gulp
Build API docs from the Windows command line
Starting from the root project folder (useeio_api):
...useeio_api>cd apidoc
...useeio_api\apidoc>npm install
...useeio_api\apidoc>gulp
The API documentation files are then created in the apidoc/build
folder.