Skip to content

Allow SWIFT snapshots to be reused as ICs explicitly#73

Draft
Francyrad wants to merge 1 commit intoSWIFTSIM:masterfrom
Francyrad:codex/reuse-swift-snapshots
Draft

Allow SWIFT snapshots to be reused as ICs explicitly#73
Francyrad wants to merge 1 commit intoSWIFTSIM:masterfrom
Francyrad:codex/reuse-swift-snapshots

Conversation

@Francyrad
Copy link
Copy Markdown

@Francyrad Francyrad commented Apr 27, 2026

Summary

  • Accept SWIFT snapshot field names as aliases for singular IC field names only when InitialConditions:accept_snapshot is enabled.
  • Keep the default behaviour unchanged so IC/snapshot naming conventions remain separate unless the user opts in explicitly.
  • Emit an explicit error if a snapshot field alias is detected while accept_snapshot is disabled.

Validation

  • make -j20 with the local Intel oneAPI/OpenMPI build.
  • Verified that reading a SWIFT planetary snapshot as ICs fails by default with a message pointing to InitialConditions:accept_snapshot.
  • Verified that the same snapshot is accepted and runs when InitialConditions:accept_snapshot: 1 is set.

@WillJRoper
Copy link
Copy Markdown
Contributor

The reason for keeping IC and snapshot naming conventions separate was intentional to prevent mistakes when using them interchangeably.

While this aliasing is a nice feature, if implemented, it should almost certainly be hidden behind a accept_snapshot argument in the parameter file, which is by default False. That way, you intentionally have to acknowledge what you are doing.

Additionally, for what it is worth, I do not like the duplication of the restart flag. That will only ever lead to confusion in my opinion.

@Francyrad
Copy link
Copy Markdown
Author

The reason for keeping IC and snapshot naming conventions separate was intentional to prevent mistakes when using them interchangeably.

While this aliasing is a nice feature, if implemented, it should almost certainly be hidden behind a accept_snapshot argument in the parameter file, which is by default False. That way, you intentionally have to acknowledge what you are doing.

Additionally, for what it is worth, I do not like the duplication of the restart flag. That will only ever lead to confusion in my opinion.

I can make further changes to implement your very fair requests

@Francyrad Francyrad force-pushed the codex/reuse-swift-snapshots branch from 8a16f51 to 433e744 Compare April 27, 2026 15:21
@Francyrad Francyrad changed the title Allow snapshots and restarts to be reused directly Allow SWIFT snapshots to be reused as ICs explicitly Apr 27, 2026
@Francyrad
Copy link
Copy Markdown
Author

Thanks, that makes sense. I have updated the PR to keep snapshot/IC naming separate by default. Snapshot field aliases are now only accepted when InitialConditions:accept_snapshot is set, and the code emits an explicit error pointing to that option when a snapshot alias is found without the opt-in.

I also removed the parameter-file restart flag from the PR; restart remains controlled by the existing command-line option.

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.

2 participants