Add ConvertInputFormat options to preserve object order and comments to facilitate round-tripping

Open
#8,969 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
cli, tooling

Research direction

Start by locating the ConvertInputFormat entry point and tracing both IDF-to-epJSON and epJSON-to-IDF paths. Determine how order and preceding comments should be represented, how the options apply by conversion direction, and how stored metadata is used when converting back. Done means round-tripping preserves object order and comments, with optional end-line field comments matching the example.

Written by the indexing model from the issue text.

Description

NewFeatureRequest

Issue overview

Currently when an IDF file is converted to epJSON using ConvertInputFormat the comments (user and field names) and order of objects is lost. This means when converting back from epJSON to IDF the file is no longer in the order of the original file and does not have any user comments. Some advanced users and developers develop processors for input files to facilitate their workflows. It would be easier to use the epJSON format for these except for the loss of order and comments. This loss of these means that the file would be difficult for users to modify further making such input file processors less useful and less likely to be used.

To rectify this, please add two options to ConvertInputFormat:

a) that adds a key-value field for every input object that reflects the original order of the file.

b) that adds a key-value field or fields to preserve all comments that appear prior to the input object.

These new field would be ignored by EnergyPlus.

These options would be for IDF->epJSON. For epJSON->IDF if these new key-value fields for order or comments were present they would be used automatically to create an IDF.

Further, a third option could be added to ConvertInputFormat

c) that includes end-line comments for each IDF field in the "!-" format that shows the field name.

Currently, a file that is round tripped from IDF->epJSON->IDF looks like this:

Building,
  Building,
  30.0,
  City,
  0.04,
  0.4,
  FullExterior,
  25.0,
  6.0;

and it would better if it looked like:

  Building,
    Building,                !- Name
    30.,                     !- North Axis {deg}
    City,                    !- Terrain
    0.04,                    !- Loads Convergence Tolerance Value {W}
    0.4,                     !- Temperature Convergence Tolerance Value {deltaC}
    FullExterior,            !- Solar Distribution
    25,                      !- Maximum Number of Warmup Days
    6;                       !- Minimum Number of Warmup Days
Dominant language
C++
Stars
1.6k
Forks
490
Avg merge
6d 21h
Merged PRs (30d)
22

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NatLabRockies/EnergyPlus

All issues in NatLabRockies/EnergyPlus

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.