Skip to content

Add spectre versioning to abd metadata - #118

Merged
moble merged 2 commits into
moble:mainfrom
keefemitman:spectre-versioning
Jul 13, 2026
Merged

Add spectre versioning to abd metadata#118
moble merged 2 commits into
moble:mainfrom
keefemitman:spectre-versioning

Conversation

@keefemitman

Copy link
Copy Markdown
Contributor

This changes the pipeline for the "SpECTRECCE_v1" pathway in create_abd_from_h5 to extract metadata information from SpECTRE CCE's output .h5 file and append it to the metadata of the returned abd object as version_info_update. This can then be supplied to output waveforms, like the strain, by using sxs.waveforms.rotating_paired_diff_multishuffle_bzip2.save's option version_info_update.

An example of what this additional information looks like as a part of the version_info is the following:

"spectre_cce": {
      "spectre_version": "2026.06.30",
      "spectre_git_branch": "develop",
      "spectre_git_revision": "e4ce00c0f",
      "spectre_link_date": "2026-07-06T14:49:32+00:00",
      "spectre_build_type": "Release",
      "spectre_build_information": "#\n# File created on Tue Jul  7 08:59:09 2026\n# SpECTRE Build Information:\n# Version:                      2026.06.30\n# Compiled on host:             mbot.cac.corne\
ll.edu\n# Compiled in directory:        /home/fs01/kem343/Codes/SpECTRE/build\n# Source directory is:          /home/fs01/kem343/Codes/SpECTRE\n# Compiled on git branch:       develop\n# Compiled on git \
revision:     e4ce00c0f\n# Linked on:                    2026-07-06T14:49:32+00:00\n# Build type:                   Release\n#",
      "spectre_cce_output_file": "CharacteristicExtractUnusedFile_R0100.h5",
      "spectre_cce_subfile": "SpectreR0100.cce",
      "spectre_header_source": "cce_subfile_header.hdr",
      "spectre_cce_sxs_format": "SpECTRE_CCE_v1",
      "spectre_cce_h5_object_version": 0,
      "spectre_h5_source_archive_location": "/src.tar.gz"
    }

Comment thread scri/SpEC/file_io/__init__.py Outdated
Comment on lines +664 to +666
spectre_cce_version_info_update = (
_spectre_cce_version_info_update_from_h5(f, cce_key, file_name)
)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just a little nervous about assuming that this pretty complicated function that makes a lot of nested assumptions about where things are in files will always work, even for some old files people have lying around. Should you wrap this in a try block?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been added in the latest commit.

Comment on lines -531 to +660
else:
cce_key = "Cce"
data_label_suffix = ".dat"
else:
cce_key = "Cce"
data_label_suffix = ".dat"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did the indentation change here?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL: This else block fires whenever break did not fire in the for loop — so if there are not items to iterate over or if the clause inside the loop never succeeded. So this makes sure that these variables will always be defined. LGTM.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, @keefemitman I guess this should get a comment explaining that point, since it was not obvious to either of us.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been added in the latest commit.

@keefemitman

Copy link
Copy Markdown
Contributor Author

With the latest commit, the metadata now contains something along the lines of

"spectre_cce": {
      "spectre_file_creation_time": "Thu Jul  9 08:16:29 2026",
      "spectre_version": "2026.06.30",
      "spectre_compiled_host": "mbot.cac.cornell.edu",
      "spectre_compiled_directory": "/home/fs01/kem343/Codes/SpECTRE/build",
      "spectre_source_directory": "/home/fs01/kem343/Codes/SpECTRE",
      "spectre_git_branch": "develop",
      "spectre_git_revision": "e4ce00c0f",
      "spectre_link_date": "2026-07-06T14:49:32+00:00",
      "spectre_build_type": "Release"
    }

@keefemitman

Copy link
Copy Markdown
Contributor Author

@duetosymmetry @moble can we merge?

@moble
moble merged commit 8552238 into moble:main Jul 13, 2026
6 checks passed
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.

3 participants