ESO / MTR API¶
High-performance parser for EnergyPlus .eso Standard Output and .mtr Meter
time-series files. The data dictionary is parsed eagerly; variable data is
extracted lazily with a single targeted scan (get_column), or all at once with
eager=True / .columns.
ESOResult¶
idfkit.simulation.parsers.eso.ESOResult
¶
Parsed EnergyPlus .eso / .mtr output file.
The data dictionary is parsed on construction; the data section is scanned
lazily on demand (see get_column). Pass eager=True to materialize
every column up front.
A file usually contains several environments — the sizing design days
followed by the weather run period. get_column returns the last one
(the run period) by default. To target a specific design day, read
environments to map each index to its title and pass that index
as environment_index:
eso = ESOResult.from_file("eplusout.eso")
for env in eso.environments:
print(env.index, env.title)
# 0 DENVER ... ANN HTG 99% CONDNS DB
# 1 DENVER ... ANN CLG 1% CONDNS DB=>MWB
# 2 RUN PERIOD 1
# the heating design day is index 0:
col = eso.get_column("Zone Mean Air Temperature", "ZONE ONE", environment_index=0)
Attributes:
| Name | Type | Description |
|---|---|---|
program_version |
The |
|
variables |
tuple[ESOVariable, ...]
|
All variables declared in the data dictionary. |
Source code in src/idfkit/simulation/parsers/eso.py
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 | |
variables = tuple(self._by_id.values())
instance-attribute
¶
environments
property
¶
All environment periods in the file (lazily scanned and cached).
This is the index → title map for environment_index: each
ESOEnvironment has an
index (use it as environment_index in get_column) and a
title (the design-day / run-period name).
columns
property
¶
Every variable's time series across all environments (full parse).
Accessing this triggers (and caches) a full parse of the data section.
from_file(path, *, eager=False)
classmethod
¶
from_string(text, *, eager=False)
classmethod
¶
from_bytes(data, *, eager=False)
classmethod
¶
Parse an ESO/MTR file from raw bytes (the fastest entry point).
get_variable(variable_name, key_value=None, frequency=None)
¶
Find a declared variable by name (case-insensitive) and optional key/frequency.
Source code in src/idfkit/simulation/parsers/eso.py
get_column(variable_name, key_value=None, frequency=None, environment_index=None)
¶
Extract one variable's time series with a single targeted scan.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
variable_name
|
str
|
Variable name to look up (case-insensitive). |
required |
key_value
|
str | None
|
Optional key value filter (e.g. zone name). |
None
|
frequency
|
str | None
|
Optional frequency filter (e.g. |
None
|
environment_index
|
int | None
|
Which environment to return. Defaults to the last
environment in the file (typically the run period), mirroring the
most common intent. To pick a specific design day, find its index
by title in |
None
|
Returns:
| Type | Description |
|---|---|
ESOColumn | None
|
The matching ESOColumn, or |
ESOColumn | None
|
|
ESOColumn | None
|
column's |
Source code in src/idfkit/simulation/parsers/eso.py
to_dataframe(variable_name, key_value=None, frequency=None, environment_index=None)
¶
Extract a variable and return it as a pandas DataFrame.
Raises:
| Type | Description |
|---|---|
KeyError
|
If the variable is not found. |
ImportError
|
If pandas is not installed. |
Source code in src/idfkit/simulation/parsers/eso.py
ESOColumn¶
idfkit.simulation.parsers.eso.ESOColumn
dataclass
¶
One variable's time series within a single environment.
Attributes:
| Name | Type | Description |
|---|---|---|
variable |
ESOVariable
|
The ESOVariable this column belongs to. |
environment_index |
int
|
Index of the environment these values belong to.
Look it up in |
timestamps |
tuple[datetime, ...]
|
Timestamp for each data point. |
values |
tuple[float, ...]
|
The reported value for each data point (the primary value for aggregated daily/monthly records). |
Source code in src/idfkit/simulation/parsers/eso.py
variable
instance-attribute
¶
environment_index
instance-attribute
¶
timestamps
instance-attribute
¶
values
instance-attribute
¶
to_dataframe()
¶
Convert to a pandas DataFrame.
Returns:
| Type | Description |
|---|---|
DataFrame
|
A DataFrame with a |
DataFrame
|
variable. |
Raises:
| Type | Description |
|---|---|
ImportError
|
If pandas is not installed. |
Source code in src/idfkit/simulation/parsers/eso.py
plot(*, backend=None, title=None)
¶
Plot this time series as a line chart.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
backend
|
PlotBackend | None
|
A PlotBackend instance. If not provided, auto-detects. |
None
|
title
|
str | None
|
Optional plot title. Defaults to |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
A figure object from the backend. |
Raises:
| Type | Description |
|---|---|
ImportError
|
If no plotting backend is available. |
Source code in src/idfkit/simulation/parsers/eso.py
ESOVariable¶
idfkit.simulation.parsers.eso.ESOVariable
dataclass
¶
A reporting variable declared in an ESO/MTR data dictionary.
Attributes:
| Name | Type | Description |
|---|---|---|
report_id |
int
|
The integer id that prefixes this variable's data records. |
variable_name |
str
|
The output variable or meter name. |
key_value |
str
|
The key (e.g. zone or surface name); empty for meters. |
units |
str
|
The variable units (may be empty). |
frequency |
str
|
Normalized reporting frequency ( |
num_values |
int
|
Number of numeric values each data record carries (1 for detailed/hourly; more for aggregated daily/monthly min/max records). |
Source code in src/idfkit/simulation/parsers/eso.py
ESOEnvironment¶
idfkit.simulation.parsers.eso.ESOEnvironment
dataclass
¶
One environment period (design day or run period) within the file.
Environments appear in the order EnergyPlus ran them: sizing design days
first (in IDF order), then the weather run period(s). index is that
0-based order and is exactly the value used by environment_index
everywhere else (ESOResult.get_column and
ESOColumn.environment_index); title is the human-readable name.
To learn which index is which design day, read ESOResult.environments
and match on title — EnergyPlus does not encode an environment type
code in the ESO format, so the title is the only discriminator (e.g.
"... ANN HTG 99% CONDNS DB" vs "RUN PERIOD 1").
Attributes:
| Name | Type | Description |
|---|---|---|
index |
int
|
0-based order of appearance; pass it as |
title |
str
|
The environment title from the |
latitude |
float
|
Site latitude in degrees. |
longitude |
float
|
Site longitude in degrees. |
time_zone |
float
|
Site time zone in hours from GMT. |
elevation |
float
|
Site elevation in metres. |