## 2 Materials and Methods
### Stewi
The totals by flows are compared against a calculated percent difference used as a tolerance level, where the default tolerance level is 5%. The result for each flow comparison is reported using the interpretations given in Table 2 and stored locally in a csv file. Comparisons where a data point is not found in either the processed inventory or the validation dataset are indicated as such. The code for the validation checks is contained in the validation.py module. _stewi_ captures and records metadata on inventory sources, validation sources, and the output datasets. For inventory and validation source data, _stewi_ records the filename, the URL the data were retrieved from, the date the data were retrieved, the file version, and the version of StEWI used to record the data. For output data, a standard class of source metadata defined in the _esupy_ library is used, including fields for filename, output format (e.g., flowbyfacility), version of StEWI, gift hash, and date created. Functions and defaults for metadata records are in the globals.py module. Output files of type flowbyfacility and flowbyprocess can be filtered to remove records using a set of embedded filters when retrieved with getInventory. Filter names and instructions are stored in _filter.yaml_ and implemented in functions in the filter.py module. Table 3 lists the filter, the inventories they apply to, and their functions. Embedded filters were created to generate StEWI output files for specific applications. Additionally, a filter_for_LCI parameter is available in getInventory that, when set to True, applies all the filters given in Table 3. All available filters can be printed to the console using see available inventory filters. \begin{table}
\begin{tabular}{c c} \hline \hline
**Percent difference** & **Interpretation** \\ \hline
0.0 & identical \\ \(\leq\)tl & statistically similar \\ \(>\)tl & Percent difference exceeds tolerance \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Tolerance levels for validation. By default, the tolerance level (tl) is set to 0.05. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Filter** & **Inventory** & **Function** \\ \hline US\_States\_only & All & Removes data not assigned to facilities in one of the 50 U.S. \\  & & States or D.C. \\ \hline flows\_for\_LCI & TRI, DMR, NEI & Removes data for specific named flows that are not relevant for the LCI or would represent double counting \\ \hline \hline \end{tabular} \begin{tabular}{c} \hline \hline Remove\_duplicate\_organic\_enrichment \\ \end{tabular} \
\begin{tabular}{c} DMR \\ \end{tabular}
\begin{tabular}{c} Removes overlapping organic enrichment reports. Facilities can report multiple forms of organic enrichment (BOD and COD), which represent duplicate reports of oxygen depletion (see [PERSON] et al. [27])  
\end{table} 
Table 3: Filters available for _stewi_ outputs. The following USEPA inventory sources are available for processing in _stewi_: the NEI (point source data only from the Emission Inventory System), the TRI, the eGRID, the Greenhouse Gas Reporting Program (GHGRP), Discharge Monitoring Reports (DMRs) based on reporting to the National Pollutant Discharge Elimination System, and the Resources Conservation and Recycling Act's Biennial Report generated from the RCRAInfo system (RCRAInfo). The processing of each of the inventory sources is described further below.