Skip to content

Commit 40b6fb3

Browse files
committed
Initial draft of NFP
1 parent a57969d commit 40b6fb3

1 file changed

Lines changed: 95 additions & 0 deletions

File tree

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
Replace Fortran ReadVars with Python ReadVarsESO
2+
================
3+
4+
**EnergyPlus Development Team**
5+
6+
- Original Date: 06/18/2026
7+
- Revision Date: 06/18/2026
8+
9+
10+
## Justification for New Feature ##
11+
12+
ReadVarsESO is a post-processing utility used to convert EnergyPlus ESO and MTR output files into delimited tabular output. The current implementation is written in modern Fortran, which keeps a Fortran build dependency alive for a small utility that is otherwise independent of the simulation engine.
13+
14+
This proposal replaces the Fortran ReadVarsESO program with a vanilla Python implementation. The goal is to preserve the existing command-line behavior for current workflows while making the tool easier to maintain, test, package, and extend.
15+
16+
## E-mail and Conference Call Conclusions ##
17+
18+
N/A
19+
20+
## Overview ##
21+
22+
The new ReadVarsESO implementation will be a Python script distributed with EnergyPlus and wrapped by platform-appropriate launcher scripts. Existing RVI/MVI based conversion workflows should continue to work, including frequency filters, unlimited column handling, and fixed header behavior.
23+
24+
The Python version will also provide a modern subcommand-based interface for direct inspection and conversion of ESO/MTR files. Initial modern commands include listing available output variables and reading data directly to CSV without requiring a separate RVI/MVI file.
25+
26+
### Legacy behavior to preserve ###
27+
28+
The historical ReadVarsESO interface is positional and file-oriented. When called with no arguments, it reads `eplusout.eso`, selects all available variables from the ESO data dictionary, and writes `eplusout.csv`. When called with an RVI/MVI file, the control file identifies the input ESO/MTR file, the output file, and the requested variables.
29+
30+
Legacy variable requests may be made by report number or by matching variable names from the data dictionary. The RVI/MVI file can also exclude variables by prefixing report numbers or variable requests with `~`. Command-line options select broad output frequencies such as detailed/timestep, hourly, daily, monthly, and annual/run-period output. Existing options also include limited versus unlimited column handling and `fixheader` behavior.
31+
32+
The legacy converter writes delimited output using the output file extension to determine the delimiter: comma-separated output for CSV, tab-separated output for TAB files, and space-separated output for TXT files. It also writes a `readvars.audit` file and preserves the long-standing header, timestamp, and row formatting used by existing workflows.
33+
34+
### Enhancements in the Python version ###
35+
36+
The Python replacement adds a modern subcommand interface while retaining the legacy interface. The `list` command, also available as `variables`, inspects an ESO/MTR data dictionary and reports the available report number, frequency, key, variable name, units, and legacy label. It supports table, CSV, and JSON output, plus filtering by reporting frequency and search text. Internal timestamp dictionary records, such as annual calendar-year records used only to label report periods, are omitted from the modern list output.
37+
38+
The new `read` command converts an ESO/MTR file directly to CSV without requiring an RVI/MVI file. Calling `ReadVarsESO read <input-file>` selects all user-reportable variables and writes a CSV file next to the input using the same base file name. The output file can be configured with `--output`, and conversion can be narrowed with the same frequency and search filters used by `list`.
39+
40+
The modern commands are intended to be easier to script and discover. They avoid legacy audit-file side effects where practical, provide structured output for tooling, and make it possible for users to inspect available variables before selecting data to convert.
41+
42+
## Approach ##
43+
44+
The implementation will port the existing ReadVarsESO behavior to a Python script with no third-party package dependencies. CMake will copy the Python script and wrapper into the EnergyPlus runtime and install locations in place of building a Fortran executable.
45+
46+
The legacy interface will remain available for compatibility. A modern interface will be added alongside it, including:
47+
48+
- `list` or `variables` to inspect available report variables, keys, units, and reporting frequencies.
49+
- `read` to convert an ESO/MTR file directly to CSV.
50+
- Command options for output file selection and basic filtering by frequency or search text.
51+
52+
The modern commands will avoid legacy audit-file side effects where practical and will omit internal timestamp dictionary records that are not user-reportable output variables. Shared parsing and conversion routines will be used where possible so that legacy and modern behavior stay aligned.
53+
54+
## Testing/Validation/Data Sources ##
55+
56+
Testing will include focused unit or script-level tests for:
57+
58+
- Legacy RVI/MVI conversion compatibility.
59+
- Listing variables and filtering metadata records.
60+
- Listing variables in table, CSV, and JSON formats.
61+
- Direct modern CSV conversion using the `read` command.
62+
- Configurable output paths and basic frequency/search filtering.
63+
- Default `read` behavior that converts all user-reportable variables when only an input file is supplied.
64+
65+
Existing EnergyPlus regression workflows that invoke ReadVarsESO should continue to pass using the Python wrapper.
66+
67+
## Input Output Reference Documentation ##
68+
69+
The Input Output Reference is not expected to require changes because this feature does not add, remove, or modify EnergyPlus input objects.
70+
71+
The auxiliary programs documentation should be updated to describe both the legacy ReadVarsESO usage and the modern `list` and `read` subcommands.
72+
73+
## Input Description ##
74+
75+
No IDD, epJSON schema, or input object changes are required.
76+
77+
## Outputs Description ##
78+
79+
No simulation output variables are added or changed.
80+
81+
ReadVarsESO output files should remain compatible with existing CSV, TAB, and TXT post-processing workflows for the legacy interface. The modern `read` command will produce CSV output directly, with the output file name configurable by command-line option.
82+
83+
## Engineering Reference ##
84+
85+
No engineering reference changes are expected. This is a post-processing utility replacement and does not alter simulation algorithms.
86+
87+
## Example File and Transition Changes ##
88+
89+
No example file changes are expected.
90+
91+
No IDF transition changes are required. Packaging and scripts that directly invoke the old executable name may need updates to call the Python wrapper, while existing command-line arguments should remain compatible through that wrapper.
92+
93+
## References ##
94+
95+
N/A

0 commit comments

Comments
 (0)