Skip to content

Commit 9597527

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 93c36c7 commit 9597527

File tree

3 files changed

+26
-32
lines changed

3 files changed

+26
-32
lines changed

src/aiida/cmdline/commands/cmd_process.py

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ def process_repair(manager, broker, dry_run):
558558
echo.echo_report(f'Revived process `{pid}`')
559559

560560

561-
@verdi_process.command("dump")
561+
@verdi_process.command('dump')
562562
@arguments.PROCESS()
563563
@options.PATH()
564564
@options.OVERWRITE()
@@ -613,30 +613,30 @@ def process_dump(
613613
node data for further inspection.
614614
"""
615615

616+
from aiida.tools.archive.exceptions import ExportValidationError
616617
from aiida.tools.dumping.data import DataDumper
617618
from aiida.tools.dumping.processes import ProcessDumper
618-
from aiida.tools.archive.exceptions import ExportValidationError
619619

620620
# from aiida.tools.dumping.utils import validate_rich_options
621621
from aiida.tools.dumping.rich import rich_from_cli
622622

623623
processdumper_kwargs = {
624-
"include_inputs": include_inputs,
625-
"include_outputs": include_outputs,
626-
"include_attributes": include_attributes,
627-
"include_extras": include_extras,
628-
"flat": flat,
629-
"dump_unsealed": dump_unsealed,
630-
"incremental": incremental,
624+
'include_inputs': include_inputs,
625+
'include_outputs': include_outputs,
626+
'include_attributes': include_attributes,
627+
'include_extras': include_extras,
628+
'flat': flat,
629+
'dump_unsealed': dump_unsealed,
630+
'incremental': incremental,
631631
}
632632

633633
rich_kwargs = {
634-
"rich_dump_all": rich_dump_all,
634+
'rich_dump_all': rich_dump_all,
635635
}
636636

637637
datadumper_kwargs = {
638-
"also_raw": also_raw,
639-
"also_rich": also_rich,
638+
'also_raw': also_raw,
639+
'also_rich': also_rich,
640640
}
641641

642642
# if also_rich:
@@ -672,15 +672,13 @@ def process_dump(
672672
output_path=path,
673673
)
674674
echo.echo_success(
675-
f"Raw files for {process.__class__.__name__} <{process.pk}> dumped into folder `{dump_path}`."
675+
f'Raw files for {process.__class__.__name__} <{process.pk}> dumped into folder `{dump_path}`.'
676676
)
677677
except FileExistsError:
678678
echo.echo_critical(
679-
"Dumping directory exists and overwrite is False. Set overwrite to True, or delete directory manually."
679+
'Dumping directory exists and overwrite is False. Set overwrite to True, or delete directory manually.'
680680
)
681681
except ExportValidationError as e:
682-
echo.echo_critical(f"{e!s}")
682+
echo.echo_critical(f'{e!s}')
683683
except Exception as e:
684-
echo.echo_critical(
685-
f"Unexpected error while dumping {process.__class__.__name__} <{process.pk}>:\n ({e!s})."
686-
)
684+
echo.echo_critical(f'Unexpected error while dumping {process.__class__.__name__} <{process.pk}>:\n ({e!s}).')

src/aiida/cmdline/commands/cmd_profile.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,6 @@ def storage_mirror(
325325
):
326326
"""Dump all data in an AiiDA profile's storage to disk."""
327327

328-
329328
from aiida import orm
330329
from aiida.tools.dumping.parser import DumpConfigParser
331330
from aiida.tools.dumping.rich import (
@@ -550,4 +549,4 @@ def storage_mirror(
550549
if dump_data:
551550
echo.echo_report(f'Dumping data for group `{group.label}`...')
552551
collection_dumper.dump_data_rich()
553-
# collection_dumper.dump_plugin_data()
552+
# collection_dumper.dump_plugin_data()

src/aiida/tools/dumping/processes.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -354,22 +354,19 @@ def _dump_calculation(
354354
output_path=output_path / io_dump_mapping.inputs, link_triples=input_links
355355
)
356356

357-
358357
if self.data_dumper.also_rich:
359358
rich_data_output_path = output_path / io_dump_mapping.inputs
360-
# if not self.data_dumper.data_hidden:
361-
# rich_data_output_path = output_path / io_dump_mapping.inputs
362-
# else:
363-
# # TODO: Currently, when dumping only one selected workflow, if rich dumping is activated, but
364-
# # TODO: `data-hidden` is set, no data nodes were actually being dumped
365-
# # TODO: With the current implementation below, they are dumped, but not in the same structure as for the
366-
# # TODO: `dump_rich_core` function. Quick fix for now
367-
# pass
359+
# if not self.data_dumper.data_hidden:
360+
# rich_data_output_path = output_path / io_dump_mapping.inputs
361+
# else:
362+
# # TODO: Currently, when dumping only one selected workflow, if rich dumping is activated, but
363+
# # TODO: `data-hidden` is set, no data nodes were actually being dumped
364+
# # TODO: With the current implementation below, they are dumped, but not in the same structure as for the
365+
# # TODO: `dump_rich_core` function. Quick fix for now
366+
# pass
368367

369368
# Only dump the rich data output files in the process directories if data_hidden is False
370-
self._dump_calculation_io_files_rich(
371-
output_path=rich_data_output_path, link_triples=input_links
372-
)
369+
self._dump_calculation_io_files_rich(output_path=rich_data_output_path, link_triples=input_links)
373370
# Dump the node_outputs apart from `retrieved`
374371
if self.include_outputs:
375372
output_links = list(calculation_node.base.links.get_outgoing(link_type=LinkType.CREATE))

0 commit comments

Comments
 (0)