Skip to content

Conversation

@ElliottKasoar
Copy link
Member

Resolves #472

Creates new results directories if one ore more already exist.

This is implemented similarly to dlpoly-py, with a few small changes, but functionally I think it works more or less in the same way.

The scheme implemented is janus_results -> janus_results_1 -> janus_results_2, etc. and will ignore output directories formatted differently e.g. janus_results1 would not be considered.

As far as I can tell, the only place in the code that this impacts is our MD restart, so we now search for the potential last results directory to get the relevant restart file.

@ElliottKasoar ElliottKasoar self-assigned this Dec 11, 2025
@ElliottKasoar ElliottKasoar added the enhancement New/improved feature or request label Dec 11, 2025
Copy link
Collaborator

@oerc0122 oerc0122 left a comment

Choose a reason for hiding this comment

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

I still have a gut feeling the logic could be simpler, but with a numeric sort this should do the job nicely.


# If no restarts found, check potential last results directory
if not poss_restarts:
results_dirs = sorted(restart_stem.parent.parent.glob("janus_results*"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is lexicographic, not numeric sort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New/improved feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create new results directory for new calculations

2 participants