Search, analysis, and tables¶
thermoml_io.collection
¶
Search, ranking, and multi-document aggregation for ThermoML data.
DatasetMatch
dataclass
¶
A ranked dataset returned by :meth:ThermoMLCollection.search.
observation_count counts only property values matching the requested
property/category filters. It is therefore the ranking metric used before
limit is applied.
Source code in src/thermoml_io/collection.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |
ThermoMLCollection
dataclass
¶
An immutable collection of independently sourced ThermoML documents.
Source code in src/thermoml_io/collection.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 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 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 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 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | |
component_index: ComponentIndex
property
¶
Return the collection-wide exact-alias component index.
resolve_component(query: ComponentQuery) -> ComponentIdentity
¶
Resolve one friendly or namespaced component query.
Raises:
| Type | Description |
|---|---|
ComponentNotFoundError
|
If no compound in the collection reports the requested identity. |
AmbiguousComponentError
|
If the query matches more than one chemically distinct identity. |
Source code in src/thermoml_io/collection.py
59 60 61 62 63 64 65 66 67 68 69 | |
from_urls(urls: tuple[str, ...] | list[str], *, timeout: float = 30.0, max_bytes: int = 100 * 1024 * 1024) -> ThermoMLCollection
classmethod
¶
Download several ThermoML documents without persisting their bytes.
Source code in src/thermoml_io/collection.py
71 72 73 74 75 76 77 78 79 80 81 82 | |
search(*, components: ComponentQuery | tuple[ComponentQuery, ...] | list[ComponentQuery] | None = None, required_components: tuple[ComponentQuery, ...] | list[ComponentQuery] | None = None, component_match: ComponentMatch = 'contains', system: tuple[ComponentQuery, ...] | list[ComponentQuery] | None = None, system_match: SystemMatch = 'exact', property_name: str | None = None, data_type: str | None = None, independent_variable: str | None = None, limit: int | None = None) -> tuple[DatasetMatch, ...]
¶
Search and rank experimental datasets.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
components
|
ComponentQuery | tuple[ComponentQuery, ...] | list[ComponentQuery] | None
|
One component or a list defining the component query. Queries match
exact reported names, formulas, CAS numbers, InChI, or InChIKey,
case-insensitively. Prefixes such as |
None
|
required_components
|
tuple[ComponentQuery, ...] | list[ComponentQuery] | None
|
Mandatory subset of |
None
|
component_match
|
ComponentMatch
|
|
'contains'
|
system
|
tuple[ComponentQuery, ...] | list[ComponentQuery] | None
|
Component identities describing a chemical system. By default the match is order-independent and exact. |
None
|
system_match
|
SystemMatch
|
|
'exact'
|
property_name
|
str | None
|
Case-insensitive substring of the reported ThermoML property name. |
None
|
data_type
|
str | None
|
Package classification such as |
None
|
independent_variable
|
str | None
|
Case-insensitive normalized substring of a reported ThermoML
variable name, for example |
None
|
limit
|
int | None
|
Maximum number of datasets returned. Ranking by the number of matching property observations occurs before truncation. |
None
|
Returns:
| Type | Description |
|---|---|
tuple[DatasetMatch, ...]
|
Matches sorted by descending matching observation count, followed by deterministic publication and dataset identifiers. |
Examples:
Search for the ten densest water/carbon-dioxide VLE datasets::
collection.search(
system=("H2O", "CO2"), data_type="VLE", limit=10
)
Source code in src/thermoml_io/collection.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 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 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 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 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | |
all_matches() -> tuple[DatasetMatch, ...]
¶
Return every non-empty dataset ranked by observation count.
Source code in src/thermoml_io/collection.py
278 279 280 | |
thermoml_io.analysis
¶
Descriptive metadata and coverage summaries for ThermoML collections.
RankedCount
dataclass
¶
One deterministic label/count pair in a collection ranking.
Source code in src/thermoml_io/analysis.py
14 15 16 17 18 19 | |
CollectionSummary
dataclass
¶
Counts and ranked coverage of a ThermoML collection.
Source code in src/thermoml_io/analysis.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |
top(field: str, limit: int = 10) -> tuple[RankedCount, ...]
¶
Return the first limit entries from one ranking field.
Source code in src/thermoml_io/analysis.py
41 42 43 44 45 46 47 48 | |
summarize_documents(documents: Iterable[ThermoMLDocument]) -> CollectionSummary
¶
Summarize a document stream without retaining the complete collection.
This is the scalable entry point for bulk archives. Every document is consumed exactly once, allowing callers to process millions of observations while retaining only aggregate counters.
Source code in src/thermoml_io/analysis.py
155 156 157 158 159 160 161 162 163 164 165 166 167 | |
summarize_collection(collection: ThermoMLCollection) -> CollectionSummary
¶
Summarize all parsed experimental observations in collection.
Component and system counts are weighted by individual property observations. A dataset with 100 property values therefore contributes more than a dataset with 10 values, matching the ranking semantics of the search API.
Source code in src/thermoml_io/analysis.py
170 171 172 173 174 175 176 177 178 | |
thermoml_io.archive
¶
Incremental analysis of local bulk ThermoML .tar/.tgz archives.
RankedDataset
dataclass
¶
Lightweight description of one dense experimental dataset.
Source code in src/thermoml_io/archive.py
39 40 41 42 43 44 45 46 47 48 49 50 | |
ArchiveParseFailure
dataclass
¶
Explicit record of one archive member that could not be decoded.
Source code in src/thermoml_io/archive.py
53 54 55 56 57 58 59 60 | |
ArchiveRecovery
dataclass
¶
One XML member recovered from its paired official NIST JSON member.
Source code in src/thermoml_io/archive.py
63 64 65 66 67 68 69 70 71 72 73 | |
ArchiveComponentIndex
dataclass
¶
Component identities discovered during one complete archive scan.
Source code in src/thermoml_io/archive.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | |
identities: tuple[ComponentIdentity, ...]
property
¶
Return resolved archive-wide component identities.
resolve_component(query: ComponentQuery) -> ComponentIdentity
¶
Resolve one friendly or namespaced query against this snapshot.
Source code in src/thermoml_io/archive.py
92 93 94 | |
ArchiveAnalysis
dataclass
¶
Streaming summary and dense-dataset ranking for a bulk archive.
Source code in src/thermoml_io/archive.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | |
CatalogEntry
dataclass
¶
One observed category/property/independent-variable combination.
Source code in src/thermoml_io/archive.py
114 115 116 117 118 119 120 121 122 123 | |
ArchiveCatalog
dataclass
¶
Catalog of queryable property relationships in an archive snapshot.
Source code in src/thermoml_io/archive.py
126 127 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 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | |
component_index: ComponentIndex
property
¶
Return the component index collected during the catalog scan.
resolve_component(query: ComponentQuery) -> ComponentIdentity
¶
Resolve one component without rescanning the archive.
Source code in src/thermoml_io/archive.py
143 144 145 | |
categories() -> tuple[RankedCount, ...]
¶
Rank package data categories by property-variable relationships.
Source code in src/thermoml_io/archive.py
147 148 149 150 151 152 153 154 155 | |
properties(data_category: str) -> tuple[RankedCount, ...]
¶
List exact reported properties available within a category.
Source code in src/thermoml_io/archive.py
157 158 159 160 161 162 163 164 165 166 167 | |
independent_variables(data_category: str, property_name: str) -> tuple[RankedCount, ...]
¶
List independent variables for a category and property substring.
Source code in src/thermoml_io/archive.py
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | |
PublicationRank
dataclass
¶
A publication ranked by returned property-variable relationships.
Source code in src/thermoml_io/archive.py
190 191 192 193 194 195 196 197 198 199 200 201 | |
ArchiveQueryResult
dataclass
¶
Property relationships and publication ranking from a complete scan.
Source code in src/thermoml_io/archive.py
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 | |
analysis_table: ExperimentalTable
property
¶
Return one analysis-ready row per reported property observation.
write(path: str | Path, *, format: TableFormat | None = None, layout: Literal['analysis', 'lossless'] = 'analysis') -> Path
¶
Write an analysis-ready result, or explicitly request lossless layout.
The default layout promotes physical quantities to ordinary columns
named with their ThermoML-reported units. layout="lossless" writes
the complete internal representation with structured JSON columns.
Source code in src/thermoml_io/archive.py
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 | |
write_csv(path: str | Path) -> Path
¶
Write this query as an analysis-ready CSV file.
Source code in src/thermoml_io/archive.py
252 253 254 | |
write_json(path: str | Path) -> Path
¶
Write this query as an analysis-ready JSON table.
Source code in src/thermoml_io/archive.py
256 257 258 | |
write_yaml(path: str | Path) -> Path
¶
Write this query as an analysis-ready YAML table.
Source code in src/thermoml_io/archive.py
260 261 262 | |
write_parquet(path: str | Path) -> Path
¶
Write this query as an analysis-ready Parquet table.
Source code in src/thermoml_io/archive.py
264 265 266 | |
write_lossless(path: str | Path, *, format: TableFormat | None = None) -> Path
¶
Write the complete provenance-oriented internal table explicitly.
Source code in src/thermoml_io/archive.py
268 269 270 | |
iter_thermoml_archive(archive_path: str | Path, *, serialized_prefilter: str | bytes | None = None, json_fallback: JsonFallback = 'on_xml_error') -> Iterator[ThermoMLDocument]
¶
Yield ThermoML documents from a local bulk archive.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
archive_path
|
str | Path
|
Local tar-compatible archive. Members are read in archive order and are never extracted to the filesystem. |
required |
serialized_prefilter
|
str | bytes | None
|
Optional exact byte sequence that must occur in a serialized XML member before parsing. This is only a performance prefilter; callers must still apply semantic component/system matching to the parsed document. |
None
|
Yields:
| Type | Description |
|---|---|
ThermoMLDocument
|
One provenance-labelled document at a time. |
Notes
Bulk archive bytes remain subject to their source terms. This function does not persist, redistribute, or silently skip malformed matching documents.
Source code in src/thermoml_io/archive.py
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 | |
analyze_thermoml_archive(archive_path: str | Path, *, component: ComponentQuery | None = None, component_index: ComponentIndex | ArchiveComponentIndex | None = None, serialized_prefilter: str | bytes | None = None, top_datasets: int = 10, on_error: Literal['raise', 'collect'] = 'raise', json_fallback: JsonFallback = 'on_xml_error') -> ArchiveAnalysis
¶
Analyze an entire ThermoML archive with bounded aggregate memory.
component includes every pure or mixture dataset matching an
archive-resolved identity. Friendly strings are resolved in a preliminary
complete scan unless a reusable component_index is supplied. A
:class:ComponentIdentity returned by an explicit resolver avoids that
scan. serialized_prefilter can accelerate stable-identifier queries,
but semantic matching remains the deciding filter. Dataset truncation
occurs only after the complete archive has been scanned and ranked.
on_error="collect" records every known ThermoML decoding failure in the
result; the default strict mode raises at the first failure.
Source code in src/thermoml_io/archive.py
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 | |
index_thermoml_archive(archive_path: str | Path | None = None, *, on_error: Literal['raise', 'collect'] = 'collect', json_fallback: JsonFallback = 'on_xml_error') -> ArchiveComponentIndex
¶
Build a reusable archive-wide index of component aliases.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
archive_path
|
str | Path | None
|
Local archive path. The configured upstream snapshot is fetched when omitted. |
None
|
on_error
|
Literal['raise', 'collect']
|
|
'collect'
|
Returns:
| Type | Description |
|---|---|
ArchiveComponentIndex
|
Detached identities connected through reported InChIKey, InChI, and CAS identifiers. No external chemical service is contacted. |
Source code in src/thermoml_io/archive.py
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 | |
catalog_thermoml_archive(archive_path: str | Path | None = None, *, on_error: Literal['raise', 'collect'] = 'collect', json_fallback: JsonFallback = 'on_xml_error') -> ArchiveCatalog
¶
Scan a complete snapshot and catalog queryable property relationships.
A relationship is one reported property value paired with one independent
variable value in the same ThermoML NumValues record. Properties with
no reported independent variable are retained with None as the
independent-variable name.
Source code in src/thermoml_io/archive.py
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 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 | |
query_thermoml_archive(archive_path: str | Path | None = None, *, components: ComponentQuery | tuple[ComponentQuery, ...] | list[ComponentQuery], required_components: tuple[ComponentQuery, ...] | list[ComponentQuery] | None = None, component_match: ComponentMatch = 'contains', component_index: ComponentIndex | ArchiveComponentIndex | None = None, data_category: str | None = None, property_name: str | None = None, independent_variable: str, publication_limit: int | None = None, serialized_prefilters: tuple[str | bytes, ...] | list[str | bytes] = (), on_error: Literal['raise', 'collect'] = 'collect', json_fallback: JsonFallback = 'on_xml_error') -> ArchiveQueryResult
¶
Return property-versus-condition rows from a complete archive scan.
Friendly strings are resolved against the complete archive before the data
scan. Pass a reusable component_index from
:func:index_thermoml_archive, or pass already resolved
:class:ComponentIdentity objects, to avoid repeating the identity scan.
Publications are ranked by the number of returned property-variable rows.
publication_limit is applied only after every matching archive member
has been scanned. The resulting table repeats full citation, provenance,
system, method, phase, constraint, and uncertainty metadata on every row.
Source code in src/thermoml_io/archive.py
758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 | |
thermoml_io.table
¶
Loss-aware tabular views and CSV, JSON, YAML, and Parquet exporters.
ExperimentalTable
dataclass
¶
Rectangular long-form view of heterogeneous experimental observations.
Each row represents one property value. Variables, constraints, and the full uncertainty list are encoded as JSON text in scalar columns so the same schema can be exported consistently to CSV and Parquet.
Source code in src/thermoml_io/table.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 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 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | |
concatenate(*tables: ExperimentalTable) -> ExperimentalTable
classmethod
¶
Concatenate compatible tables without dropping metadata columns.
Source code in src/thermoml_io/table.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |
to_records() -> list[dict[str, Cell]]
¶
Return independent dictionaries suitable for dataframe creation.
Source code in src/thermoml_io/table.py
123 124 125 | |
to_pandas() -> Any
¶
Return a pandas DataFrame when the optional dependency is installed.
Source code in src/thermoml_io/table.py
127 128 129 130 131 132 133 134 135 | |
write(path: str | Path, *, format: TableFormat | None = None) -> Path
¶
Write the table using a format inferred from the path by default.
Source code in src/thermoml_io/table.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | |
build_experimental_table(collection: ThermoMLCollection, *, matches: tuple[DatasetMatch, ...] | None = None) -> ExperimentalTable
¶
Build a stable long-form table from all or selected datasets.
Source code in src/thermoml_io/table.py
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 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 | |
build_property_table(collection: ThermoMLCollection, *, matches: tuple[DatasetMatch, ...]) -> ExperimentalTable
¶
Build property-versus-independent-variable rows with full provenance.
matches must come from :meth:ThermoMLCollection.search with an
independent_variable filter. One output row represents one reported
property value paired with one matching variable value from the same
ThermoML NumValues record. Fixed experimental conditions remain in
constraints_json. complementary_conditions_json combines every
other point variable with every fixed constraint, preserving their source
so plots and regressions can distinguish isobars, isotherms, compositions,
and other parameterizations. Every publication field from
:func:build_experimental_table is retained.
Source code in src/thermoml_io/table.py
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 | |
build_analysis_table(table: ExperimentalTable) -> ExperimentalTable
¶
Pivot a property-condition table into an analysis-ready wide table.
Physical quantities become ordinary columns named exactly as reported by
ThermoML, including their units (for example Temperature, K and
Viscosity, Pa*s). Each row remains one reported property observation.
DOI, authors/year, system, phases, method, category, and dataset identity
are repeated as scalar columns. Less frequently used metrological and
provenance details are retained as compact JSON in metadata.
If the same reported quantity name has multiple semantic meanings within one observation, its columns are explicitly qualified by source, phase, or component. Differences that occur only between rows remain in metadata so the main physical columns stay compact. Duplicate indistinguishable conditions in one observation raise rather than silently overwriting a value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
ExperimentalTable
|
Lossless table returned by :func: |
required |
Returns:
| Type | Description |
|---|---|
ExperimentalTable
|
Analysis-ready table with schema |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/thermoml_io/table.py
708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 | |
thermoml_io.upstream
¶
Versioned upstream discovery and verified ThermoML archive downloads.
ArchiveSource
dataclass
¶
Immutable description of one checksum-pinned upstream archive.
Source code in src/thermoml_io/upstream.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
CordraSnapshot
dataclass
¶
Deterministic identity census of the live NIST ThermoML Cordra API.
Source code in src/thermoml_io/upstream.py
45 46 47 48 49 50 51 52 53 54 55 | |
get_archive_source(source: str = 'nist') -> ArchiveSource
¶
Load a checksum-pinned archive source shipped with the package.
Source code in src/thermoml_io/upstream.py
107 108 109 110 111 112 113 114 115 116 117 118 | |
get_cordra_snapshot() -> CordraSnapshot
¶
Load the packaged identity census for the live NIST Cordra API.
Source code in src/thermoml_io/upstream.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
discover_archive_source(source: str = 'nist', *, timeout: float = 30.0) -> ArchiveSource
¶
Discover the newest tar-compatible ThermoML snapshot in NIST NERDm.
Source code in src/thermoml_io/upstream.py
178 179 180 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 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | |
discover_cordra_snapshot(*, timeout: float = 180.0) -> CordraSnapshot
¶
Census all live Cordra ThermoML IDs independently of the bulk archive.
The Cordra API intentionally exposes metadata and data-point counts, not
the numerical observations. This census detects additions or removals even
when the checksum-pinned NERDm .tgz snapshot has not changed.
Source code in src/thermoml_io/upstream.py
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | |
default_cache_dir() -> Path
¶
Return the platform-neutral user cache directory for archive bytes.
Source code in src/thermoml_io/upstream.py
260 261 262 263 264 265 266 267 268 | |
fetch_thermoml_archive(*, cache_dir: str | Path | None = None, source: str = 'nist', force: bool = False, timeout: float = 120.0) -> Path
¶
Return a locally cached, size- and SHA-256-verified archive.
No URL, filename, or checksum is required from the caller. A temporary sibling file is downloaded and verified before atomically replacing an invalid or explicitly refreshed cache entry.
Source code in src/thermoml_io/upstream.py
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 | |
archive_source_record(source: ArchiveSource) -> dict[str, Any]
¶
Return the deterministic registry representation used by maintenance CI.
Source code in src/thermoml_io/upstream.py
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | |
cordra_snapshot_record(snapshot: CordraSnapshot) -> dict[str, Any]
¶
Return the deterministic registry representation used by monthly CI.
Source code in src/thermoml_io/upstream.py
369 370 371 | |
thermoml_io.conformance
¶
Metadata-only registry of external ThermoML conformance material.
ConformanceSource
dataclass
¶
External specification or example corpus, never an experimental source.
Source code in src/thermoml_io/conformance.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |
list_conformance_sources() -> tuple[ConformanceSource, ...]
¶
List registered external examples without downloading or redistributing them.
Source code in src/thermoml_io/conformance.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
get_conformance_source(source_id: str) -> ConformanceSource
¶
Return one registered conformance source by stable package identifier.
Source code in src/thermoml_io/conformance.py
110 111 112 113 114 115 | |