Skip to content

Add inline field metadata and optimize IO Reference performance#18

Closed
samuelduchesne wants to merge 3 commits intomainfrom
feature/charming-matsumoto
Closed

Add inline field metadata and optimize IO Reference performance#18
samuelduchesne wants to merge 3 commits intomainfrom
feature/charming-matsumoto

Conversation

@samuelduchesne
Copy link
Copy Markdown
Contributor

This pull request adds support for parsing EnergyPlus IDD (Input Data Dictionary) files and injecting structured IDF field metadata into the documentation build process. It introduces a new parser, updates the conversion pipeline to pass and utilize IDD data, and ensures the necessary assets and source files are included. Additionally, it improves the LaTeX preprocessor's macro expansion efficiency.

Support for IDD Parsing and Field Metadata Injection:

  • Added a new idd_parser.py module that parses Energy+.idd.in files, extracting object and field metadata such as types, units, defaults, ranges, choices, and flags into structured IddObject and IddField data.
  • Updated the main conversion pipeline in convert.py to parse the IDD file if present, and to pass the resulting metadata to the Markdown conversion functions for the IO Reference doc set, enabling field metadata injection. [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Updated markdown_postprocessor.py to import the new IDD models, preparing for further use of field metadata in Markdown post-processing.

Build and Asset Pipeline Updates:

  • Added a new CSS file idf-fields.css for styling IDF field metadata pills/badges, and ensured it is included in the generated documentation's extra CSS assets. [1] [2]
  • Updated the version cloning logic in convert_all.py to ensure the idd directory is checked out alongside doc, so the IDD file is always available for parsing. [1] [2]

Performance and Robustness Improvements:

  • Improved the LaTeX preprocessor's bracket macro expansion by switching to a regex-based approach, making it significantly more efficient for large files.

Development Tooling:

  • Added a .claude/launch.json configuration for local development, providing launch profiles for serving the site in different modes.

samuelduchesne and others added 3 commits February 27, 2026 05:59
Parse the EnergyPlus IDD file to extract structured metadata (type, units,
default, range, choices, flags) for each IDF object field, then inject
inline pill/badge elements after #### Field: headings in the IO Reference.

- Add IddField and IddObject dataclasses to models.py
- Create idd_parser.py to parse Energy+.idd.in (855 objects)
- Thread idd_index through the conversion pipeline (IO Reference only)
- Add inject_field_metadata() with pill formatting to postprocessor
- Add idf-fields.css with colored pill styling (type=accent, required=orange)
- Include idd/ in sparse checkout alongside doc/

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add object separators with sticky headings and fix O(n²) preprocessor bottleneck

Visual: inject <hr class="idf-object-separator"> between IDF objects on IO
Reference group pages so long pages have clear visual breaks.  The heading
immediately after each separator becomes position:sticky, staying visible
while scrolling through that object's fields.

Performance: rewrite _expand_all_bracket_macros() to use regex search
instead of character-by-character scanning.  The old code created a
substring slice on every iteration (`text[i:].startswith(…)`), making it
O(n²) for large LaTeX files.  The new version jumps directly to the next
macro via re.search(), reducing single-version conversion from ~632 s to
~86 s (7.3× faster).

Also adds pyinstrument as a dev dependency for future profiling.

https://claude.ai/code/session_01BFFEpg2Hxz1hHr8JDZ1P6Y

* Add .deb files to .gitignore

Ignore downloaded binary packages (e.g. pandoc .deb from pypandoc).

https://claude.ai/code/session_01BFFEpg2Hxz1hHr8JDZ1P6Y

* Remove pyinstrument from dev dependencies

https://claude.ai/code/session_01BFFEpg2Hxz1hHr8JDZ1P6Y

---------

Co-authored-by: Claude <noreply@anthropic.com>
@samuelduchesne
Copy link
Copy Markdown
Contributor Author

Close in favor of #19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant