Skip to content

Commit a515785

Browse files
committed
start review changes
1 parent ea4007f commit a515785

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

docs/source/reference/command_line.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ Below is a list with all available subcommands.
453453
--broker-host HOSTNAME Hostname for the message broker. [default: 127.0.0.1]
454454
--broker-port INTEGER Port for the message broker. [default: 5672]
455455
--broker-virtual-host TEXT Name of the virtual host for the message broker without
456-
leading forward slash. [default: ""]
456+
leading forward slash.
457457
--repository DIRECTORY Absolute path to the file repository.
458458
--test-profile Designate the profile to be used for running the test
459459
suite only.

src/aiida/cmdline/commands/cmd_archive.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,12 @@ def inspect(ctx, archive, version, meta_data, database):
141141
@click.option(
142142
'--tmp-dir',
143143
type=click.Path(exists=True, file_okay=False, dir_okay=True, writable=True, path_type=Path),
144-
help='Directory to use for temporary files during archive creation. '
145-
'If not specified, a temporary directory will be created in the same directory as the output file '
146-
"with a '.aiida-export-' prefix. This parameter is useful when the output directory has limited "
147-
'space or when you want to use a specific filesystem (e.g., faster storage) for temporary operations. '
148-
'The directory must exist and be writable.',
144+
help=(
145+
'Location where the temporary directory will be written during archive creation.'
146+
'The directory must exist and be writable, and defaults to the parent directory of the output file.'
147+
'This parameter is useful when the output directory has limited space or when you want to use a specific'
148+
'filesystem (e.g., faster storage) for temporary operations.'
149+
),
149150
)
150151
@decorators.with_dbenv()
151152
def create(

src/aiida/tools/archive/create.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,10 @@ def create_archive(
141141
142142
:param backend: the backend to export from. If not specified, the default backend is used.
143143
144-
:param tmp_dir: Directory to use for temporary files during archive creation.
145-
If not specified, a temporary directory will be created in the same directory as the output file
146-
with a '.aiida-export-' prefix. This parameter is useful when the output directory has limited
147-
space or when you want to use a specific filesystem (e.g., faster storage) for temporary operations.
148-
The directory must exist and be writable.
144+
:param tmp_dir: Location where the temporary directory will be written during archive creation.
145+
The directory must exist and be writable, and defaults to the parent directory of the output file.
146+
This parameter is useful when the output directory has limited space or when you want to use a specific
147+
filesystem (e.g., faster storage) for temporary operations.
149148
150149
:param traversal_rules: graph traversal rules. See :const:`aiida.common.links.GraphTraversalRules`
151150
what rule names are toggleable and what the defaults are.
@@ -289,7 +288,6 @@ def querybuilder():
289288
EXPORT_LOGGER.report(f'Creating archive with:\n{tabulate(count_summary)}')
290289

291290
# Handle temporary directory configuration
292-
tmp_prefix = '.aiida-export-'
293291
if tmp_dir is not None:
294292
tmp_dir = Path(tmp_dir)
295293
if not tmp_dir.exists():
@@ -313,7 +311,7 @@ def querybuilder():
313311
# so that the user cannot end up with a half written archive on errors
314312
try:
315313
tmp_dir.mkdir(parents=True, exist_ok=True)
316-
with tempfile.TemporaryDirectory(dir=tmp_dir, prefix=tmp_prefix) as tmpdir:
314+
with tempfile.TemporaryDirectory(dir=tmp_dir, prefix='.aiida-export-') as tmpdir:
317315
tmp_filename = Path(tmpdir) / 'export.zip'
318316
with archive_format.open(tmp_filename, mode='x', compression=compression) as writer:
319317
# add metadata

0 commit comments

Comments
 (0)