Skip to content

Add experimental feature to use a hash as sim_dir.#107

Merged
jonasschwab merged 1 commit into
masterfrom
sim-dir-hash
Mar 6, 2026
Merged

Add experimental feature to use a hash as sim_dir.#107
jonasschwab merged 1 commit into
masterfrom
sim-dir-hash

Conversation

@jonasschwab

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an experimental option to generate Simulation.sim_dir from a hash of the full resolved parameter set, aiming to shorten directory names compared to the current directory_name(...) scheme.

Changes:

  • Add sim_dir_hash kwarg to Simulation.__init__ to enable hashed directory naming.
  • Introduce simple_hash() (FNV-1a 32-bit) and directory_name_hash() to compute the hashed directory name.
  • Update Simulation docstring to document the experimental feature and its cautions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread py_alf/simulation.py Outdated
Comment thread py_alf/simulation.py Outdated
Comment thread py_alf/simulation.py Outdated
Comment thread py_alf/simulation.py Outdated
Comment thread py_alf/simulation.py Outdated
Comment thread py_alf/simulation.py Outdated
Comment thread py_alf/simulation.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (1)

py_alf/simulation.py:16

  • Import order is not isort/ruff-compliant after adding json/hashlib (CI runs ruff check with I enabled). Please sort the standard-library imports (e.g., hashlib should come before json, and the rest should be alphabetized within the stdlib block).
import hashlib
import json
import os
import re
import shutil
import subprocess
import tempfile


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread py_alf/simulation.py Outdated
Comment thread py_alf/simulation.py Outdated
Comment thread py_alf/simulation.py Outdated
Comment thread py_alf/simulation.py Outdated
Comment thread py_alf/simulation.py Outdated
Comment thread py_alf/simulation.py

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread py_alf/simulation.py
@jonasschwab jonasschwab merged commit 429024b into master Mar 6, 2026
37 checks passed
@jonasschwab jonasschwab deleted the sim-dir-hash branch March 6, 2026 21:55
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