Skip to content

Bmad File Loading - #23

Merged
electronsandstuff merged 22 commits into
masterfrom
pierce/bmad
Sep 17, 2026
Merged

electronsandstuff merged 22 commits into
masterfrom
pierce/bmad

Conversation

@electronsandstuff

@electronsandstuff electronsandstuff commented Aug 26, 2026 •

Copy link
Copy Markdown
Owner

This PR resolves an issue loading files from Bmad using Parcel. Also some misc cleanup.

  • Add output from Bmad's particle dump feature and unit test recreating the issue.
  • Some cleanup of pmd_open_series
    • Refactor out find_first_iteration_file - finds first file matching filename with placeholder
    • Refactor out path_after_directory - Get the portion of the path relative to directory
    • Break out ensure_base_path_groups - Creates HDF5 groups up to iteration placeholder
  • String handling methods for parsing and dealing with iterations are updated to include a padding argument: extract_iteration_from_name and replace_iteration
  • The series handle is updated to include an iteration_padding parameter. In pmd_open_series, when the file being opened already exists, the padding is read from the name (file-based iterations) or group (group-based iterations) and stored. pmd_parse_iterations and pmd_open_iteration are updated to use the series padding setting.
    • All files and groups get read because iteration names like out_1000 is ambiguous and you need to confirm there are no files such as out_0001. Since Parcel supports non-contiguous groups, you can't assume the presence or lack of groups.
    • Check and error out on inconsistent padding (ie with multiple %T) and inconsistent numbering within an iteration.
    • Check for inconsistent padding across files

@electronsandstuff
electronsandstuff merged commit 81d9f8c into master Sep 17, 2026
3 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.

1 participant