PALEOS-API live tabulation (producer)
Live producer side of the PALEOS-API:* registry family. Generates 10-column P-T .dat files bit-format-identical to the shipped EOS_PALEOS_* Zenodo tables, but sourced at runtime from the installed paleos Python package rather than from a flat-file checkout. This lets users opt into a different upstream PALEOS version (or a custom phase map) without re-publishing tables. The output is consumed unchanged by eos.interpolation.load_paleos_table (density + nabla_ad) and by eos_export.load_paleos_all_properties (SPIDER P-S export). Cache logic and on-disk layout live in paleos_api_cache; this module contains pure producers only.
paleos_api
Live PALEOS tabulation — PALEOS-API:* producer side.
Generates 10-column P-T .dat files bit-format-identical to the shipped
EOS_PALEOS_* Zenodo tables, but sourced at runtime from import paleos
rather than from a flat-file checkout. Output is consumed unchanged by the
existing readers: zalmoxis.eos.interpolation.load_paleos_table (density +
nabla_ad path) and zalmoxis.eos_export.load_paleos_all_properties
(SPIDER P-S export path).
Two entry points:
generate_paleos_api_unified_table— one file per material, stable-phase dispatch (matchesEOS_PALEOS_{iron,MgSiO3_unified,H2O}).generate_paleos_api_2phase_mgsio3_tables— two files (solid + liquid) with metastable extensions, matchingEOS_PALEOS_MgSiO3/paleos_mgsio3_tables_pt_proteus_{solid,liquid}.dat. Aragog's P-S table build feeds these toeos_export.generate_spider_eos_tablesassolid_eos_fileandliquid_eos_fileso that mushy-zone mixing uses phase-specific endpoints rather than interpolating across the melting curve.
Cache / registry wiring is handled by paleos_api_cache.py and the
PALEOS-API:* registry entries. This module contains pure producers
only; no cache logic lives here.
Design notes
The 2-phase solid-side picker reaches into PALEOS internals
(_phase_eos_map, the phase-boundary functions, _P_HPCEN_BRG). These
are not a committed public API. The PALEOS SHA is recorded in the output
header so any upstream rename is caught by a cache-key miss. Once a public
get_mgsio3_solid_phase + generate_twophase_pt_tables helper is
contributed upstream, the internals access here collapses to one public
call.
GridSpec(p_lo, p_hi, n_p, t_lo, t_hi, n_t)
dataclass
Log-uniform (P, T) grid specification.
Pressure axis is log-uniform in [p_lo, p_hi] Pa with n_p points.
Temperature axis is log-uniform in [t_lo, t_hi] K with n_t
points, matching the Zenodo shipped tables (which are log-uniform in
both axes at 150 pts/decade).
Attributes:
| Name | Type | Description |
|---|---|---|
p_lo, p_hi |
float
|
Pressure bounds [Pa]. |
n_p |
int
|
Number of pressure nodes. |
t_lo, t_hi |
float
|
Temperature bounds [K]. |
n_t |
int
|
Number of temperature nodes. |
axes()
Return (P_axis [Pa], T_axis [K]) as 1D numpy arrays.
Source code in src/zalmoxis/eos/paleos_api.py
99 100 101 102 103 | |
hash_short()
SHA-1 short digest for cache keying.
Source code in src/zalmoxis/eos/paleos_api.py
94 95 96 97 | |
make_grid_at_resolution(p_lo, p_hi, t_lo, t_hi, pts_per_decade=DEFAULT_PTS_PER_DECADE)
Build a GridSpec with a uniform log-log resolution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
p_lo
|
float
|
Pressure bounds [Pa], both > 0. |
required |
p_hi
|
float
|
Pressure bounds [Pa], both > 0. |
required |
t_lo
|
float
|
Temperature bounds [K], both > 0. |
required |
t_hi
|
float
|
Temperature bounds [K], both > 0. |
required |
pts_per_decade
|
int
|
Nodes per decade on each axis. Default
|
DEFAULT_PTS_PER_DECADE
|
Source code in src/zalmoxis/eos/paleos_api.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | |
make_default_grid_iron()
Default Fe grid: 1e5 to 1e14 Pa, 300 to 20000 K at 600 pts/decade.
Source code in src/zalmoxis/eos/paleos_api.py
161 162 163 | |
make_default_grid_mgsio3()
Default MgSiO3 grid: 1e5 to 1e14 Pa, 300 to 11500 K at 600 pts/decade.
Source code in src/zalmoxis/eos/paleos_api.py
166 167 168 | |
make_default_grid_h2o()
Default H2O grid: 0.1 Pa to 1e14 Pa, 150 to 1e5 K at 600 pts/decade.
Wider P range than Fe/MgSiO3 to match AQUA table coverage (extends to
1 micro-bar). H2O is table-backed in PALEOS (Haldemann20) so per-point
cost is low.
Source code in src/zalmoxis/eos/paleos_api.py
171 172 173 174 175 176 177 178 | |
paleos_installed_sha()
Return the git SHA of the installed PALEOS checkout, or 'unknown'.
PALEOS does not expose __commit_sha__; we fall back to
git rev-parse HEAD against the directory holding paleos.
If both fail, we use paleos.__version__ as a coarse identifier.
Source code in src/zalmoxis/eos/paleos_api.py
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | |
generate_paleos_api_unified_table(material, out_path, grid, *, h2o_table_path=None, log_every=50, n_workers=1)
Generate a unified PALEOS .dat for one material.
Stable-phase dispatch: for each (P, T) the PALEOS top-level class
(IronEoS / MgSiO3EoS / WaterEoS) chooses the thermodynamically
stable phase and evaluates that phase's EoS. Phase label is PALEOS's
intrinsic string ('solid-hpcen', 'liquid', 'hcp-Fe', etc).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
material
|
('iron', 'mgsio3', 'h2o')
|
Material selector. |
'iron'
|
out_path
|
path - like
|
Destination |
required |
grid
|
GridSpec
|
(P, T) grid. |
required |
h2o_table_path
|
str or None
|
AQUA table path. Passed to |
None
|
log_every
|
int
|
Emit a progress line every |
50
|
n_workers
|
int
|
Parallelism. |
1
|
Returns:
| Type | Description |
|---|---|
dict
|
|
Source code in src/zalmoxis/eos/paleos_api.py
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 | |
generate_paleos_api_2phase_mgsio3_tables(out_solid, out_liquid, grid, *, log_every=50, n_workers=1)
Generate solid and liquid MgSiO3 P-T tables with metastable extensions.
Replaces the shipped paleos_mgsio3_tables_pt_proteus_solid.dat and
paleos_mgsio3_tables_pt_proteus_liquid.dat — bit-format-compatible,
consumed unchanged by eos_export.generate_spider_eos_tables via
solid_eos_file / liquid_eos_file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
out_solid
|
path - like
|
Destinations for the two files. Parent directories are created. |
required |
out_liquid
|
path - like
|
Destinations for the two files. Parent directories are created. |
required |
grid
|
GridSpec
|
(P, T) grid; |
required |
log_every
|
int
|
Progress log cadence in pressure rows. |
50
|
n_workers
|
int
|
Parallelism. |
1
|
Returns:
| Type | Description |
|---|---|
dict
|
Summary with per-side |
Notes
The liquid-side file evaluates paleos.mgsio3_eos.Wolf18 on every
grid node, including below the solidus (metastable liquid). The
solid-side file dispatches through MgSiO3EoS()._phase_eos_map using
_get_mgsio3_solid_phase (melting-curve test removed) so every node
gets a solid-polymorph EoS evaluated metastably above the liquidus if
needed.
Source code in src/zalmoxis/eos/paleos_api.py
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 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 | |