Skip to content

Commit

Permalink
Update spelling of symlink
Browse files Browse the repository at this point in the history
  • Loading branch information
dapomeroy committed Nov 21, 2024
1 parent 6652232 commit bae752e
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion lib/ramble/ramble/fetch_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ def _fetch_urllib(self, url):
save_file = self.stage.save_filename
logger.msg(f"Fetching {url}")

# Check if we're about to try and open a broken simlink, and if so
# Check if we're about to try and open a broken symlink, and if so
# remove that file to avoid a bad situation where a file "exists" but
# cannot be opened (warning: this is not atomic)
if os.path.islink(save_file) and not os.path.exists(save_file):
Expand Down
12 changes: 6 additions & 6 deletions lib/ramble/ramble/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

from ramble.namespace import namespace
from ramble.util.logger import logger
from ramble.util.file_util import create_simlink
from ramble.util.file_util import create_symlink

import spack.util.spack_json as sjson
from spack.util.executable import which, Executable
Expand Down Expand Up @@ -139,8 +139,8 @@ def _execute(self):

if logger.enabled:
fs.mkdirp(self.log_dir)
# Also create simlink to give known paths
create_simlink(self.log_dir, self.log_dir_latest)
# Also create symlink to give known paths
create_symlink(self.log_dir, self.log_dir_latest)

if self.suppress_per_experiment_prints and not self.suppress_run_header:
logger.all_msg(f" Log files for experiments are stored in: {self.log_dir}")
Expand Down Expand Up @@ -223,7 +223,7 @@ def run(self):

logger.add_log(self.log_path)
if logger.enabled:
create_simlink(self.log_path, self.log_path_latest)
create_symlink(self.log_path, self.log_path_latest)

self._prepare()
self._execute()
Expand Down Expand Up @@ -402,7 +402,7 @@ def _prepare(self):
shutil.copyfile(src, dest)

archive_path_latest = os.path.join(self.workspace.archive_dir, "archive.latest")
create_simlink(archive_path, archive_path_latest)
create_symlink(archive_path, archive_path_latest)

def _complete(self):
if self.create_tar:
Expand All @@ -421,7 +421,7 @@ def _complete(self):
self.workspace.archive_dir, "archive.latest" + tar_extension
)

create_simlink(tar_path, tar_path_latest)
create_symlink(tar_path, tar_path_latest)

logger.debug(f"Archive url: {archive_url}")

Expand Down
4 changes: 2 additions & 2 deletions lib/ramble/ramble/test/end_to_end/experiment_excludes.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,11 @@ def test_wrfv4_exclusions(mutable_config, mutable_mock_workspace_path, request):
f.close()

workspace("analyze", "-f", "text", "json", "yaml", global_args=["-w", workspace_name])
text_simlink_results_files = glob.glob(os.path.join(ws1.root, "results.latest.txt"))
text_symlink_results_files = glob.glob(os.path.join(ws1.root, "results.latest.txt"))
text_results_files = glob.glob(os.path.join(ws1.root, "results*.txt"))
json_results_files = glob.glob(os.path.join(ws1.root, "results*.json"))
yaml_results_files = glob.glob(os.path.join(ws1.root, "results*.yaml"))
assert len(text_simlink_results_files) == 1
assert len(text_symlink_results_files) == 1
assert len(text_results_files) == 2
assert len(json_results_files) == 2
assert len(yaml_results_files) == 2
Expand Down
2 changes: 1 addition & 1 deletion lib/ramble/ramble/test/end_to_end/experiment_repeats.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def test_gromacs_repeats(mutable_config, mutable_mock_workspace_path):
json_results_files = glob.glob(os.path.join(ws1.root, "results*.json"))
yaml_results_files = glob.glob(os.path.join(ws1.root, "results*.yaml"))

# Match both the file and the simlink
# Match both the file and the symlink
assert len(text_results_files) == 2
assert len(json_results_files) == 2
assert len(yaml_results_files) == 2
Expand Down
4 changes: 2 additions & 2 deletions lib/ramble/ramble/test/end_to_end/explicit_zips.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,11 @@ def test_wrfv4_explicit_zips(mutable_config, mutable_mock_workspace_path):
f.close()

workspace("analyze", "-f", "text", "json", "yaml", global_args=["-w", workspace_name])
text_simlink_results_files = glob.glob(os.path.join(ws1.root, "results.latest.txt"))
text_symlink_results_files = glob.glob(os.path.join(ws1.root, "results.latest.txt"))
text_results_files = glob.glob(os.path.join(ws1.root, "results*.txt"))
json_results_files = glob.glob(os.path.join(ws1.root, "results*.json"))
yaml_results_files = glob.glob(os.path.join(ws1.root, "results*.yaml"))
assert len(text_simlink_results_files) == 1
assert len(text_symlink_results_files) == 1
assert len(text_results_files) == 2
assert len(json_results_files) == 2
assert len(yaml_results_files) == 2
Expand Down
12 changes: 6 additions & 6 deletions lib/ramble/ramble/test/end_to_end/wrfv4_dry_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,20 +267,20 @@ def test_wrfv4_spack_dry_run(mutable_config, mutable_mock_workspace_path):
f.close()

tmp_results_file = os.path.join(ws1.root, "temp.results.txt")
simlink_results_file = os.path.join(ws1.root, "results.latest.txt")
symlink_results_file = os.path.join(ws1.root, "results.latest.txt")
# Temporarily store some temp data in the "latest" result and check it
# gets updated
with open(tmp_results_file, "w+") as f:
f.write("Dummy data...")
os.symlink(tmp_results_file, simlink_results_file)
os.symlink(tmp_results_file, symlink_results_file)

workspace("analyze", "-f", "text", "json", "yaml", global_args=["-w", workspace_name])

text_results_files = glob.glob(os.path.join(ws1.root, "results*.txt"))
json_results_files = glob.glob(os.path.join(ws1.root, "results*.json"))
yaml_results_files = glob.glob(os.path.join(ws1.root, "results*.yaml"))

# Match both the file and the simlink
# Match both the file and the symlink
assert len(text_results_files) == 2
assert len(json_results_files) == 2
assert len(yaml_results_files) == 2
Expand Down Expand Up @@ -493,20 +493,20 @@ def test_wrfv4_no_pkg_man_dry_run(mutable_config, mutable_mock_workspace_path):
f.close()

tmp_results_file = os.path.join(ws1.root, "temp.results.txt")
simlink_results_file = os.path.join(ws1.root, "results.latest.txt")
symlink_results_file = os.path.join(ws1.root, "results.latest.txt")
# Temporarily store some temp data in the "latest" result and check it
# gets updated
with open(tmp_results_file, "w+") as f:
f.write("Dummy data...")
os.symlink(tmp_results_file, simlink_results_file)
os.symlink(tmp_results_file, symlink_results_file)

workspace("analyze", "-f", "text", "json", "yaml", global_args=["-w", workspace_name])

text_results_files = glob.glob(os.path.join(ws1.root, "results*.txt"))
json_results_files = glob.glob(os.path.join(ws1.root, "results*.json"))
yaml_results_files = glob.glob(os.path.join(ws1.root, "results*.yaml"))

# Match both the file and the simlink
# Match both the file and the symlink
assert len(text_results_files) == 2
assert len(json_results_files) == 2
assert len(yaml_results_files) == 2
Expand Down
4 changes: 2 additions & 2 deletions lib/ramble/ramble/util/file_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ def is_dry_run_path(path: str) -> bool:
return str(path).startswith(_DRY_RUN_PATH_PREFIX)


def create_simlink(base, link):
def create_symlink(base, link):
"""
Create simlink of a file to give a known and predictable path
Create symlink of a file to give a known and predictable path
"""
if os.path.islink(link):
os.unlink(link)
Expand Down

0 comments on commit bae752e

Please sign in to comment.