Proposal: Adding a Keyword Filtering Tool for Use with HTML Reports

Hi,all

HTML reports help users reduce some of the post-processing work, especially for those who focus on specific types of data. Sometimes, they don’t need additional charts to complicate their tasks but prefer clear results that directly support the simulation conclusions.

However, the existing HB Read Tabular Data tool is more suited for advanced users familiar with HTML reports, as it lacks a convenient way to obtain table names from the report summary. If I need to open the HTML file just to get a table name, it introduces a lot of non-automatable tasks.

I believe creating a tool that can filter the report summary using keywords would offer an additional data post-processing option for users who have never worked with HTML reports.

In Rhino 8, this functionality can be achieved using a Python script. I’ve extracted key information from the report, and by configuring the report and table fields, users can filter the table names in the HTML report. For example:

# Input:
# Report_keyword: The input Report keyword (leave blank to not filter)
# For_keyword: The input For keyword (leave blank to not filter)
# Table_keyword: The input Table keyword (leave blank to not filter)

# Output:
# FilteredTables: A list of filtered table names

# Dataset, including the combinations of Report, For, and Table

data = [
    {"Report": "Annual Building Utility Performance Summary",  "Table": "Site and Source Energy"},
    {"Report": "Annual Building Utility Performance Summary",  "Table": "Site to Source Energy Conversion Factors"},
    {"Report": "Annual Building Utility Performance Summary",  "Table": "Building Area"},
    {"Report": "Annual Building Utility Performance Summary",  "Table": "End Uses"},
    {"Report": "Annual Building Utility Performance Summary",  "Table": "End Uses By Subcategory"},
    {"Report": "Annual Building Utility Performance Summary",  "Table": "End Uses By Space Type"},
    {"Report": "Annual Building Utility Performance Summary",  "Table": "Utility Use Per Conditioned Floor Area"},
    {"Report": "Annual Building Utility Performance Summary",  "Table": "Utility Use Per Total Floor Area"},
    {"Report": "Annual Building Utility Performance Summary",  "Table": "Electric Loads Satisfied"},
    {"Report": "Annual Building Utility Performance Summary",  "Table": "On-Site Thermal Sources"},
    {"Report": "Annual Building Utility Performance Summary",  "Table": "Water Source Summary"},
    {"Report": "Annual Building Utility Performance Summary",  "Table": "Setpoint Not Met Criteria"},
    {"Report": "Annual Building Utility Performance Summary",  "Table": "Comfort and Setpoint Not Met Summary"},
    {"Report": "Input Verification and Results Summary",  "Table": "General"},
    {"Report": "Input Verification and Results Summary",  "Table": "Window-Wall Ratio"},
    {"Report": "Input Verification and Results Summary",  "Table": "Conditioned Window-Wall Ratio"},
    {"Report": "Input Verification and Results Summary",  "Table": "Skylight-Roof Ratio"},
    {"Report": "Input Verification and Results Summary",  "Table": "Zone Summary"},
    {"Report": "Input Verification and Results Summary",  "Table": "Space Summary"},
    {"Report": "Input Verification and Results Summary",  "Table": "Space Type Summary"},
    {"Report": "Demand End Use Components Summary",  "Table": "End Uses"},
    {"Report": "Demand End Use Components Summary",  "Table": "End Uses By Subcategory"},
    {"Report": "Source Energy End Use Components Summary",  "Table": "Source Energy End Use Components Summary"},
    {"Report": "Source Energy End Use Components Summary",  "Table": "Source Energy End Use Components Per Conditioned Floor Area"},
    {"Report": "Source Energy End Use Components Summary",  "Table": "Source Energy End Use Components Per Total Floor Area"},
    {"Report": "Component Sizing Summary",  "Table": "Fan:SystemModel"},
    {"Report": "Component Sizing Summary",  "Table": "ZoneHVAC:UnitHeater"},
    {"Report": "Component Sizing Summary",  "Table": "Coil:Heating:Electric"},
    {"Report": "Surface Shadowing Summary",  "Table": "Surfaces (Walls, Roofs, etc) that may be Shadowed by Other Surfaces"},
    {"Report": "Surface Shadowing Summary",  "Table": "Subsurfaces (Windows and Doors) that may be Shadowed by Surfaces"},
    {"Report": "Adaptive Comfort Summary",  "Table": "Time Not Meeting the Adaptive Comfort Models during Occupied Hours"},
    {"Report": "Initialization Summary",  "Table": "Version"},
    {"Report": "Initialization Summary",  "Table": "Timesteps per Hour"},
    {"Report": "Initialization Summary",  "Table": "System Convergence Limits"},
    {"Report": "Initialization Summary",  "Table": "Simulation Control"},
    {"Report": "Initialization Summary",  "Table": "Performance Precision Tradeoffs"},
    {"Report": "Initialization Summary",  "Table": "Output Reporting Tolerances"},
    {"Report": "Initialization Summary",  "Table": "Site:GroundTemperature:BuildingSurface"},
    {"Report": "Initialization Summary",  "Table": "Site:GroundTemperature:FCfactorMethod"},
    {"Report": "Initialization Summary",  "Table": "Site:GroundTemperature:Shallow"},
    {"Report": "Initialization Summary",  "Table": "Site:GroundTemperature:Deep"},
    {"Report": "Initialization Summary",  "Table": "Site:GroundReflectance"},
    {"Report": "Initialization Summary",  "Table": "Site:GroundReflectance:SnowModifier"},
    {"Report": "Initialization Summary",  "Table": "Site:GroundReflectance:Snow"},
    {"Report": "Initialization Summary",  "Table": "Site:GroundReflectance:Snow:Daylighting"},
    {"Report": "Initialization Summary",  "Table": "Environment:Weather Station"},
    {"Report": "Initialization Summary",  "Table": "Site:Location"},
    {"Report": "Initialization Summary",  "Table": "Site Water Mains Temperature Information"},
    {"Report": "Initialization Summary",  "Table": "Building Information"},
    {"Report": "Initialization Summary",  "Table": "Inside Convection Algorithm"},
    {"Report": "Initialization Summary",  "Table": "Outside Convection Algorithm"},
    {"Report": "Initialization Summary",  "Table": "Sky Radiance Distribution"},
    {"Report": "Initialization Summary",  "Table": "Zone Air Solution Algorithm"},
    {"Report": "Initialization Summary",  "Table": "Zone Air Carbon Dioxide Balance Simulation"},
    {"Report": "Initialization Summary",  "Table": "Zone Air Generic Contaminant Balance Simulation"},
    {"Report": "Initialization Summary",  "Table": "Zone Air Mass Flow Balance Simulation"},
    {"Report": "Initialization Summary",  "Table": "HVACSystemRootFindingAlgorithm"},
    {"Report": "Initialization Summary",  "Table": "Environment:Site Atmospheric Variation"},
    {"Report": "Initialization Summary",  "Table": "Surface Geometry"},
    {"Report": "Initialization Summary",  "Table": "Surface Heat Transfer Algorithm"},
    {"Report": "Initialization Summary",  "Table": "Shading Summary"},
    {"Report": "Initialization Summary",  "Table": "Zone Summary"},
    {"Report": "Initialization Summary",  "Table": "Zone Information"},
    {"Report": "Initialization Summary",  "Table": "Zone Internal Gains Nominal"},
    {"Report": "Initialization Summary",  "Table": "People Internal Gains Nominal"},
    {"Report": "Initialization Summary",  "Table": "Lights Internal Gains Nominal"},
    {"Report": "Initialization Summary",  "Table": "ElectricEquipment Internal Gains Nominal"},
    {"Report": "Initialization Summary",  "Table": "Shadowing/Sun Position Calculations Annual Simulations"},
    {"Report": "Initialization Summary",  "Table": "ZoneInfiltration Airflow Stats Nominal"},
    {"Report": "Initialization Summary",  "Table": "AirFlow Model"},
    {"Report": "Initialization Summary",  "Table": "RoomAir Model"},
    {"Report": "Initialization Summary",  "Table": "AirflowNetwork Model:Control"},
    {"Report": "Initialization Summary",  "Table": "Zone Volume Capacitance Multiplier"},
    {"Report": "Initialization Summary",  "Table": "Load Timesteps in Zone Design Calculation Averaging Window"},
    {"Report": "Initialization Summary",  "Table": "Heating Sizing Factor Information"},
    {"Report": "Initialization Summary",  "Table": "Cooling Sizing Factor Information"},
    {"Report": "Initialization Summary",  "Table": "Zone Sizing Information"},
    {"Report": "Initialization Summary",  "Table": "Component Sizing Information"},
    {"Report": "Initialization Summary",  "Table": "Environment"},
    {"Report": "Initialization Summary",  "Table": "Environment:Daylight Saving"},
    {"Report": "Initialization Summary",  "Table": "Environment:WarmupDays"},
    {"Report": "Initialization Summary",  "Table": "Warmup Convergence Information"},
    {"Report": "Annual Heat Emissions Report",  "Table": "Annual Heat Emissions Summary"},
    {"Report": "Annual Thermal Resilience Summary",  "Table": "Heat Index Hours"},
    {"Report": "Annual Thermal Resilience Summary",  "Table": "Heat Index OccupantHours"},
    {"Report": "Annual Thermal Resilience Summary",  "Table": "Heat Index OccupiedHours"},
    {"Report": "Annual Thermal Resilience Summary",  "Table": "Humidex Hours"},
    {"Report": "Annual Thermal Resilience Summary",  "Table": "Humidex OccupantHours"},
    {"Report": "Annual Thermal Resilience Summary",  "Table": "Humidex OccupiedHours"},
    {"Report": "Annual Thermal Resilience Summary",  "Table": "Hours of Safety for Cold Events"},
    {"Report": "Annual Thermal Resilience Summary",  "Table": "Hours of Safety for Heat Events"},
    {"Report": "Annual Thermal Resilience Summary",  "Table": "Unmet Degree-Hours"},
    {"Report": "Annual Thermal Resilience Summary",  "Table": "Discomfort-weighted Exceedance OccupantHours"},
    {"Report": "Annual Thermal Resilience Summary",  "Table": "Discomfort-weighted Exceedance OccupiedHours"},
    {"Report": "Climatic Data Summary",  "Table": "SizingPeriod:DesignDay"},
    {"Report": "Climatic Data Summary",  "Table": "Monthly Precipitation Summary"},
    {"Report": "Climatic Data Summary",  "Table": "Weather Statistics File"},
    {"Report": "Envelope Summary",  "Table": "Opaque Exterior"},
    {"Report": "Envelope Summary",  "Table": "Opaque Interior"},
    {"Report": "Envelope Summary",  "Table": "Exterior Fenestration"},
    {"Report": "Envelope Summary",  "Table": "Exterior Fenestration Shaded State"},
    {"Report": "Envelope Summary",  "Table": "Interior Fenestration"},
    {"Report": "Envelope Summary",  "Table": "Exterior Door"},
    {"Report": "Envelope Summary",  "Table": "Interior Door"},
    {"Report": "Shading Summary",  "Table": "Sunlit Fraction"},
    {"Report": "Shading Summary",  "Table": "Window Control"},
    {"Report": "Lighting Summary",  "Table": "Interior Lighting"},
    {"Report": "Lighting Summary",  "Table": "Daylighting"},
    {"Report": "Lighting Summary",  "Table": "Exterior Lighting"},
    {"Report": "Equipment Summary",  "Table": "Central Plant"},
    {"Report": "Equipment Summary",  "Table": "Cooling Coils"},
    {"Report": "Equipment Summary",  "Table": "DX Cooling Coil Standard Ratings 2017"},
    {"Report": "Equipment Summary",  "Table": "DX Cooling Coil Standard Ratings 2023"},
    {"Report": "Equipment Summary",  "Table": "DX Cooling Coil ASHRAE 127 Standard Ratings Report"},
    {"Report": "Equipment Summary",  "Table": "Water-to-Air Heat Pumps at Rated Temperatures Report"},
    {"Report": "Equipment Summary",  "Table": "DX Heating Coils"},
    {"Report": "Equipment Summary",  "Table": "DX Heating Coils [ HSPF2 ]"},
    {"Report": "Equipment Summary",  "Table": "Heating Coils"},
    {"Report": "Equipment Summary",  "Table": "Fans"},
    {"Report": "Equipment Summary",  "Table": "Pumps"},
    {"Report": "Equipment Summary",  "Table": "Service Water Heating"},
    {"Report": "Equipment Summary",  "Table": "Chillers"},
    {"Report": "Equipment Summary",  "Table": "Boilers"},
    {"Report": "Equipment Summary",  "Table": "Cooling Towers and Fluid Coolers"},
    {"Report": "Equipment Summary",  "Table": "PlantLoop or CondenserLoop"},
    {"Report": "Equipment Summary",  "Table": "Air Terminals"},
    {"Report": "Equipment Summary",  "Table": "Air Heat Recovery"},
    {"Report": "HVAC Sizing Summary",  "Table": "Space Sensible Cooling"},
    {"Report": "HVAC Sizing Summary",  "Table": "Zone Sensible Cooling"},
    {"Report": "HVAC Sizing Summary",  "Table": "Space Sensible Heating"},
    {"Report": "HVAC Sizing Summary",  "Table": "Zone Sensible Heating"},
    {"Report": "HVAC Sizing Summary",  "Table": "System Design Air Flow Rates"},
    {"Report": "HVAC Sizing Summary",  "Table": "Plant Loop Coincident Design Fluid Flow Rate Adjustments"},
    {"Report": "HVAC Sizing Summary",  "Table": "Coil Sizing Summary"},
    {"Report": "Coil Sizing Details",  "Table": "Coils"},
    {"Report": "Coil Sizing Details",  "Table": "Coil Connections"},
    {"Report": "System Summary",  "Table": "Economizer"},
    {"Report": "System Summary",  "Table": "Demand Controlled Ventilation using Controller:MechanicalVentilation"},
    {"Report": "System Summary",  "Table": "Time Not Comfortable Based on Simple ASHRAE 55-2004"},
    {"Report": "System Summary",  "Table": "Time Setpoint Not Met"},
    {"Report": "Outdoor Air Summary",  "Table": "Average Outdoor Air During Occupied Hours"},
    {"Report": "Outdoor Air Summary",  "Table": "Minimum Outdoor Air During Occupied Hours"},
    {"Report": "Outdoor Air Details",  "Table": "Mechanical Ventilation Parameters by Zone"},
    {"Report": "Outdoor Air Details",  "Table": "Total Outdoor Air by Zone"},
    {"Report": "Outdoor Air Details",  "Table": "Average Outdoor Air During Occupancy by Zone - Flow Rates"},
    {"Report": "Outdoor Air Details",  "Table": "Total Outdoor Air by AirLoop"},
    {"Report": "Outdoor Air Details",  "Table": "Average Outdoor Air During Occupancy by AirLoop"},
    {"Report": "Outdoor Air Details",  "Table": "Outdoor Air Controller Limiting Factors by AirLoop"},
    {"Report": "Outdoor Air Details",  "Table": "Average Outdoor Air for Limiting Factors During Occupancy"},
    {"Report": "Object Count Summary",  "Table": "Surfaces by Class"},
    {"Report": "Object Count Summary",  "Table": "HVAC"},
    {"Report": "Object Count Summary",  "Table": "Input Fields"},
    {"Report": "Energy Meters",  "Table": "Annual and Peak Values - Electricity"},
    {"Report": "Energy Meters",  "Table": "Annual and Peak Values - Natural Gas"},
    {"Report": "Energy Meters",  "Table": "Annual and Peak Values - Cooling"},
    {"Report": "Energy Meters",  "Table": "Annual and Peak Values - Water"},
    {"Report": "Energy Meters",  "Table": "Annual and Peak Values - Other by Weight/Mass"},
    {"Report": "Energy Meters",  "Table": "Annual and Peak Values - Other Volumetric"},
    {"Report": "Energy Meters",  "Table": "Annual and Peak Values - Other Liquid/Gas"},
    {"Report": "Energy Meters",  "Table": "Annual and Peak Values - Other"},
    {"Report": "Sensible Heat Gain Summary",  "Table": "Annual Building Sensible Heat Gain Components"},
    {"Report": "Sensible Heat Gain Summary",  "Table": "Peak Cooling Sensible Heat Gain Components"},
    {"Report": "Sensible Heat Gain Summary",  "Table": "Peak Heating Sensible Heat Gain Components"},
    {"Report": "Standard 62.1 Summary",  "Table": "System Ventilation Requirements for Cooling"},
    {"Report": "Standard 62.1 Summary",  "Table": "System Ventilation Requirements for Heating"},
    {"Report": "Standard 62.1 Summary",  "Table": "Zone Ventilation Parameters"},
    {"Report": "Standard 62.1 Summary",  "Table": "System Ventilation Parameters"},
    {"Report": "Standard 62.1 Summary",  "Table": "Zone Ventilation Calculations for Cooling Design"},
    {"Report": "Standard 62.1 Summary",  "Table": "System Ventilation Calculations for Cooling Design"},
    {"Report": "Standard 62.1 Summary",  "Table": "Zone Ventilation Calculations for Heating Design"},
    {"Report": "Standard 62.1 Summary",  "Table": "System Ventilation Calculations for Heating Design"},
    {"Report": "LEED Summary",  "Table": "Sec1.1A-General Information"},
    {"Report": "LEED Summary",  "Table": "EAp2-1. Space Usage Type"},
    {"Report": "LEED Summary",  "Table": "EAp2-2. Advisory Messages"},
    {"Report": "LEED Summary",  "Table": "EAp2-3. Energy Type Summary"},
    {"Report": "LEED Summary",  "Table": "EAp2-4/5. Performance Rating Method Compliance"},
    {"Report": "LEED Summary",  "Table": "EAp2-6. Energy Use Summary"},
    {"Report": "LEED Summary",  "Table": "EAp2-7. Energy Cost Summary"},
    {"Report": "LEED Summary",  "Table": "L-1. Renewable Energy Source Summary"},
    {"Report": "LEED Summary",  "Table": "EAp2-17a. Energy Use Intensity - Electricity"},
    {"Report": "LEED Summary",  "Table": "EAp2-17b. Energy Use Intensity - Natural Gas"},
    {"Report": "LEED Summary",  "Table": "EAp2-17c. Energy Use Intensity - Additional"},
    {"Report": "LEED Summary",  "Table": "EAp2-18. End Use Percentage"},
    {"Report": "LEED Summary",  "Table": "Schedules-Equivalent Full Load Hours (Schedule Type=Fraction)"},
    {"Report": "LEED Summary",  "Table": "Schedules-SetPoints (Schedule Type=Temperature)"},
    {"Report": "Annual CO2 Resilience Summary",  "Table": "CO2 Level Hours"},
    {"Report": "Annual CO2 Resilience Summary",  "Table": "CO2 Level OccupantHours"},
    {"Report": "Annual CO2 Resilience Summary",  "Table": "CO2 Level OccupiedHours"},
    {"Report": "Annual Visual Resilience Summary",  "Table": "Illuminance Level Hours"},
    {"Report": "Annual Visual Resilience Summary",  "Table": "Illuminance Level OccupantHours"},
    {"Report": "Annual Visual Resilience Summary",  "Table": "Illuminance Level OccupiedHours"},
    {"Report": "Life-Cycle Cost Report",  "Table": "Life-Cycle Cost Parameters"},
    {"Report": "Life-Cycle Cost Report",  "Table": "Use Price Escalation"},
    {"Report": "Life-Cycle Cost Report",  "Table": "Cash Flow for Recurring and Nonrecurring Costs (Without Escalation)"},
    {"Report": "Life-Cycle Cost Report",  "Table": "Energy and Water Cost Cash Flows (Without Escalation)"},
    {"Report": "Life-Cycle Cost Report",  "Table": "Energy and Water Cost Cash Flows (With Escalation)"},
    {"Report": "Life-Cycle Cost Report",  "Table": "Capital Cash Flow by Category (Without Escalation)"},
    {"Report": "Life-Cycle Cost Report",  "Table": "Operating Cash Flow by Category (Without Escalation)"},
    {"Report": "Life-Cycle Cost Report",  "Table": "Operating Cash Flow by Category (With Escalation)"},
    {"Report": "Life-Cycle Cost Report",  "Table": "Monthly Total Cash Flow (Without Escalation)"},
    {"Report": "Life-Cycle Cost Report",  "Table": "Present Value for Recurring, Nonrecurring and Energy Costs (Before Tax)"},
    {"Report": "Life-Cycle Cost Report",  "Table": "Present Value by Category"},
    {"Report": "Life-Cycle Cost Report",  "Table": "Present Value by Year"},
]

# Filter by Report keyword
def filter_by_report(data, report_keyword):
    if report_keyword:
        return [item for item in data if item["Report"].lower().startswith(report_keyword.lower())]
    return data

# Filter by Table keyword
def filter_by_table(data, table_keyword):
    if table_keyword:
        return [item for item in data if item["Table"].lower().startswith(table_keyword.lower())]
    return data

# Get all Table names
def get_all_tables(filtered_data):
    return [item["Table"] for item in filtered_data]

# Stepwise filtering
filtered_data = filter_by_report(data, report_)
filtered_data = filter_by_table(filtered_data, table_)

# Output the final filtered list of Table names
table_name = get_all_tables(filtered_data)

To further narrow down the Table names, I created a values list that allows users to focus on the category they are interested in:

Annual Building Utility Performance Summary = "Annual Building Utility Performance Summary"
Input Verification and Results Summary      = "Input Verification and Results Summary"
Demand End Use Components Summary           = "Demand End Use Components Summary"
Source Energy End Use Components Summary    = "Source Energy End Use Components Summary"
Component Sizing Summary                    = "Component Sizing Summary"
Surface Shadowing Summary                   = "Surface Shadowing Summary"
Adaptive Comfort Summary                    = "Adaptive Comfort Summary"
Initialization Summary                      = "Initialization Summary"
Annual Heat Emissions Report                = "Annual Heat Emissions Report"
Annual Thermal Resilience Summary           = "Annual Thermal Resilience Summary"
Climatic Data Summary                       = "Climatic Data Summary"
Envelope Summary                            = "Envelope Summary"
Shading Summary                             = "Shading Summary"
Lighting Summary                            = "Lighting Summary"
Equipment Summary                           = "Equipment Summary"
HVAC Sizing Summary                         = "HVAC Sizing Summary"
Coil Sizing Details                         = "Coil Sizing Details"
System Summary                              = "System Summary"
Outdoor Air Summary                         = "Outdoor Air Summary"
Outdoor Air Details                         = "Outdoor Air Details"
Object Count Summary                        = "Object Count Summary"
Energy Meters                               = "Energy Meters"
Sensible Heat Gain Summary                  = "Sensible Heat Gain Summary"
Standard 62.1 Summary                       = "Standard 62.1 Summary"
LEED Summary                                = "LEED Summary"
Annual CO2 Resilience Summary               = "Annual CO2 Resilience Summary"
Annual Visual Resilience Summary            = "Annual Visual Resilience Summary"
Life-Cycle Cost Report                      = "Life-Cycle Cost Report"

Finally, this setup should allow users to achieve something similar to the desired effect.

best.
Zhengrong

2 Likes

Thanks @ZhengrongTao for your suggestions.
cc @chris