Skip to content

Commit

Permalink
minor doc improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Oct 27, 2020
1 parent fed1ded commit af6833e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion aiida/tools/importexport/archive/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ArchiveMetadata:

def detect_archive_type(in_path: str) -> str:
"""For back-compatibility, but should be replaced with direct comparison of classes.
:param in_path: the path to the file
:returns: the archive type identifier (currently one of 'zip', 'tar.gz', 'folder')
Expand Down
17 changes: 12 additions & 5 deletions aiida/tools/importexport/dbimport/backends/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
###########################################################################
"""Common import functions for both database backend"""
import copy
from typing import Dict
from typing import Dict, Optional

from aiida.common import timezone
from aiida.common.progress_reporter import get_progress_reporter
Expand All @@ -23,10 +23,17 @@


def _make_import_group(
*, group, existing_entries: Dict[str, Dict[str, dict]], new_entries: Dict[str, Dict[str, dict]],
foreign_ids_reverse_mappings: Dict[str, Dict[str, int]]
):
"""Make an import group containing all imported nodes."""
*, group: Optional[ImportGroup], existing_entries: Dict[str, Dict[str, dict]],
new_entries: Dict[str, Dict[str, dict]], foreign_ids_reverse_mappings: Dict[str, Dict[str, int]]
) -> ImportGroup:
"""Make an import group containing all imported nodes.
:param group: Use an existing group
:param existing_entries: Entities that already exist in the AiiDA database: entity_name -> str(pk) -> fields
:param new_entries: Entities that are new to the AiiDA database: entity_name -> str(pk) -> fields
:param foreign_ids_reverse_mappings: Mapping of identifiers to primary keys: entity_name -> identifier -> pk
"""
existing = existing_entries.get(NODE_ENTITY_NAME, {})
existing_pk = [foreign_ids_reverse_mappings[NODE_ENTITY_NAME][v['uuid']] for v in existing.values()]
new = new_entries.get(NODE_ENTITY_NAME, {})
Expand Down

0 comments on commit af6833e

Please sign in to comment.