diff --git a/docs/source/nitpick-exceptions b/docs/source/nitpick-exceptions index 5d98f3af12..0c9487fd4c 100644 --- a/docs/source/nitpick-exceptions +++ b/docs/source/nitpick-exceptions @@ -26,6 +26,7 @@ py:class json.encoder.JSONEncoder py:class EXPOSED_TYPE py:class EVENT_CALLBACK_TYPE py:class datetime +py:class UUID py:class types.LambdaType py:meth tempfile.TemporaryDirectory @@ -68,6 +69,8 @@ py:class aiida.orm.groups.SelfType py:class aiida.orm.implementation.entitites.EntityType py:class aiida.engine.processes.functions.FunctionType py:class aiida.engine.processes.workchains.workchain.MethodType +py:class aiida.orm.entities.EntityInputModel +py:class aiida.orm.entities.EntityModelType py:class aiida.orm.entities.EntityType py:class aiida.orm.entities.BackendEntityType py:class aiida.orm.entities.CollectionType diff --git a/src/aiida/cmdline/commands/cmd_code.py b/src/aiida/cmdline/commands/cmd_code.py index 8b101a9a97..4df2676c72 100644 --- a/src/aiida/cmdline/commands/cmd_code.py +++ b/src/aiida/cmdline/commands/cmd_code.py @@ -8,11 +8,13 @@ ########################################################################### """`verdi code` command.""" +from __future__ import annotations + import pathlib import warnings from collections import defaultdict from functools import partial -from typing import Any +from typing import TYPE_CHECKING, Any import click @@ -26,16 +28,20 @@ from aiida.cmdline.utils.decorators import with_dbenv from aiida.common import exceptions +if TYPE_CHECKING: + from aiida.orm import Code + @verdi.group('code') def verdi_code(): """Setup and manage codes.""" -def create_code(ctx: click.Context, cls, **kwargs) -> None: +def create_code(ctx: click.Context, cls: Code, **kwargs) -> None: """Create a new `Code` instance.""" try: - instance = cls._from_model(cls.Model(**kwargs)) + model = cls.InputModel(**kwargs) + instance = cls.from_model(model) # type: ignore[arg-type] except (TypeError, ValueError) as exception: echo.echo_critical(f'Failed to create instance `{cls}`: {exception}') diff --git a/src/aiida/cmdline/groups/dynamic.py b/src/aiida/cmdline/groups/dynamic.py index c7949a9065..d4c2527aa3 100644 --- a/src/aiida/cmdline/groups/dynamic.py +++ b/src/aiida/cmdline/groups/dynamic.py @@ -97,8 +97,9 @@ def call_command(self, ctx: click.Context, cls: t.Any, non_interactive: bool, ** if hasattr(cls, 'Model'): # The plugin defines a pydantic model: use it to validate the provided arguments + Model = cls.InputModel if hasattr(cls, 'InputModel') else cls.Model # noqa: N806 try: - cls.Model(**kwargs) + Model(**kwargs) except ValidationError as exception: param_hint = [ f'--{loc.replace("_", "-")}' # type: ignore[union-attr] @@ -168,9 +169,11 @@ def list_options(self, entry_point: str) -> list[t.Callable[[FC], FC]]: options_spec = self.factory(entry_point).get_cli_options() # type: ignore[union-attr] return [self.create_option(*item) for item in options_spec] + Model = cls.InputModel if hasattr(cls, 'InputModel') else cls.Model # noqa: N806 + options_spec = {} - for key, field_info in cls.Model.model_fields.items(): + for key, field_info in Model.model_fields.items(): if get_metadata(field_info, 'exclude_from_cli'): continue diff --git a/src/aiida/common/datastructures.py b/src/aiida/common/datastructures.py index 58198f051a..94658c09a2 100644 --- a/src/aiida/common/datastructures.py +++ b/src/aiida/common/datastructures.py @@ -167,8 +167,8 @@ class CalcInfo(DefaultFieldsAttributeDict): max_wallclock_seconds: None | int max_memory_kb: None | int rerunnable: bool - retrieve_list: None | list[str | tuple[str, str, str]] - retrieve_temporary_list: None | list[str | tuple[str, str, str]] + retrieve_list: None | list[str | tuple[str, str, int]] + retrieve_temporary_list: None | list[str | tuple[str, str, int]] local_copy_list: None | list[tuple[str, str, str]] remote_copy_list: None | list[tuple[str, str, str]] remote_symlink_list: None | list[tuple[str, str, str]] diff --git a/src/aiida/common/pydantic.py b/src/aiida/common/pydantic.py index 8694d59a09..ff26ecde05 100644 --- a/src/aiida/common/pydantic.py +++ b/src/aiida/common/pydantic.py @@ -66,7 +66,7 @@ class Model(BaseModel): :param short_name: Optional short name to use for an option on a command line interface. :param option_cls: The :class:`click.Option` class to use to construct the option. :param orm_class: The class, or entry point name thereof, to which the field should be converted. If this field is - defined, the value of this field should acccept an integer which will automatically be converted to an instance + defined, the value of this field should accept an integer which will automatically be converted to an instance of said ORM class using ``orm_class.collection.get(id={field_value})``. This is useful, for example, where a field represents an instance of a different entity, such as an instance of ``User``. The serialized data would store the ``pk`` of the user, but the ORM entity instance would receive the actual ``User`` instance with that @@ -75,10 +75,10 @@ class Model(BaseModel): :param model_to_orm: Optional callable to convert the value of a field from a model instance to an ORM instance. :param exclude_to_orm: When set to ``True``, this field value will not be passed to the ORM entity constructor through ``Entity.from_model``. - :param exclude_to_orm: When set to ``True``, this field value will not be exposed on the CLI command that is + :param exclude_from_cli: When set to ``True``, this field value will not be exposed on the CLI command that is dynamically generated to create a new instance. - :param is_attribute: Whether the field is stored as an attribute. - :param is_subscriptable: Whether the field can be indexed like a list or dictionary. + :param is_attribute: Whether the field is stored as an attribute. Used by `QbFields`. + :param is_subscriptable: Whether the field can be indexed like a list or dictionary. Used by `QbFields`. """ field_info = Field(default, **kwargs) @@ -97,4 +97,9 @@ class Model(BaseModel): if value is not None: field_info.metadata.append({key: value}) + if exclude_to_orm: + extra = getattr(field_info, 'json_schema_extra', None) or {} + extra.update({'readOnly': True}) + field_info.json_schema_extra = extra + return field_info diff --git a/src/aiida/common/typing.py b/src/aiida/common/typing.py index 14dd169898..1c99de9781 100644 --- a/src/aiida/common/typing.py +++ b/src/aiida/common/typing.py @@ -11,11 +11,12 @@ from __future__ import annotations import pathlib +import sys from typing import Union -try: +if sys.version_info >= (3, 11): from typing import Self -except ImportError: +else: from typing_extensions import Self __all__ = ('FilePath', 'Self') diff --git a/src/aiida/orm/authinfos.py b/src/aiida/orm/authinfos.py index 8282e944fb..c37ecbef09 100644 --- a/src/aiida/orm/authinfos.py +++ b/src/aiida/orm/authinfos.py @@ -10,7 +10,7 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Dict, Optional, Type +from typing import TYPE_CHECKING, Any, Dict, Optional, Type, cast from aiida.common import exceptions from aiida.common.pydantic import MetadataField @@ -55,13 +55,13 @@ class Model(entities.Entity.Model): description='The PK of the computer', is_attribute=False, orm_class=Computer, - orm_to_model=lambda auth_info, _: auth_info.computer.pk, # type: ignore[attr-defined] + orm_to_model=lambda auth_info, _: cast('AuthInfo', auth_info).computer.pk, ) user: int = MetadataField( description='The PK of the user', is_attribute=False, orm_class=User, - orm_to_model=lambda auth_info, _: auth_info.user.pk, # type: ignore[attr-defined] + orm_to_model=lambda auth_info, _: cast('AuthInfo', auth_info).user.pk, ) enabled: bool = MetadataField( True, diff --git a/src/aiida/orm/comments.py b/src/aiida/orm/comments.py index 8d6614de38..d615b63dbd 100644 --- a/src/aiida/orm/comments.py +++ b/src/aiida/orm/comments.py @@ -10,6 +10,7 @@ from datetime import datetime from typing import TYPE_CHECKING, List, Optional, Type, cast +from uuid import UUID from aiida.common.pydantic import MetadataField from aiida.manage import get_manager @@ -68,14 +69,20 @@ class Comment(entities.Entity['BackendComment', CommentCollection]): _CLS_COLLECTION = CommentCollection class Model(entities.Entity.Model): - uuid: Optional[str] = MetadataField( - description='The UUID of the comment', is_attribute=False, exclude_to_orm=True + uuid: UUID = MetadataField( + description='The UUID of the comment', + is_attribute=False, + exclude_to_orm=True, ) - ctime: Optional[datetime] = MetadataField( - description='Creation time of the comment', is_attribute=False, exclude_to_orm=True + ctime: datetime = MetadataField( + description='Creation time of the comment', + is_attribute=False, + exclude_to_orm=True, ) - mtime: Optional[datetime] = MetadataField( - description='Modified time of the comment', is_attribute=False, exclude_to_orm=True + mtime: datetime = MetadataField( + description='Modified time of the comment', + is_attribute=False, + exclude_to_orm=True, ) node: int = MetadataField( description='Node PK that the comment is attached to', @@ -89,7 +96,10 @@ class Model(entities.Entity.Model): orm_class='core.user', orm_to_model=lambda comment, _: cast('Comment', comment).user.pk, ) - content: str = MetadataField(description='Content of the comment', is_attribute=False) + content: str = MetadataField( + description='Content of the comment', + is_attribute=False, + ) def __init__( self, node: 'Node', user: 'User', content: Optional[str] = None, backend: Optional['StorageBackend'] = None diff --git a/src/aiida/orm/computers.py b/src/aiida/orm/computers.py index c92dd291ae..598496a8e2 100644 --- a/src/aiida/orm/computers.py +++ b/src/aiida/orm/computers.py @@ -8,9 +8,12 @@ ########################################################################### """Module for Computer entities""" +from __future__ import annotations + import logging import os from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Type, Union +from uuid import UUID from aiida.common import exceptions from aiida.common.pydantic import MetadataField @@ -74,13 +77,37 @@ class Computer(entities.Entity['BackendComputer', ComputerCollection]): _CLS_COLLECTION = ComputerCollection class Model(entities.Entity.Model): - uuid: str = MetadataField(description='The UUID of the computer', is_attribute=False, exclude_to_orm=True) - label: str = MetadataField(description='Label for the computer', is_attribute=False) - description: str = MetadataField(description='Description of the computer', is_attribute=False) - hostname: str = MetadataField(description='Hostname of the computer', is_attribute=False) - transport_type: str = MetadataField(description='Transport type of the computer', is_attribute=False) - scheduler_type: str = MetadataField(description='Scheduler type of the computer', is_attribute=False) - metadata: Dict[str, Any] = MetadataField(description='Metadata of the computer', is_attribute=False) + uuid: UUID = MetadataField( + description='The UUID of the computer', + is_attribute=False, + exclude_to_orm=True, + ) + label: str = MetadataField( + description='Label for the computer', + is_attribute=False, + ) + description: str = MetadataField( + '', + description='Description of the computer', + is_attribute=False, + ) + hostname: str = MetadataField( + description='Hostname of the computer', + is_attribute=False, + ) + transport_type: str = MetadataField( + description='Transport type of the computer', + is_attribute=False, + ) + scheduler_type: str = MetadataField( + description='Scheduler type of the computer', + is_attribute=False, + ) + metadata: Dict[str, Any] = MetadataField( + default_factory=dict, + description='Metadata of the computer', + is_attribute=False, + ) def __init__( self, diff --git a/src/aiida/orm/entities.py b/src/aiida/orm/entities.py index d5d63b0543..65f05bf360 100644 --- a/src/aiida/orm/entities.py +++ b/src/aiida/orm/entities.py @@ -14,16 +14,17 @@ import pathlib from enum import Enum from functools import lru_cache -from typing import TYPE_CHECKING, Any, Generic, List, Optional, Type, TypeVar, Union +from typing import TYPE_CHECKING, Any, Generic, List, Literal, Optional, Type, TypeVar, Union from plumpy.base.utils import call_with_super_check, super_check -from pydantic import BaseModel +from pydantic import BaseModel, ConfigDict, create_model from pydantic.fields import FieldInfo from aiida.common import exceptions, log from aiida.common.exceptions import EntryPointError, InvalidOperation, NotExistent from aiida.common.lang import classproperty, type_check from aiida.common.pydantic import MetadataField, get_metadata +from aiida.common.typing import Self from aiida.common.warnings import warn_deprecation from aiida.manage import get_manager @@ -39,6 +40,7 @@ CollectionType = TypeVar('CollectionType', bound='Collection') EntityType = TypeVar('EntityType', bound='Entity') +EntityModelType = TypeVar('EntityModelType', bound=BaseModel) BackendEntityType = TypeVar('BackendEntityType', bound='BackendEntity') @@ -89,11 +91,11 @@ def __init__(self, entity_class: Type[EntityType], backend: Optional['StorageBac self._backend = backend or get_manager().get_profile_storage() self._entity_type = entity_class - def __call__(self: CollectionType, backend: 'StorageBackend') -> CollectionType: + def __call__(self, backend: 'StorageBackend') -> Self: """Get or create a cached collection using a new backend.""" if backend is self._backend: return self - return self.get_cached(self.entity_type, backend=backend) # type: ignore[arg-type] + return self.get_cached(self.entity_type, backend=backend) @property def entity_type(self) -> Type[EntityType]: @@ -148,16 +150,18 @@ def find( filters: Optional['FilterType'] = None, order_by: Optional['OrderByType'] = None, limit: Optional[int] = None, + offset: Optional[int] = None, ) -> List[EntityType]: """Find collection entries matching the filter criteria. :param filters: the keyword value pair filters to match :param order_by: a list of (key, direction) pairs specifying the sort order :param limit: the maximum number of results to return + :param offset: number of initial results to be skipped :return: a list of resulting matches """ - query = self.query(filters=filters, order_by=order_by, limit=limit) + query = self.query(filters=filters, order_by=order_by, limit=limit, offset=offset) return query.all(flat=True) def all(self) -> List[EntityType]: @@ -184,14 +188,82 @@ class Entity(abc.ABC, Generic[BackendEntityType, CollectionType], metaclass=Enti _logger: Logger = log.AIIDA_LOGGER.getChild('orm.entities') class Model(BaseModel, defer_build=True): - pk: Optional[int] = MetadataField( - None, - description='The primary key of the entity. Can be `None` if the entity is not yet stored.', + model_config = ConfigDict(extra='forbid') + + pk: int = MetadataField( + description='The primary key of the entity', is_attribute=False, exclude_to_orm=True, exclude_from_cli=True, ) + @classmethod + def __pydantic_init_subclass__(cls, **kwargs: Any) -> None: + """Sets the JSON schema title of the model. + + The qualified name of the class is used, with dots removed. For example, `Node.Model` becomes `NodeModel` + in the JSON schema. + """ + super().__pydantic_init_subclass__(**kwargs) + cls.model_config['title'] = cls.__qualname__.replace('.', '') + + @classmethod + def as_input_model(cls: Type[EntityModelType]) -> Type[EntityModelType]: + """Return a derived model class with read-only fields removed. + + This also removes any serializers/validators defined on those fields. + + :return: The derived input model class. + """ + + # Derive the input model from the original model + new_name = cls.__qualname__.replace('.Model', 'InputModel') + InputModel = create_model( # noqa: N806 + new_name, + __base__=cls, + __doc__=f'Input version of {cls.__name__}.', + ) + InputModel.__qualname__ = new_name + InputModel.__module__ = cls.__module__ + + # Identify read-only fields + readonly_fields = [ + name + for name, field in InputModel.model_fields.items() + if hasattr(field, 'json_schema_extra') + and isinstance(field.json_schema_extra, dict) + and field.json_schema_extra.get('readOnly') + ] + + # Remove read-only fields + for name in readonly_fields: + InputModel.model_fields.pop(name, None) + if hasattr(InputModel, name): + delattr(InputModel, name) + + # Prune field validators/serializers referring to read-only fields + decorators = InputModel.__pydantic_decorators__ + + def _prune_field_decorators(field_decorators: dict[str, Any]) -> dict[str, Any]: + return { + name: decorator + for name, decorator in field_decorators.items() + if all(field not in readonly_fields for field in decorator.info.fields) + } + + decorators.field_validators = _prune_field_decorators(decorators.field_validators) + decorators.field_serializers = _prune_field_decorators(decorators.field_serializers) + + return InputModel + + @classproperty + def InputModel(cls) -> Type[Model]: # noqa: N802, N805 + """Return the input version of the model class for this entity. + + :return: The input model class, with read-only fields removed. + """ + return cls.Model.as_input_model() + @classmethod def model_to_orm_fields(cls) -> dict[str, FieldInfo]: return { @@ -229,29 +301,53 @@ def model_to_orm_field_values(cls, model: Model) -> dict[str, Any]: return fields - def _to_model(self, repository_path: pathlib.Path) -> Model: - """Return the entity instance as an instance of its model.""" + def to_model(self, repository_path: Optional[pathlib.Path] = None, unstored: bool = False) -> Model: + """Return the entity instance as an instance of its model. + + :param repository_path: If the orm node has files in the repository, this path is used to read the repository + files from. If no path is specified a temporary path is created using the entities pk. + :param unstored: If True, the input version of the model is used, which strips read-only fields, i.e., fields + with `exclude_to_orm=True`. + :return: An instance of the entity's model class. + """ fields = {} - for key, field in self.Model.model_fields.items(): + Model = self.InputModel if unstored else self.Model # noqa: N806 + + for key, field in Model.model_fields.items(): if orm_to_model := get_metadata(field, 'orm_to_model'): fields[key] = orm_to_model(self, repository_path) else: fields[key] = getattr(self, key) - return self.Model(**fields) + return Model(**fields) @classmethod - def _from_model(cls, model: Model) -> 'Entity': - """Return an entity instance from an instance of its model.""" + def from_model(cls, model: Model) -> 'Entity': + """Return an entity instance from an instance of its model. + + :param model: An instance of the entity's model class. + :return: An instance of the entity class. + """ fields = cls.model_to_orm_field_values(model) return cls(**fields) - def serialize(self, repository_path: Union[pathlib.Path, None] = None) -> dict[str, Any]: + def serialize( + self, + repository_path: Optional[pathlib.Path] = None, + mode: Literal['json', 'python'] = 'json', + unstored: bool = False, + ) -> dict[str, Any]: """Serialize the entity instance to JSON. - :param repository_path: If the orm node has files in the repository, this path is used to dump the repostiory + :param repository_path: If the orm node has files in the repository, this path is used to dump the repository files to. If no path is specified a temporary path is created using the entities pk. + :param mode: The serialization mode, either 'json' or 'python'. The 'json' mode is the most strict and ensures + that the output is JSON serializable, whereas the 'python' mode allows for more complex Python types, such + as `datetime` objects. + :param unstored: If True, the input version of the model is used, which strips read-only fields, i.e., fields + with `exclude_to_orm=True`. + :return: A dictionary that can be serialized to JSON. """ self.logger.warning( 'Serialization through pydantic is still an experimental feature and might break in future releases.' @@ -266,15 +362,21 @@ def serialize(self, repository_path: Union[pathlib.Path, None] = None) -> dict[s raise ValueError(f'The repository_path `{repository_path}` does not exist.') if not repository_path.is_dir(): raise ValueError(f'The repository_path `{repository_path}` is not a directory.') - return self._to_model(repository_path).model_dump() + return self.to_model(repository_path, unstored=unstored).model_dump(mode=mode) @classmethod - def from_serialized(cls, **kwargs: dict[str, Any]) -> 'Entity': - """Construct an entity instance from JSON serialized data.""" + def from_serialized(cls, unstored: bool = False, **kwargs: dict[str, Any]) -> 'Entity': + """Construct an entity instance from JSON serialized data. + + :param unstored: If True, the input version of the model is used, which strips read-only fields, i.e., fields + with `exclude_to_orm=True`. + :return: An instance of the entity class. + """ cls._logger.warning( 'Serialization through pydantic is still an experimental feature and might break in future releases.' ) - return cls._from_model(cls.Model(**kwargs)) # type: ignore[arg-type] + Model = cls.InputModel if unstored else cls.Model # noqa: N806 + return cls.from_model(Model(**kwargs)) # type: ignore[arg-type] @classproperty def objects(cls: EntityType) -> CollectionType: # noqa: N805 diff --git a/src/aiida/orm/fields.py b/src/aiida/orm/fields.py index f0e8ca390b..60c6b9aab2 100644 --- a/src/aiida/orm/fields.py +++ b/src/aiida/orm/fields.py @@ -354,6 +354,10 @@ class QbFields: def __init__(self, fields: t.Optional[t.Dict[str, QbField]] = None): self._fields = fields or {} + def keys(self) -> list[str]: + """Return the field keys, prefixed with 'attribute.' if field is an attribute.""" + return [field.backend_key for field in self._fields.values()] + def __repr__(self) -> str: return pformat({key: str(value) for key, value in self._fields.items()}) @@ -464,7 +468,7 @@ def __init__(cls, name, bases, classdict): for key, field in cls.Model.model_fields.items(): fields[key] = add_field( key, - alias=get_metadata(field, 'alias', None), + alias=field.alias, dtype=field.annotation, doc=field.description, is_attribute=get_metadata(field, 'is_attribute', False), diff --git a/src/aiida/orm/groups.py b/src/aiida/orm/groups.py index 574f15b958..a29c925fde 100644 --- a/src/aiida/orm/groups.py +++ b/src/aiida/orm/groups.py @@ -6,13 +6,14 @@ # For further information on the license, see the LICENSE.txt file # # For further information please visit http://www.aiida.net # ########################################################################### -"""AiiDA Group entites""" +"""AiiDA Group entities""" import datetime import warnings from functools import cached_property from pathlib import Path from typing import TYPE_CHECKING, Any, ClassVar, Dict, Optional, Sequence, Tuple, Type, TypeVar, Union, cast +from uuid import UUID from aiida.common import exceptions from aiida.common.lang import classproperty, type_check @@ -111,24 +112,43 @@ class Group(entities.Entity['BackendGroup', GroupCollection]): __type_string: ClassVar[Optional[str]] class Model(entities.Entity.Model): - uuid: str = MetadataField(description='The UUID of the group', is_attribute=False, exclude_to_orm=True) - type_string: str = MetadataField(description='The type of the group', is_attribute=False, exclude_to_orm=True) + uuid: UUID = MetadataField( + description='The UUID of the group', + is_attribute=False, + exclude_to_orm=True, + ) + type_string: str = MetadataField( + description='The type of the group', + is_attribute=False, + exclude_to_orm=True, + ) user: int = MetadataField( - description='The group owner', + description='The PK of the group owner', is_attribute=False, orm_class='core.user', - orm_to_model=lambda group, _: group.user.pk, # type: ignore[attr-defined] + orm_to_model=lambda group, _: cast('Group', group).user.pk, + exclude_to_orm=True, ) - time: Optional[datetime.datetime] = MetadataField( - description='The creation time of the node', is_attribute=False + time: datetime.datetime = MetadataField( + description='The creation time of the node, defaults to now (timezone-aware)', + is_attribute=False, + exclude_to_orm=True, + ) + label: str = MetadataField( + description='The group label', + is_attribute=False, + ) + description: str = MetadataField( + '', + description='The group description', + is_attribute=False, ) - label: str = MetadataField(description='The group label', is_attribute=False) - description: Optional[str] = MetadataField(description='The group description', is_attribute=False) - extras: Optional[Dict[str, Any]] = MetadataField( + extras: Dict[str, Any] = MetadataField( + default_factory=dict, description='The group extras', is_attribute=False, is_subscriptable=True, - orm_to_model=lambda group, _: group.base.extras.all, # type: ignore[attr-defined] + orm_to_model=lambda group, _: cast('Group', group).base.extras.all, ) _CLS_COLLECTION = GroupCollection diff --git a/src/aiida/orm/logs.py b/src/aiida/orm/logs.py index ed07deb847..981642c1f4 100644 --- a/src/aiida/orm/logs.py +++ b/src/aiida/orm/logs.py @@ -11,6 +11,7 @@ import logging from datetime import datetime from typing import TYPE_CHECKING, Any, Dict, List, Optional, Type +from uuid import UUID from aiida.common import timezone from aiida.common.pydantic import MetadataField @@ -130,13 +131,36 @@ class Log(entities.Entity['BackendLog', LogCollection]): _CLS_COLLECTION = LogCollection class Model(entities.Entity.Model): - uuid: str = MetadataField(description='The UUID of the node', is_attribute=False, exclude_to_orm=True) - loggername: str = MetadataField(description='The name of the logger', is_attribute=False) - levelname: str = MetadataField(description='The name of the log level', is_attribute=False) - message: str = MetadataField(description='The message of the log', is_attribute=False) - time: datetime = MetadataField(description='The time at which the log was created', is_attribute=False) - metadata: Dict[str, Any] = MetadataField(description='The metadata of the log', is_attribute=False) - dbnode_id: int = MetadataField(description='Associated node', is_attribute=False) + uuid: UUID = MetadataField( + description='The UUID of the node', + is_attribute=False, + exclude_to_orm=True, + ) + loggername: str = MetadataField( + description='The name of the logger', + is_attribute=False, + ) + levelname: str = MetadataField( + description='The name of the log level', + is_attribute=False, + ) + message: str = MetadataField( + description='The message of the log', + is_attribute=False, + ) + time: datetime = MetadataField( + description='The time at which the log was created', + is_attribute=False, + ) + metadata: Dict[str, Any] = MetadataField( + default_factory=dict, + description='The metadata of the log', + is_attribute=False, + ) + dbnode_id: int = MetadataField( + description='Associated node', + is_attribute=False, + ) def __init__( self, diff --git a/src/aiida/orm/nodes/data/array/array.py b/src/aiida/orm/nodes/data/array/array.py index 9118187b0c..4489b9b69d 100644 --- a/src/aiida/orm/nodes/data/array/array.py +++ b/src/aiida/orm/nodes/data/array/array.py @@ -12,10 +12,11 @@ import base64 import io +from collections.abc import Iterable from typing import Any, Iterator, Optional import numpy as np -from pydantic import ConfigDict +from pydantic import ConfigDict, field_serializer, field_validator from aiida.common.pydantic import MetadataField @@ -49,13 +50,23 @@ class ArrayData(Data): class Model(Data.Model): model_config = ConfigDict(arbitrary_types_allowed=True) - arrays: Optional[dict[str, bytes]] = MetadataField( + + arrays: Optional[dict[str, np.ndarray]] = MetadataField( None, - description='The dictionary of numpy arrays.', - orm_to_model=lambda node, _: ArrayData.save_arrays(node.arrays), # type: ignore[attr-defined] - model_to_orm=lambda model: ArrayData.load_arrays(model.arrays), # type: ignore[attr-defined] + description='The dictionary of numpy arrays', ) + @field_validator('arrays', mode='before') + @classmethod + def validate_arrays(cls, value: dict[str, Iterable] | None) -> dict[str, np.ndarray] | None: + if value is None: + return value + return {k: np.array(v) for k, v in value.items()} + + @field_serializer('arrays', when_used='json-unless-none') + def serialize_arrays(self, value: dict[str, np.ndarray]) -> dict[str, list]: + return {k: v.tolist() for k, v in value.items()} + array_prefix = 'array|' default_array_name = 'default' diff --git a/src/aiida/orm/nodes/data/array/bands.py b/src/aiida/orm/nodes/data/array/bands.py index 49a109dcb0..703a16b2bd 100644 --- a/src/aiida/orm/nodes/data/array/bands.py +++ b/src/aiida/orm/nodes/data/array/bands.py @@ -10,6 +10,8 @@ in a Brillouin zone, and how to operate on them. """ +from __future__ import annotations + import json import typing as t from string import Template @@ -214,8 +216,25 @@ class BandsData(KpointsData): """Class to handle bands data""" class Model(KpointsData.Model): - array_labels: t.Optional[t.List[str]] = MetadataField(description='Labels associated with the band arrays') - units: str = MetadataField(description='Units in which the data in bands were stored') + array_labels: t.Optional[t.List[str]] = MetadataField( + None, + description='Labels associated with the band arrays', + ) + units: t.Optional[str] = MetadataField( + None, + description='Units in which the data in bands were stored', + orm_to_model=lambda node, _: t.cast('BandsData', node).base.attributes.get('units', None), + ) + + def __init__( + self, + *, + array_labels: list[str] | None = None, + units: str | None = None, + **kwargs, + ): + super().__init__(**kwargs) + self.units = units def set_kpointsdata(self, kpointsdata): """Load the kpoints from a kpoint object. diff --git a/src/aiida/orm/nodes/data/array/kpoints.py b/src/aiida/orm/nodes/data/array/kpoints.py index e7958970a4..a10373e935 100644 --- a/src/aiida/orm/nodes/data/array/kpoints.py +++ b/src/aiida/orm/nodes/data/array/kpoints.py @@ -11,6 +11,8 @@ periodic crystal structure). """ +from __future__ import annotations + import typing as t import numpy @@ -39,14 +41,99 @@ class KpointsData(ArrayData): """ class Model(ArrayData.Model): - labels: t.List[str] = MetadataField(description='Labels associated with the list of kpoints') - label_numbers: t.List[int] = MetadataField(description='Index of the labels in the list of kpoints') - mesh: t.List[int] = MetadataField(description='Mesh of kpoints') - offset: t.List[float] = MetadataField(description='Offset of kpoints') - cell: t.List[t.List[float]] = MetadataField(description='Unit cell of the crystal, in Angstroms') - pbc1: bool = MetadataField(description='True if the first lattice vector is periodic') - pbc2: bool = MetadataField(description='True if the second lattice vector is periodic') - pbc3: bool = MetadataField(description='True if the third lattice vector is periodic') + labels: t.Optional[t.List[str]] = MetadataField( + None, + description='Labels associated with the list of kpoints', + orm_to_model=lambda node, _: t.cast('KpointsData', node).base.attributes.get('labels', None), + ) + label_numbers: t.Optional[t.List[int]] = MetadataField( + None, + description='Index of the labels in the list of kpoints', + orm_to_model=lambda node, _: t.cast('KpointsData', node).base.attributes.get('label_numbers', None), + ) + cell: t.Optional[t.List[t.List[float]]] = MetadataField( + None, + description='Unit cell of the crystal, in Angstroms', + orm_to_model=lambda node, _: t.cast('KpointsData', node).base.attributes.get('cell', None), + ) + pbc1: t.Optional[bool] = MetadataField( + None, + description='Periodicity in the first lattice vector direction', + orm_to_model=lambda node, _: t.cast('KpointsData', node).pbc[0], + ) + pbc2: t.Optional[bool] = MetadataField( + None, + description='Periodicity in the second lattice vector direction', + orm_to_model=lambda node, _: t.cast('KpointsData', node).pbc[1], + ) + pbc3: t.Optional[bool] = MetadataField( + None, + description='Periodicity in the third lattice vector direction', + orm_to_model=lambda node, _: t.cast('KpointsData', node).pbc[2], + ) + mesh: t.Optional[t.List[int]] = MetadataField( + None, + description='Mesh of kpoints', + orm_to_model=lambda node, _: t.cast('KpointsData', node).base.attributes.get('mesh', None), + ) + offset: t.Optional[t.List[float]] = MetadataField( + None, + description='Offset of kpoints', + orm_to_model=lambda node, _: t.cast('KpointsData', node).base.attributes.get('offset', None), + ) + + def __init__( + self, + *, + labels: list[str] | None = None, + label_numbers: list[int] | None = None, + cell: list[list[float]] | None = None, + pbc1: bool | None = None, + pbc2: bool | None = None, + pbc3: bool | None = None, + mesh: list[int] | None = None, + offset: list[float] | None = None, + **kwargs, + ): + arrays = kwargs.pop('arrays', None) + + super().__init__(**kwargs) + + if offset is not None and mesh is None: + raise ValueError('Cannot set an offset without a kpoints mesh') + + given_list_kwargs = any(kwarg is not None for kwarg in (labels, label_numbers, cell, pbc1, pbc2, pbc3)) + + if mesh is not None: + if arrays is not None or given_list_kwargs: + raise ValueError('When providing a kpoints mesh, only mesh and offset are allowed') + self.set_kpoints_mesh(mesh, offset=offset) + + if arrays is not None: + if labels is not None and label_numbers is not None: + if len(labels) != len(label_numbers): + raise ValueError('Labels and label numbers must have the same length') + label_list = list(zip(label_numbers, labels)) + else: + label_list = None + + pbc = (pbc1 or False, pbc2 or False, pbc3 or False) + + if cell is not None: + self.set_cell(cell, pbc) + else: + self.pbc = pbc + + if isinstance(arrays, dict): + kpoints = arrays.get('kpoints', None) + if kpoints is None: + raise ValueError("When providing a dict of arrays, it must contain the key 'kpoints'") + arrays = kpoints + + self.set_kpoints(arrays, labels=label_list) + + elif given_list_kwargs: + raise ValueError('Missing kpoints list') def get_description(self): """Returns a string with infos retrieved from kpoints node's properties. @@ -99,8 +186,11 @@ def pbc(self): :return: a tuple of three booleans, each one tells if there are periodic boundary conditions for the i-th real-space direction (i=1,2,3) """ - # return copy.deepcopy(self._pbc) - return (self.base.attributes.get('pbc1'), self.base.attributes.get('pbc2'), self.base.attributes.get('pbc3')) + return ( + self.base.attributes.get('pbc1', False), + self.base.attributes.get('pbc2', False), + self.base.attributes.get('pbc3', False), + ) @pbc.setter def pbc(self, value): @@ -333,12 +423,8 @@ def _dimension(self): """Dimensionality of the structure, found from its pbc (i.e. 1 if it's a 1D structure, 2 if its 2D, 3 if it's 3D ...). :return dimensionality: 0, 1, 2 or 3 - :note: will return 3 if pbc has not been set beforehand """ - try: - return sum(self.pbc) - except AttributeError: - return 3 + return sum(self.pbc) def _validate_kpoints_weights(self, kpoints, weights): """Validate the list of kpoints and of weights before storage. diff --git a/src/aiida/orm/nodes/data/array/trajectory.py b/src/aiida/orm/nodes/data/array/trajectory.py index 3d6356ebd2..ba1de93136 100644 --- a/src/aiida/orm/nodes/data/array/trajectory.py +++ b/src/aiida/orm/nodes/data/array/trajectory.py @@ -8,13 +8,20 @@ ########################################################################### """AiiDA class to deal with crystal structure trajectories.""" +from __future__ import annotations + import collections.abc -from typing import List +from typing import TYPE_CHECKING, List, Optional + +import numpy as np from aiida.common.pydantic import MetadataField from .array import ArrayData +if TYPE_CHECKING: + from aiida import orm + __all__ = ('TrajectoryData',) @@ -24,14 +31,41 @@ class TrajectoryData(ArrayData): """ class Model(ArrayData.Model): - units_positions: str = MetadataField(alias='units|positions', description='Unit of positions') - units_times: str = MetadataField(alias='units|times', description='Unit of time') + units_positions: Optional[str] = MetadataField( + None, + serialization_alias='units|positions', + description='Unit of positions', + ) + units_times: Optional[str] = MetadataField( + None, + serialization_alias='units|times', + description='Unit of time', + ) symbols: List[str] = MetadataField(description='List of symbols') - def __init__(self, structurelist=None, **kwargs): + def __init__( + self, + structurelist: list[orm.StructureData] | None = None, + units_positions: str | None = None, + units_times: str | None = None, + symbols: list[str] | None = None, + arrays: np.ndarray | dict[str, np.ndarray] | None = None, + **kwargs, + ): super().__init__(**kwargs) + self.unit_positions = units_positions + self.unit_times = units_times if structurelist is not None: self.set_structurelist(structurelist) + elif arrays is not None: + self.set_trajectory( + symbols=symbols, + positions=arrays['positions'], + stepids=arrays.get('steps'), + cells=arrays.get('cells'), + times=arrays.get('times'), + velocities=arrays.get('velocities'), + ) def _internal_validate(self, stepids, cells, symbols, positions, times, velocities): """Internal function to validate the type and shape of the arrays. See @@ -256,6 +290,26 @@ def get_cells(self): except (AttributeError, KeyError): return None + @property + def units_positions(self) -> str | None: + """Units for the positions array.""" + return self.base.attributes.get('units|positions', None) + + @units_positions.setter + def units_positions(self, units: str) -> None: + """Set units for the positions array.""" + self.base.attributes.set('units|positions', units) + + @property + def units_times(self) -> str | None: + """Units for the times array.""" + return self.base.attributes.get('units|times', None) + + @units_times.setter + def units_times(self, units: str) -> None: + """Set units for the times array.""" + self.base.attributes.set('units|times', units) + @property def symbols(self) -> List[str]: """Return the array of symbols, if it has already been set. diff --git a/src/aiida/orm/nodes/data/base.py b/src/aiida/orm/nodes/data/base.py index adc0f3a98e..f697b51c93 100644 --- a/src/aiida/orm/nodes/data/base.py +++ b/src/aiida/orm/nodes/data/base.py @@ -30,7 +30,7 @@ class BaseType(Data): class Model(Data.Model): value: t.Any = MetadataField( ..., - title='Data value.', + title='Data value', description='The value of the data', ) diff --git a/src/aiida/orm/nodes/data/bool.py b/src/aiida/orm/nodes/data/bool.py index 61c8e61d5e..e669b9a722 100644 --- a/src/aiida/orm/nodes/data/bool.py +++ b/src/aiida/orm/nodes/data/bool.py @@ -10,7 +10,10 @@ import numpy +from aiida.common.pydantic import MetadataField + from .base import BaseType, to_aiida_type +from .numeric import NumericType __all__ = ('Bool',) @@ -20,6 +23,12 @@ class Bool(BaseType): _type = bool + class Model(NumericType.Model): + value: bool = MetadataField( + title='Boolean value', + description='The value of the boolean', + ) + def __int__(self): return int(bool(self)) diff --git a/src/aiida/orm/nodes/data/cif.py b/src/aiida/orm/nodes/data/cif.py index 8421a617eb..12170dbbdc 100644 --- a/src/aiida/orm/nodes/data/cif.py +++ b/src/aiida/orm/nodes/data/cif.py @@ -9,7 +9,7 @@ """Tools for handling Crystallographic Information Files (CIF)""" import re -import typing as t +from typing import List, Optional from aiida.common.pydantic import MetadataField from aiida.common.utils import Capturing @@ -251,14 +251,20 @@ class CifData(SinglefileData): _ase = None class Model(SinglefileData.Model): - formulae: t.Optional[t.List[str]] = MetadataField( - None, description='List of formulae contained in the CIF file.', exclude_to_orm=True + formulae: Optional[List[str]] = MetadataField( + None, + description='List of formulae contained in the CIF file.', + exclude_to_orm=True, ) - spacegroup_numbers: t.Optional[t.List[str]] = MetadataField( - None, description='List of space group numbers of the structure.', exclude_to_orm=True + spacegroup_numbers: Optional[List[str]] = MetadataField( + None, + description='List of space group numbers of the structure.', + exclude_to_orm=True, ) - md5: t.Optional[str] = MetadataField( - None, description='MD5 checksum of the file contents.', exclude_to_orm=True + md5: Optional[str] = MetadataField( + None, + description='MD5 checksum of the file contents.', + exclude_to_orm=True, ) def __init__(self, ase=None, file=None, filename=None, values=None, scan_type=None, parse_policy=None, **kwargs): diff --git a/src/aiida/orm/nodes/data/code/installed.py b/src/aiida/orm/nodes/data/code/installed.py index 3401f43ed2..b46a94cfed 100644 --- a/src/aiida/orm/nodes/data/code/installed.py +++ b/src/aiida/orm/nodes/data/code/installed.py @@ -19,8 +19,6 @@ import pathlib from typing import cast -from pydantic import field_serializer, field_validator - from aiida.common import exceptions from aiida.common.lang import type_check from aiida.common.log import override_log_level @@ -44,16 +42,16 @@ class InstalledCode(Code): class Model(AbstractCode.Model): """Model describing required information to create an instance.""" - computer: str = MetadataField( # type: ignore[assignment] - ..., + computer: str = MetadataField( title='Computer', - description='The remote computer on which the executable resides.', + description='The label of the remote computer on which the executable resides.', + is_attribute=False, orm_to_model=lambda node, _: cast('InstalledCode', node).computer.label, + model_to_orm=lambda model: cast('InstalledCode.Model', model).load_computer(), short_name='-Y', priority=2, ) filepath_executable: str = MetadataField( - ..., title='Filepath executable', description='Filepath of the executable on the remote computer.', orm_to_model=lambda node, _: str(cast('InstalledCode', node).filepath_executable), @@ -61,21 +59,19 @@ class Model(AbstractCode.Model): priority=1, ) - @field_validator('computer') - @classmethod - def validate_computer(cls, value: str) -> Computer: - """Override the validator for the ``label`` of the base class since uniqueness is defined on full label.""" + def load_computer(self) -> Computer: + """Load the computer instance. + + :return: The computer instance. + :raises ValueError: If the computer does not exist. + """ from aiida.orm import load_computer try: - return load_computer(value) + return load_computer(self.computer) except exceptions.NotExistent as exception: raise ValueError(exception) from exception - @field_serializer('computer') - def serialize_computer(self, computer: Computer, _info): - return computer.label - def __init__(self, computer: Computer, filepath_executable: str, **kwargs): """Construct a new instance. diff --git a/src/aiida/orm/nodes/data/code/portable.py b/src/aiida/orm/nodes/data/code/portable.py index bab715ab5a..872774c8f0 100644 --- a/src/aiida/orm/nodes/data/code/portable.py +++ b/src/aiida/orm/nodes/data/code/portable.py @@ -36,7 +36,7 @@ _LOGGER = logging.getLogger(__name__) -def _export_filpath_files_from_repo(portable_code: PortableCode, repository_path: pathlib.Path) -> str: +def _export_filepath_files_from_repo(portable_code: PortableCode, repository_path: pathlib.Path) -> str: for root, _, filenames in portable_code.base.repository.walk(): for filename in filenames: rel_path = str(root / filename) @@ -72,7 +72,7 @@ class Model(AbstractCode.Model): short_name='-F', is_attribute=False, priority=2, - orm_to_model=_export_filpath_files_from_repo, # type: ignore[arg-type] + orm_to_model=_export_filepath_files_from_repo, # type: ignore[arg-type] ) def __init__( @@ -197,6 +197,6 @@ def _prepare_yaml(self, *args, **kwargs): """Export code to a YAML file.""" result = super()._prepare_yaml(*args, **kwargs)[0] target = pathlib.Path().cwd() / f'{self.label}' - _export_filpath_files_from_repo(self, target) + _export_filepath_files_from_repo(self, target) _LOGGER.info(f'Repository files for PortableCode <{self.pk}> dumped to folder `{target}`.') return result, {} diff --git a/src/aiida/orm/nodes/data/data.py b/src/aiida/orm/nodes/data/data.py index 56b3dcbdbb..e98ead5d26 100644 --- a/src/aiida/orm/nodes/data/data.py +++ b/src/aiida/orm/nodes/data/data.py @@ -8,6 +8,7 @@ ########################################################################### """Module with `Node` sub class `Data` to be used as a base class for data structures.""" +from collections.abc import Iterable from typing import Dict, Optional from aiida.common import exceptions @@ -21,6 +22,19 @@ __all__ = ('Data',) +class UnhandledDataAttributesError(Exception): + """Exception raised when any data attributes are not handled prior to the Data constructor.""" + + def __init__(self, attributes: Iterable[str], class_name: str) -> None: + bullet_list = '\n'.join(f' • {attr}' for attr in attributes) + message = ( + f'\nThe following attributes must be handled in a constructor prior to the Data class:\n' + f'{bullet_list}\n\n' + f'Consider implementing a constructor in {class_name} to handle the listed attributes.' + ) + super().__init__(message) + + class Data(Node): """The base class for all Data nodes. @@ -48,12 +62,25 @@ class Data(Node): class Model(Node.Model): source: Optional[dict] = MetadataField( - None, description='Source of the data.', is_subscriptable=True, exclude_from_cli=True + None, + description='Source of the data.', + is_subscriptable=True, + exclude_to_orm=True, + exclude_from_cli=True, ) def __init__(self, *args, source=None, **kwargs): """Construct a new instance, setting the ``source`` attribute if provided as a keyword argument.""" + + # We verify here that all attributes of Data plugins are handled in a constructor prior to the root + # Data class (here), gracefully rejecting them otherwise. + node_keys = set(Node.Model.model_fields.keys()) | {'backend'} + unhandled_keys = {key for key in kwargs if key not in node_keys} + if unhandled_keys: + raise UnhandledDataAttributesError(unhandled_keys, self.__class__.__name__) + super().__init__(*args, **kwargs) + if source is not None: self.source = source diff --git a/src/aiida/orm/nodes/data/float.py b/src/aiida/orm/nodes/data/float.py index 88e535e067..a5453b0725 100644 --- a/src/aiida/orm/nodes/data/float.py +++ b/src/aiida/orm/nodes/data/float.py @@ -10,6 +10,8 @@ import numbers +from aiida.common.pydantic import MetadataField + from .base import to_aiida_type from .numeric import NumericType @@ -21,6 +23,12 @@ class Float(NumericType): _type = float + class Model(NumericType.Model): + value: float = MetadataField( + title='Float value', + description='The value of the float', + ) + @to_aiida_type.register(numbers.Real) def _(value): diff --git a/src/aiida/orm/nodes/data/int.py b/src/aiida/orm/nodes/data/int.py index 43ffa918c3..fbd8dc9918 100644 --- a/src/aiida/orm/nodes/data/int.py +++ b/src/aiida/orm/nodes/data/int.py @@ -10,6 +10,8 @@ import numbers +from aiida.common.pydantic import MetadataField + from .base import to_aiida_type from .numeric import NumericType @@ -21,6 +23,12 @@ class Int(NumericType): _type = int + class Model(NumericType.Model): + value: int = MetadataField( + title='Integer value', + description='The value of the integer', + ) + @to_aiida_type.register(numbers.Integral) def _(value): diff --git a/src/aiida/orm/nodes/data/remote/base.py b/src/aiida/orm/nodes/data/remote/base.py index 8bae0fed02..a926b1f056 100644 --- a/src/aiida/orm/nodes/data/remote/base.py +++ b/src/aiida/orm/nodes/data/remote/base.py @@ -13,7 +13,7 @@ import logging import os from pathlib import Path -from typing import Union +from typing import Optional from aiida.common.pydantic import MetadataField from aiida.orm import AuthInfo @@ -35,13 +35,14 @@ class RemoteData(Data): KEY_EXTRA_CLEANED = 'cleaned' class Model(Data.Model): - remote_path: Union[str, None] = MetadataField( + remote_path: Optional[str] = MetadataField( + None, title='Remote path', description='Filepath on the remote computer.', orm_to_model=lambda node, _: node.get_remote_path(), ) - def __init__(self, remote_path: Union[str, None] = None, **kwargs): + def __init__(self, remote_path: Optional[str] = None, **kwargs): super().__init__(**kwargs) if remote_path is not None: self.set_remote_path(remote_path) diff --git a/src/aiida/orm/nodes/data/singlefile.py b/src/aiida/orm/nodes/data/singlefile.py index 742a5702c6..102197c8d0 100644 --- a/src/aiida/orm/nodes/data/singlefile.py +++ b/src/aiida/orm/nodes/data/singlefile.py @@ -10,12 +10,15 @@ from __future__ import annotations +import base64 import contextlib import io import os import pathlib import typing as t +from pydantic import field_serializer, field_validator + from aiida.common import exceptions from aiida.common.pydantic import MetadataField from aiida.common.typing import FilePath @@ -33,9 +36,28 @@ class SinglefileData(Data): class Model(Data.Model): content: bytes = MetadataField( description='The file content.', - model_to_orm=lambda model: io.BytesIO(model.content), # type: ignore[attr-defined] + model_to_orm=lambda model: io.BytesIO(t.cast('SinglefileData', model).content), + ) + filename: str = MetadataField( + 'file.txt', + description='The name of the stored file.', ) - filename: t.Optional[str] = MetadataField(None, description='The filename. Defaults to `file.txt`.') + + @field_validator('content') + @classmethod + def _decode_content(cls, value: str | bytes) -> bytes: + """Decode base64 content if needed.""" + if isinstance(value, str): + try: + return base64.b64decode(value, validate=True) + except Exception as exc: + raise ValueError('if `content` is a string, it must be valid base64-encoded data') from exc + return value + + @field_serializer('content') + def _encode_content(self, value: bytes) -> str: + """Encode content as base64 string for serialization.""" + return base64.b64encode(value).decode() @classmethod def from_string(cls, content: str, filename: str | pathlib.Path | None = None, **kwargs: t.Any) -> 'SinglefileData': diff --git a/src/aiida/orm/nodes/data/str.py b/src/aiida/orm/nodes/data/str.py index 66b631ef7c..927b2d4168 100644 --- a/src/aiida/orm/nodes/data/str.py +++ b/src/aiida/orm/nodes/data/str.py @@ -8,7 +8,10 @@ ########################################################################### """`Data` sub class to represent a string value.""" +from aiida.common.pydantic import MetadataField + from .base import BaseType, to_aiida_type +from .numeric import NumericType __all__ = ('Str',) @@ -18,6 +21,12 @@ class Str(BaseType): _type = str + class Model(NumericType.Model): + value: str = MetadataField( + title='String value', + description='The value of the string', + ) + @to_aiida_type.register(str) def _(value): diff --git a/src/aiida/orm/nodes/data/structure.py b/src/aiida/orm/nodes/data/structure.py index 0e0d7e49db..c627dfb2d2 100644 --- a/src/aiida/orm/nodes/data/structure.py +++ b/src/aiida/orm/nodes/data/structure.py @@ -10,12 +10,16 @@ functions to operate on them. """ +from __future__ import annotations + import copy import functools import itertools import json import typing as t +from pydantic import field_validator + from aiida.common.constants import elements from aiida.common.exceptions import UnsupportedSpeciesError from aiida.common.pydantic import MetadataField @@ -701,8 +705,18 @@ class Model(Data.Model): pbc2: bool = MetadataField(description='Whether periodic in the b direction') pbc3: bool = MetadataField(description='Whether periodic in the c direction') cell: t.List[t.List[float]] = MetadataField(description='The cell parameters') - kinds: t.Optional[t.List[dict]] = MetadataField(description='The kinds of atoms') - sites: t.Optional[t.List[dict]] = MetadataField(description='The atomic sites') + kinds: t.List[dict] = MetadataField(description='The kinds of atoms') + sites: t.List[dict] = MetadataField(description='The atomic sites') + + @field_validator('kinds', mode='before') + @classmethod + def _validate_kinds(cls, value: t.List[Kind | dict[str, t.Any]]) -> t.List[t.Dict]: + return [kind.get_raw() if isinstance(kind, Kind) else kind for kind in value] + + @field_validator('sites', mode='before') + @classmethod + def _validate_sites(cls, value: t.List[Site | dict[str, t.Any]]) -> t.List[t.Dict]: + return [site.get_raw() if isinstance(site, Site) else site for site in value] def __init__( self, diff --git a/src/aiida/orm/nodes/node.py b/src/aiida/orm/nodes/node.py index b9681111ce..a1c21ad6ef 100644 --- a/src/aiida/orm/nodes/node.py +++ b/src/aiida/orm/nodes/node.py @@ -13,7 +13,7 @@ import base64 import datetime from functools import cached_property -from typing import TYPE_CHECKING, Any, ClassVar, Dict, Generic, Iterator, List, Optional, Tuple, Type, TypeVar +from typing import TYPE_CHECKING, Any, ClassVar, Dict, Generic, Iterator, List, Optional, Tuple, Type, TypeVar, cast from uuid import UUID from aiida.common import exceptions @@ -194,11 +194,17 @@ def _query_type_string(cls) -> str: # noqa: N805 _unstorable_message = 'only Data, WorkflowNode, CalculationNode or their subclasses can be stored' class Model(Entity.Model): - uuid: Optional[str] = MetadataField( - None, description='The UUID of the node', is_attribute=False, exclude_to_orm=True, exclude_from_cli=True + uuid: UUID = MetadataField( + description='The UUID of the node', + is_attribute=False, + exclude_to_orm=True, + exclude_from_cli=True, ) - node_type: Optional[str] = MetadataField( - None, description='The type of the node', is_attribute=False, exclude_to_orm=True, exclude_from_cli=True + node_type: str = MetadataField( + description='The type of the node', + is_attribute=False, + exclude_to_orm=True, + exclude_from_cli=True, ) process_type: Optional[str] = MetadataField( None, @@ -207,81 +213,95 @@ class Model(Entity.Model): exclude_to_orm=True, exclude_from_cli=True, ) - repository_metadata: Optional[Dict[str, Any]] = MetadataField( - None, + repository_metadata: Dict[str, Any] = MetadataField( + default_factory=dict, description='Virtual hierarchy of the file repository.', is_attribute=False, - orm_to_model=lambda node, _: node.base.repository.metadata, # type: ignore[attr-defined] + orm_to_model=lambda node, _: cast('Node', node).base.repository.metadata, exclude_to_orm=True, exclude_from_cli=True, ) - ctime: Optional[datetime.datetime] = MetadataField( - None, + ctime: datetime.datetime = MetadataField( description='The creation time of the node', is_attribute=False, exclude_to_orm=True, exclude_from_cli=True, ) - mtime: Optional[datetime.datetime] = MetadataField( - None, + mtime: datetime.datetime = MetadataField( description='The modification time of the node', is_attribute=False, exclude_to_orm=True, exclude_from_cli=True, ) - label: Optional[str] = MetadataField( - None, description='The node label', is_attribute=False, exclude_from_cli=True + label: str = MetadataField( + '', + description='The node label', + is_attribute=False, ) - description: Optional[str] = MetadataField( - None, description='The node description', is_attribute=False, exclude_from_cli=True + description: str = MetadataField( + '', + description='The node description', + is_attribute=False, ) - attributes: Optional[Dict[str, Any]] = MetadataField( - None, + attributes: Dict[str, Any] = MetadataField( + default_factory=dict, description='The node attributes', is_attribute=False, - orm_to_model=lambda node, _: node.base.attributes.all, # type: ignore[attr-defined] + orm_to_model=lambda node, _: cast('Node', node).base.attributes.all, is_subscriptable=True, exclude_from_cli=True, - exclude_to_orm=True, ) - extras: Optional[Dict[str, Any]] = MetadataField( - None, + extras: Dict[str, Any] = MetadataField( + default_factory=dict, description='The node extras', is_attribute=False, - orm_to_model=lambda node, _: node.base.extras.all, # type: ignore[attr-defined] + orm_to_model=lambda node, _: cast('Node', node).base.extras.all, is_subscriptable=True, exclude_from_cli=True, - exclude_to_orm=True, ) - computer: Optional[int] = MetadataField( + computer: Optional[str] = MetadataField( None, - description='The PK of the computer', + description='The label of the computer', is_attribute=False, - orm_to_model=lambda node, _: node.computer.pk if node.computer else None, # type: ignore[attr-defined] - orm_class=Computer, + orm_to_model=lambda node, _: cast('Node', node).computer.label if cast('Node', node).computer else None, # type: ignore[union-attr] + model_to_orm=lambda model: cast('Node.Model', model).load_computer(), exclude_from_cli=True, + exclude_to_orm=True, ) - user: Optional[int] = MetadataField( - None, + user: int = MetadataField( description='The PK of the user who owns the node', is_attribute=False, - orm_to_model=lambda node, _: node.user.pk, # type: ignore[attr-defined] + orm_to_model=lambda node, _: cast('Node', node).user.pk, orm_class=User, + exclude_to_orm=True, exclude_from_cli=True, ) - repository_content: Optional[dict[str, bytes]] = MetadataField( - None, + repository_content: dict[str, bytes] = MetadataField( + default_factory=dict, description='Dictionary of file repository content. Keys are relative filepaths and values are binary file ' 'contents encoded as base64.', is_attribute=False, orm_to_model=lambda node, _: { key: base64.encodebytes(content) - for key, content in node.base.repository.serialize_content().items() # type: ignore[attr-defined] + for key, content in cast('Node', node).base.repository.serialize_content().items() }, exclude_from_cli=True, exclude_to_orm=True, ) + def load_computer(self) -> Computer: + """Load the computer instance. + + :return: The computer instance. + :raises ValueError: If the computer does not exist. + """ + from aiida.orm import load_computer + + try: + return load_computer(self.computer) + except exceptions.NotExistent as exception: + raise ValueError(exception) from exception + def __init__( self, backend: Optional['StorageBackend'] = None, @@ -301,15 +321,21 @@ def __init__( if user is None: raise ValueError('the user cannot be None') + attributes = kwargs.pop('attributes', {}) + backend_entity = backend.nodes.create( node_type=self.class_node_type, user=user.backend_entity, computer=backend_computer, **kwargs ) super().__init__(backend_entity) + + if attributes: + self.base.attributes.set_many(attributes) + if extras is not None: self.base.extras.set_many(extras) @classmethod - def _from_model(cls, model: Model) -> 'Node': # type: ignore[override] + def from_model(cls, model: Model) -> 'Node': # type: ignore[override] """Return an entity instance from an instance of its model.""" fields = cls.model_to_orm_field_values(model) diff --git a/src/aiida/orm/nodes/process/calculation/calcjob.py b/src/aiida/orm/nodes/process/calculation/calcjob.py index a526fc3b9c..4c25f91423 100644 --- a/src/aiida/orm/nodes/process/calculation/calcjob.py +++ b/src/aiida/orm/nodes/process/calculation/calcjob.py @@ -8,8 +8,10 @@ ########################################################################### """Module with `Node` sub class for calculation job processes.""" +from __future__ import annotations + import datetime -from typing import TYPE_CHECKING, Any, AnyStr, Dict, List, Optional, Sequence, Tuple, Type, Union +from typing import TYPE_CHECKING, Any, AnyStr, Dict, List, Optional, Sequence, Tuple, Type, Union, cast from aiida.common import exceptions from aiida.common.datastructures import CalcJobState @@ -66,40 +68,54 @@ class CalcJobNode(CalculationNode): class Model(CalculationNode.Model): scheduler_state: Optional[str] = MetadataField( - description='The state of the scheduler', orm_to_model=lambda node, _: node.get_scheduler_state() + None, + description='The state of the scheduler', + orm_to_model=lambda node, _: cast(CalcJobNode, node).get_scheduler_state(), ) state: Optional[str] = MetadataField( - description='The active state of the calculation job', orm_to_model=lambda node, _: node.get_state() + None, + description='The active state of the calculation job', + orm_to_model=lambda node, _: cast(CalcJobNode, node).get_state(), ) remote_workdir: Optional[str] = MetadataField( + None, description='The path to the remote (on cluster) scratch folder', - orm_to_model=lambda node, _: node.get_remote_workdir(), + orm_to_model=lambda node, _: cast(CalcJobNode, node).get_remote_workdir(), ) job_id: Optional[str] = MetadataField( - description='The scheduler job id', orm_to_model=lambda node, _: node.get_job_id() + None, + description='The scheduler job id', + orm_to_model=lambda node, _: cast(CalcJobNode, node).get_job_id(), ) scheduler_lastchecktime: Optional[datetime.datetime] = MetadataField( + None, description='The last time the scheduler was checked, in isoformat', - orm_to_model=lambda node, _: node.get_scheduler_lastchecktime(), + orm_to_model=lambda node, _: cast(CalcJobNode, node).get_scheduler_lastchecktime(), ) last_job_info: Optional[dict] = MetadataField( + None, description='The last job info returned by the scheduler', - orm_to_model=lambda node, _: dict(node.get_last_job_info() or {}), + orm_to_model=lambda node, _: dict(cast(CalcJobNode, node).get_last_job_info() or {}), ) detailed_job_info: Optional[dict] = MetadataField( + None, description='The detailed job info returned by the scheduler', - orm_to_model=lambda node, _: node.get_detailed_job_info(), + orm_to_model=lambda node, _: cast(CalcJobNode, node).get_detailed_job_info(), ) - retrieve_list: Optional[List[str]] = MetadataField( + retrieve_list: Optional[Sequence[Union[str, Tuple[str, str, int]]]] = MetadataField( + None, description='The list of files to retrieve from the remote cluster', - orm_to_model=lambda node, _: node.get_retrieve_list(), + orm_to_model=lambda node, _: cast(CalcJobNode, node).get_retrieve_list(), ) - retrieve_temporary_list: Optional[List[str]] = MetadataField( + retrieve_temporary_list: Optional[Sequence[Union[str, Tuple[str, str, int]]]] = MetadataField( + None, description='The list of temporary files to retrieve from the remote cluster', - orm_to_model=lambda node, _: node.get_retrieve_temporary_list(), + orm_to_model=lambda node, _: cast(CalcJobNode, node).get_retrieve_temporary_list(), ) imported: Optional[bool] = MetadataField( - description='Whether the node has been migrated', orm_to_model=lambda node, _: node.is_imported + None, + description='Whether the node has been migrated', + orm_to_model=lambda node, _: cast(CalcJobNode, node).is_imported, ) # An optional entry point for a CalculationTools instance @@ -259,7 +275,7 @@ def get_remote_workdir(self) -> Optional[str]: return self.base.attributes.get(self.REMOTE_WORKDIR_KEY, None) @staticmethod - def _validate_retrieval_directive(directives: Sequence[Union[str, Tuple[str, str, str]]]) -> None: + def _validate_retrieval_directive(directives: Sequence[Union[str, Tuple[str, str, int]]]) -> None: """Validate a list or tuple of file retrieval directives. :param directives: a list or tuple of file retrieval directives @@ -286,7 +302,7 @@ def _validate_retrieval_directive(directives: Sequence[Union[str, Tuple[str, str if not isinstance(directive[2], (int, type(None))): raise ValueError('invalid directive, third element has to be an integer representing the depth') - def set_retrieve_list(self, retrieve_list: Sequence[Union[str, Tuple[str, str, str]]]) -> None: + def set_retrieve_list(self, retrieve_list: Sequence[Union[str, Tuple[str, str, int]]]) -> None: """Set the retrieve list. This list of directives will instruct the daemon what files to retrieve after the calculation has completed. @@ -297,14 +313,14 @@ def set_retrieve_list(self, retrieve_list: Sequence[Union[str, Tuple[str, str, s self._validate_retrieval_directive(retrieve_list) self.base.attributes.set(self.RETRIEVE_LIST_KEY, retrieve_list) - def get_retrieve_list(self) -> Optional[Sequence[Union[str, Tuple[str, str, str]]]]: + def get_retrieve_list(self) -> Optional[Sequence[Union[str, Tuple[str, str, int]]]]: """Return the list of files/directories to be retrieved on the cluster after the calculation has completed. :return: a list of file directives """ return self.base.attributes.get(self.RETRIEVE_LIST_KEY, None) - def set_retrieve_temporary_list(self, retrieve_temporary_list: Sequence[Union[str, Tuple[str, str, str]]]) -> None: + def set_retrieve_temporary_list(self, retrieve_temporary_list: Sequence[Union[str, Tuple[str, str, int]]]) -> None: """Set the retrieve temporary list. The retrieve temporary list stores files that are retrieved after completion and made available during parsing @@ -315,7 +331,7 @@ def set_retrieve_temporary_list(self, retrieve_temporary_list: Sequence[Union[st self._validate_retrieval_directive(retrieve_temporary_list) self.base.attributes.set(self.RETRIEVE_TEMPORARY_LIST_KEY, retrieve_temporary_list) - def get_retrieve_temporary_list(self) -> Optional[Sequence[Union[str, Tuple[str, str, str]]]]: + def get_retrieve_temporary_list(self) -> Optional[Sequence[Union[str, Tuple[str, str, int]]]]: """Return list of files to be retrieved from the cluster which will be available during parsing. :return: a list of file directives diff --git a/src/aiida/orm/nodes/process/process.py b/src/aiida/orm/nodes/process/process.py index 37369d14f6..26825048a8 100644 --- a/src/aiida/orm/nodes/process/process.py +++ b/src/aiida/orm/nodes/process/process.py @@ -189,13 +189,34 @@ def _updatable_attributes(cls) -> Tuple[str, ...]: # noqa: N805 ) class Model(Node.Model, Sealable.Model): - process_label: Optional[str] = MetadataField(description='The process label') - process_state: Optional[str] = MetadataField(description='The process state enum') - process_status: Optional[str] = MetadataField(description='The process status is a generic status message') - exit_status: Optional[int] = MetadataField(description='The process exit status') - exit_message: Optional[str] = MetadataField(description='The process exit message') - exception: Optional[str] = MetadataField(description='The process exception message') - paused: bool = MetadataField(description='Whether the process is paused') + process_label: Optional[str] = MetadataField( + None, + description='The process label', + ) + process_state: Optional[str] = MetadataField( + None, + description='The process state enum', + ) + process_status: Optional[str] = MetadataField( + None, + description='The process status is a generic status message', + ) + exit_status: Optional[int] = MetadataField( + None, + description='The process exit status', + ) + exit_message: Optional[str] = MetadataField( + None, + description='The process exit message', + ) + exception: Optional[str] = MetadataField( + None, + description='The process exception message', + ) + paused: Optional[bool] = MetadataField( + None, + description='Whether the process is paused', + ) def set_metadata_inputs(self, value: Dict[str, Any]) -> None: """Set the mapping of inputs corresponding to ``metadata`` ports that were passed to the process.""" @@ -462,10 +483,10 @@ def exit_status(self) -> Optional[int]: """ return self.base.attributes.get(self.EXIT_STATUS_KEY, None) - def set_exit_status(self, status: Union[None, enum.Enum, int]) -> None: + def set_exit_status(self, status: Optional[Union[enum.Enum, int]] = None) -> None: """Set the exit status of the process - :param state: an integer exit code or None, which will be interpreted as zero + :param status: the exit status, an integer exit code, or None """ if status is None: status = 0 diff --git a/src/aiida/orm/users.py b/src/aiida/orm/users.py index bb091b9fa0..50b02280fb 100644 --- a/src/aiida/orm/users.py +++ b/src/aiida/orm/users.py @@ -54,10 +54,25 @@ class User(entities.Entity['BackendUser', UserCollection]): _CLS_COLLECTION = UserCollection class Model(entities.Entity.Model): - email: str = MetadataField(description='The user email', is_attribute=False) - first_name: str = MetadataField(description='The user first name', is_attribute=False) - last_name: str = MetadataField(description='The user last name', is_attribute=False) - institution: str = MetadataField(description='The user institution', is_attribute=False) + email: str = MetadataField( + description='The user email', + is_attribute=False, + ) + first_name: str = MetadataField( + '', + description='The user first name', + is_attribute=False, + ) + last_name: str = MetadataField( + '', + description='The user last name', + is_attribute=False, + ) + institution: str = MetadataField( + '', + description='The user institution', + is_attribute=False, + ) def __init__( self, diff --git a/src/aiida/storage/psql_dos/orm/querybuilder/main.py b/src/aiida/storage/psql_dos/orm/querybuilder/main.py index 89dc26ff06..42fe9b79d2 100644 --- a/src/aiida/storage/psql_dos/orm/querybuilder/main.py +++ b/src/aiida/storage/psql_dos/orm/querybuilder/main.py @@ -51,6 +51,9 @@ 'computer_pk': 'dbcomputer_id', 'user_pk': 'user_id', }, + 'db_dbuser': { + 'pk': 'id', + }, 'db_dbcomputer': { 'pk': 'id', }, diff --git a/tests/orm/data/code/test_abstract.py b/tests/orm/data/code/test_abstract.py index 791595c9f4..df47eed8de 100644 --- a/tests/orm/data/code/test_abstract.py +++ b/tests/orm/data/code/test_abstract.py @@ -72,4 +72,4 @@ def test_serialization(): label = 'some-label' code = MockCode(label=label) - MockCode.from_serialized(**code.serialize()) + MockCode.from_serialized(unstored=True, **code.serialize(unstored=True)) diff --git a/tests/orm/data/code/test_installed.py b/tests/orm/data/code/test_installed.py index eb474bfd1b..7d2b13c02f 100644 --- a/tests/orm/data/code/test_installed.py +++ b/tests/orm/data/code/test_installed.py @@ -152,4 +152,4 @@ def test_serialization(aiida_localhost, bash_path): """Test the deprecated :meth:`aiida.orm.nodes.data.code.installed.InstalledCode.get_execname` method.""" code = InstalledCode(label='some-label', computer=aiida_localhost, filepath_executable=str(bash_path.absolute())) - InstalledCode.from_serialized(**code.serialize()) + InstalledCode.from_serialized(unstored=True, **code.serialize(unstored=True)) diff --git a/tests/orm/data/code/test_portable.py b/tests/orm/data/code/test_portable.py index dc707ad282..fc8e04cf14 100644 --- a/tests/orm/data/code/test_portable.py +++ b/tests/orm/data/code/test_portable.py @@ -145,4 +145,4 @@ def test_serialization(tmp_path, chdir_tmp_path): (filepath_files / 'subdir').mkdir() (filepath_files / 'subdir/test').write_text('test') code = PortableCode(label='some-label', filepath_executable='bash', filepath_files=filepath_files) - PortableCode.from_serialized(**code.serialize()) + PortableCode.from_serialized(unstored=True, **code.serialize(unstored=True)) diff --git a/tests/orm/models/test_models.py b/tests/orm/models/test_models.py index 7209a8fdaf..4268ab92ea 100644 --- a/tests/orm/models/test_models.py +++ b/tests/orm/models/test_models.py @@ -140,7 +140,14 @@ def required_arguments(request, default_user, aiida_localhost, tmp_path): if request.param is Str: return Str, {'value': 'string'} if request.param is StructureData: - return StructureData, {'cell': [[1, 0, 0], [0, 1, 0], [0, 0, 1]]} + return StructureData, { + 'cell': [[1, 0, 0], [0, 1, 0], [0, 0, 1]], + 'pbc1': True, + 'pbc2': True, + 'pbc3': True, + 'sites': [{'kind_name': 'H', 'position': (0.0, 0.0, 0.0)}], + 'kinds': [{'name': 'H', 'mass': 1.0, 'symbols': ('H',), 'weights': (1.0,)}], + } if request.param is RemoteData: return RemoteData, {'remote_path': '/some/path'} if request.param is RemoteStashData: @@ -169,18 +176,18 @@ def test_roundtrip(required_arguments, tmp_path): assert isinstance(entity, cls) # Get the model instance from the entity instance - model = entity._to_model(tmp_path) + model = entity.to_model(tmp_path, unstored=True) assert isinstance(model, BaseModel) # Reconstruct the entity instance from the model instance - roundtrip = cls._from_model(model) + roundtrip = cls.from_model(model) assert isinstance(roundtrip, cls) # Get the model instance again from the reconstructed entity and check that the fields that would be passed to the # ORM entity constructor are identical of the original model. The ``model_to_orm_field_values`` excludes values of # fields that define ``exclude_to_orm=True`` because these can change during roundtrips. This because these # typically correspond to entity fields that have defaults set on the database level, e.g., UUIDs. - roundtrip_model = roundtrip._to_model(tmp_path) + roundtrip_model = roundtrip.to_model(tmp_path, unstored=True) original_field_values = cls.model_to_orm_field_values(model) for key, value in cls.model_to_orm_field_values(roundtrip_model).items(): @@ -206,5 +213,5 @@ def test_roundtrip_serialization(required_arguments, tmp_path): assert isinstance(entity, cls) # Get the model instance from the entity instance - serialized_entity = entity.serialize(tmp_path) - entity.from_serialized(**serialized_entity) + serialized_entity = entity.serialize(tmp_path, unstored=True, mode='python') + entity.from_serialized(unstored=True, **serialized_entity) diff --git a/tests/orm/test_fields/fields_AuthInfo.yml b/tests/orm/test_fields/fields_AuthInfo.yml index 505c96da91..91ba1e63f6 100644 --- a/tests/orm/test_fields/fields_AuthInfo.yml +++ b/tests/orm/test_fields/fields_AuthInfo.yml @@ -2,5 +2,5 @@ auth_params: QbDictField('auth_params', dtype=typing.Dict[str, typing.Any], is_a computer: QbNumericField('computer', dtype=, is_attribute=False) enabled: QbField('enabled', dtype=, is_attribute=False) metadata: QbDictField('metadata', dtype=typing.Dict[str, typing.Any], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) user: QbNumericField('user', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_Comment.yml b/tests/orm/test_fields/fields_Comment.yml index 30aedcef79..f227b00247 100644 --- a/tests/orm/test_fields/fields_Comment.yml +++ b/tests/orm/test_fields/fields_Comment.yml @@ -1,7 +1,7 @@ content: QbStrField('content', dtype=, is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) node: QbNumericField('node', dtype=, is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) user: QbNumericField('user', dtype=, is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_Computer.yml b/tests/orm/test_fields/fields_Computer.yml index 7d4e37168b..fc980dec16 100644 --- a/tests/orm/test_fields/fields_Computer.yml +++ b/tests/orm/test_fields/fields_Computer.yml @@ -2,7 +2,7 @@ description: QbStrField('description', dtype=, is_attribute=False) hostname: QbStrField('hostname', dtype=, is_attribute=False) label: QbStrField('label', dtype=, is_attribute=False) metadata: QbDictField('metadata', dtype=typing.Dict[str, typing.Any], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) scheduler_type: QbStrField('scheduler_type', dtype=, is_attribute=False) transport_type: QbStrField('transport_type', dtype=, is_attribute=False) -uuid: QbStrField('uuid', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_Group.yml b/tests/orm/test_fields/fields_Group.yml index 537c76a11d..1844039c7e 100644 --- a/tests/orm/test_fields/fields_Group.yml +++ b/tests/orm/test_fields/fields_Group.yml @@ -1,9 +1,9 @@ -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) label: QbStrField('label', dtype=, is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) -time: QbNumericField('time', dtype=typing.Optional[datetime.datetime], is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) +time: QbNumericField('time', dtype=, is_attribute=False) type_string: QbStrField('type_string', dtype=, is_attribute=False) user: QbNumericField('user', dtype=, is_attribute=False) -uuid: QbStrField('uuid', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_Log.yml b/tests/orm/test_fields/fields_Log.yml index 90bf0a5b0b..0cacd5ac55 100644 --- a/tests/orm/test_fields/fields_Log.yml +++ b/tests/orm/test_fields/fields_Log.yml @@ -3,6 +3,6 @@ levelname: QbStrField('levelname', dtype=, is_attribute=False) loggername: QbStrField('loggername', dtype=, is_attribute=False) message: QbStrField('message', dtype=, is_attribute=False) metadata: QbDictField('metadata', dtype=typing.Dict[str, typing.Any], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) time: QbNumericField('time', dtype=, is_attribute=False) -uuid: QbStrField('uuid', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_User.yml b/tests/orm/test_fields/fields_User.yml index 06fb9cd05c..247accb431 100644 --- a/tests/orm/test_fields/fields_User.yml +++ b/tests/orm/test_fields/fields_User.yml @@ -2,4 +2,4 @@ email: QbStrField('email', dtype=, is_attribute=False) first_name: QbStrField('first_name', dtype=, is_attribute=False) institution: QbStrField('institution', dtype=, is_attribute=False) last_name: QbStrField('last_name', dtype=, is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.data.core.array.ArrayData.yml b/tests/orm/test_fields/fields_aiida.data.core.array.ArrayData.yml index c31304e6f5..5e38f108f0 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.array.ArrayData.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.array.ArrayData.yml @@ -1,20 +1,19 @@ -arrays: QbDictField('arrays', dtype=typing.Optional[dict[str, bytes]], is_attribute=True) -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +arrays: QbDictField('arrays', dtype=typing.Optional[dict[str, numpy.ndarray]], is_attribute=True) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +label: QbStrField('label', dtype=, is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.data.core.array.bands.BandsData.yml b/tests/orm/test_fields/fields_aiida.data.core.array.bands.BandsData.yml index f0bca48c81..79d9e78394 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.array.bands.BandsData.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.array.bands.BandsData.yml @@ -1,31 +1,32 @@ array_labels: QbArrayField('array_labels', dtype=typing.Optional[typing.List[str]], is_attribute=True) -arrays: QbDictField('arrays', dtype=typing.Optional[dict[str, bytes]], is_attribute=True) -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -cell: QbArrayField('cell', dtype=typing.List[typing.List[float]], is_attribute=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -label_numbers: QbArrayField('label_numbers', dtype=typing.List[int], is_attribute=True) -labels: QbArrayField('labels', dtype=typing.List[str], is_attribute=True) -mesh: QbArrayField('mesh', dtype=typing.List[int], is_attribute=True) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -offset: QbArrayField('offset', dtype=typing.List[float], is_attribute=True) -pbc1: QbField('pbc1', dtype=, is_attribute=True) -pbc2: QbField('pbc2', dtype=, is_attribute=True) -pbc3: QbField('pbc3', dtype=, is_attribute=True) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +arrays: QbDictField('arrays', dtype=typing.Optional[dict[str, numpy.ndarray]], is_attribute=True) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +cell: QbArrayField('cell', dtype=typing.Optional[typing.List[typing.List[float]]], + is_attribute=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +label: QbStrField('label', dtype=, is_attribute=False) +label_numbers: QbArrayField('label_numbers', dtype=typing.Optional[typing.List[int]], + is_attribute=True) +labels: QbArrayField('labels', dtype=typing.Optional[typing.List[str]], is_attribute=True) +mesh: QbArrayField('mesh', dtype=typing.Optional[typing.List[int]], is_attribute=True) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +offset: QbArrayField('offset', dtype=typing.Optional[typing.List[float]], is_attribute=True) +pbc1: QbField('pbc1', dtype=typing.Optional[bool], is_attribute=True) +pbc2: QbField('pbc2', dtype=typing.Optional[bool], is_attribute=True) +pbc3: QbField('pbc3', dtype=typing.Optional[bool], is_attribute=True) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) -units: QbStrField('units', dtype=, is_attribute=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +units: QbStrField('units', dtype=typing.Optional[str], is_attribute=True) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.data.core.array.kpoints.KpointsData.yml b/tests/orm/test_fields/fields_aiida.data.core.array.kpoints.KpointsData.yml index 6d0aaa2b6f..5787873d7a 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.array.kpoints.KpointsData.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.array.kpoints.KpointsData.yml @@ -1,28 +1,29 @@ -arrays: QbDictField('arrays', dtype=typing.Optional[dict[str, bytes]], is_attribute=True) -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -cell: QbArrayField('cell', dtype=typing.List[typing.List[float]], is_attribute=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -label_numbers: QbArrayField('label_numbers', dtype=typing.List[int], is_attribute=True) -labels: QbArrayField('labels', dtype=typing.List[str], is_attribute=True) -mesh: QbArrayField('mesh', dtype=typing.List[int], is_attribute=True) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -offset: QbArrayField('offset', dtype=typing.List[float], is_attribute=True) -pbc1: QbField('pbc1', dtype=, is_attribute=True) -pbc2: QbField('pbc2', dtype=, is_attribute=True) -pbc3: QbField('pbc3', dtype=, is_attribute=True) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +arrays: QbDictField('arrays', dtype=typing.Optional[dict[str, numpy.ndarray]], is_attribute=True) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +cell: QbArrayField('cell', dtype=typing.Optional[typing.List[typing.List[float]]], + is_attribute=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +label: QbStrField('label', dtype=, is_attribute=False) +label_numbers: QbArrayField('label_numbers', dtype=typing.Optional[typing.List[int]], + is_attribute=True) +labels: QbArrayField('labels', dtype=typing.Optional[typing.List[str]], is_attribute=True) +mesh: QbArrayField('mesh', dtype=typing.Optional[typing.List[int]], is_attribute=True) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +offset: QbArrayField('offset', dtype=typing.Optional[typing.List[float]], is_attribute=True) +pbc1: QbField('pbc1', dtype=typing.Optional[bool], is_attribute=True) +pbc2: QbField('pbc2', dtype=typing.Optional[bool], is_attribute=True) +pbc3: QbField('pbc3', dtype=typing.Optional[bool], is_attribute=True) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.data.core.array.projection.ProjectionData.yml b/tests/orm/test_fields/fields_aiida.data.core.array.projection.ProjectionData.yml index c31304e6f5..5e38f108f0 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.array.projection.ProjectionData.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.array.projection.ProjectionData.yml @@ -1,20 +1,19 @@ -arrays: QbDictField('arrays', dtype=typing.Optional[dict[str, bytes]], is_attribute=True) -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +arrays: QbDictField('arrays', dtype=typing.Optional[dict[str, numpy.ndarray]], is_attribute=True) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +label: QbStrField('label', dtype=, is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.data.core.array.trajectory.TrajectoryData.yml b/tests/orm/test_fields/fields_aiida.data.core.array.trajectory.TrajectoryData.yml index 87aaa30148..1c92a3d0f9 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.array.trajectory.TrajectoryData.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.array.trajectory.TrajectoryData.yml @@ -1,23 +1,22 @@ -arrays: QbDictField('arrays', dtype=typing.Optional[dict[str, bytes]], is_attribute=True) -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +arrays: QbDictField('arrays', dtype=typing.Optional[dict[str, numpy.ndarray]], is_attribute=True) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +label: QbStrField('label', dtype=, is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) symbols: QbArrayField('symbols', dtype=typing.List[str], is_attribute=True) -units_positions: QbStrField('units_positions', dtype=, is_attribute=True) -units_times: QbStrField('units_times', dtype=, is_attribute=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +units_positions: QbStrField('units_positions', dtype=typing.Optional[str], is_attribute=True) +units_times: QbStrField('units_times', dtype=typing.Optional[str], is_attribute=True) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.data.core.array.xy.XyData.yml b/tests/orm/test_fields/fields_aiida.data.core.array.xy.XyData.yml index c31304e6f5..5e38f108f0 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.array.xy.XyData.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.array.xy.XyData.yml @@ -1,20 +1,19 @@ -arrays: QbDictField('arrays', dtype=typing.Optional[dict[str, bytes]], is_attribute=True) -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +arrays: QbDictField('arrays', dtype=typing.Optional[dict[str, numpy.ndarray]], is_attribute=True) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +label: QbStrField('label', dtype=, is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.data.core.base.BaseType.yml b/tests/orm/test_fields/fields_aiida.data.core.base.BaseType.yml index 457621f596..ac20a817c7 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.base.BaseType.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.base.BaseType.yml @@ -1,20 +1,19 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +label: QbStrField('label', dtype=, is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) value: QbField('value', dtype=typing.Any, is_attribute=True) diff --git a/tests/orm/test_fields/fields_aiida.data.core.bool.Bool.yml b/tests/orm/test_fields/fields_aiida.data.core.bool.Bool.yml index 457621f596..e01e9f21ed 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.bool.Bool.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.bool.Bool.yml @@ -1,20 +1,19 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +label: QbStrField('label', dtype=, is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) -value: QbField('value', dtype=typing.Any, is_attribute=True) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) +value: QbField('value', dtype=, is_attribute=True) diff --git a/tests/orm/test_fields/fields_aiida.data.core.cif.CifData.yml b/tests/orm/test_fields/fields_aiida.data.core.cif.CifData.yml index da4e1d40d9..6d1b4bc1a9 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.cif.CifData.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.cif.CifData.yml @@ -1,25 +1,24 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) content: QbField('content', dtype=, is_attribute=True) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -filename: QbStrField('filename', dtype=typing.Optional[str], is_attribute=True) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +filename: QbStrField('filename', dtype=, is_attribute=True) formulae: QbArrayField('formulae', dtype=typing.Optional[typing.List[str]], is_attribute=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) +label: QbStrField('label', dtype=, is_attribute=False) md5: QbStrField('md5', dtype=typing.Optional[str], is_attribute=True) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) spacegroup_numbers: QbArrayField('spacegroup_numbers', dtype=typing.Optional[typing.List[str]], is_attribute=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.data.core.code.Code.yml b/tests/orm/test_fields/fields_aiida.data.core.code.Code.yml index 8ebaa0804d..df9f20e1fc 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.code.Code.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.code.Code.yml @@ -1,29 +1,28 @@ append_text: QbStrField('append_text', dtype=, is_attribute=True) -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) default_calc_job_plugin: QbStrField('default_calc_job_plugin', dtype=typing.Optional[str], is_attribute=True) description: QbStrField('description', dtype=, is_attribute=True) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) input_plugin: QbStrField('input_plugin', dtype=typing.Optional[str], is_attribute=True) is_local: QbField('is_local', dtype=typing.Optional[bool], is_attribute=True) label: QbStrField('label', dtype=, is_attribute=True) local_executable: QbStrField('local_executable', dtype=typing.Optional[str], is_attribute=True) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) prepend_text: QbStrField('prepend_text', dtype=, is_attribute=True) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) remote_exec_path: QbStrField('remote_exec_path', dtype=typing.Optional[str], is_attribute=True) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) use_double_quotes: QbField('use_double_quotes', dtype=, is_attribute=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) with_mpi: QbField('with_mpi', dtype=typing.Optional[bool], is_attribute=True) diff --git a/tests/orm/test_fields/fields_aiida.data.core.code.abstract.AbstractCode.yml b/tests/orm/test_fields/fields_aiida.data.core.code.abstract.AbstractCode.yml index 4dc178d9fc..ee8bb7beef 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.code.abstract.AbstractCode.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.code.abstract.AbstractCode.yml @@ -1,25 +1,24 @@ append_text: QbStrField('append_text', dtype=, is_attribute=True) -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) default_calc_job_plugin: QbStrField('default_calc_job_plugin', dtype=typing.Optional[str], is_attribute=True) description: QbStrField('description', dtype=, is_attribute=True) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) label: QbStrField('label', dtype=, is_attribute=True) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) prepend_text: QbStrField('prepend_text', dtype=, is_attribute=True) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) use_double_quotes: QbField('use_double_quotes', dtype=, is_attribute=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) with_mpi: QbField('with_mpi', dtype=typing.Optional[bool], is_attribute=True) diff --git a/tests/orm/test_fields/fields_aiida.data.core.code.containerized.ContainerizedCode.yml b/tests/orm/test_fields/fields_aiida.data.core.code.containerized.ContainerizedCode.yml index e7f12a1a94..4511495ff7 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.code.containerized.ContainerizedCode.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.code.containerized.ContainerizedCode.yml @@ -1,29 +1,28 @@ append_text: QbStrField('append_text', dtype=, is_attribute=True) -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbStrField('computer', dtype=, is_attribute=True) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=, is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) default_calc_job_plugin: QbStrField('default_calc_job_plugin', dtype=typing.Optional[str], is_attribute=True) description: QbStrField('description', dtype=, is_attribute=True) engine_command: QbStrField('engine_command', dtype=, is_attribute=True) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) filepath_executable: QbStrField('filepath_executable', dtype=, is_attribute=True) image_name: QbStrField('image_name', dtype=, is_attribute=True) label: QbStrField('label', dtype=, is_attribute=True) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) prepend_text: QbStrField('prepend_text', dtype=, is_attribute=True) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) use_double_quotes: QbField('use_double_quotes', dtype=, is_attribute=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) with_mpi: QbField('with_mpi', dtype=typing.Optional[bool], is_attribute=True) wrap_cmdline_params: QbField('wrap_cmdline_params', dtype=, is_attribute=True) diff --git a/tests/orm/test_fields/fields_aiida.data.core.code.installed.InstalledCode.yml b/tests/orm/test_fields/fields_aiida.data.core.code.installed.InstalledCode.yml index 15089b4a3d..6bdfcaed89 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.code.installed.InstalledCode.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.code.installed.InstalledCode.yml @@ -1,26 +1,25 @@ append_text: QbStrField('append_text', dtype=, is_attribute=True) -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbStrField('computer', dtype=, is_attribute=True) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=, is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) default_calc_job_plugin: QbStrField('default_calc_job_plugin', dtype=typing.Optional[str], is_attribute=True) description: QbStrField('description', dtype=, is_attribute=True) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) filepath_executable: QbStrField('filepath_executable', dtype=, is_attribute=True) label: QbStrField('label', dtype=, is_attribute=True) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) prepend_text: QbStrField('prepend_text', dtype=, is_attribute=True) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) use_double_quotes: QbField('use_double_quotes', dtype=, is_attribute=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) with_mpi: QbField('with_mpi', dtype=typing.Optional[bool], is_attribute=True) diff --git a/tests/orm/test_fields/fields_aiida.data.core.code.portable.PortableCode.yml b/tests/orm/test_fields/fields_aiida.data.core.code.portable.PortableCode.yml index b874b26466..6d69c90cda 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.code.portable.PortableCode.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.code.portable.PortableCode.yml @@ -1,27 +1,26 @@ append_text: QbStrField('append_text', dtype=, is_attribute=True) -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) default_calc_job_plugin: QbStrField('default_calc_job_plugin', dtype=typing.Optional[str], is_attribute=True) description: QbStrField('description', dtype=, is_attribute=True) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) filepath_executable: QbStrField('filepath_executable', dtype=, is_attribute=True) filepath_files: QbStrField('filepath_files', dtype=, is_attribute=False) label: QbStrField('label', dtype=, is_attribute=True) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) prepend_text: QbStrField('prepend_text', dtype=, is_attribute=True) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) use_double_quotes: QbField('use_double_quotes', dtype=, is_attribute=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) with_mpi: QbField('with_mpi', dtype=typing.Optional[bool], is_attribute=True) diff --git a/tests/orm/test_fields/fields_aiida.data.core.dict.Dict.yml b/tests/orm/test_fields/fields_aiida.data.core.dict.Dict.yml index 710d253b4d..95d389477e 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.dict.Dict.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.dict.Dict.yml @@ -1,21 +1,20 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +label: QbStrField('label', dtype=, is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) value: QbDictField('value', dtype=typing.Dict[str, typing.Any], is_attribute=False, is_subscriptable=True) diff --git a/tests/orm/test_fields/fields_aiida.data.core.enum.EnumData.yml b/tests/orm/test_fields/fields_aiida.data.core.enum.EnumData.yml index cfc3976079..8df237bcef 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.enum.EnumData.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.enum.EnumData.yml @@ -1,20 +1,19 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +label: QbStrField('label', dtype=, is_attribute=False) member: QbField('member', dtype=, is_attribute=True) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.data.core.float.Float.yml b/tests/orm/test_fields/fields_aiida.data.core.float.Float.yml index 457621f596..6c891b8fa0 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.float.Float.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.float.Float.yml @@ -1,20 +1,19 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +label: QbStrField('label', dtype=, is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) -value: QbField('value', dtype=typing.Any, is_attribute=True) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) +value: QbNumericField('value', dtype=, is_attribute=True) diff --git a/tests/orm/test_fields/fields_aiida.data.core.folder.FolderData.yml b/tests/orm/test_fields/fields_aiida.data.core.folder.FolderData.yml index 5bee2ef441..07acd8a330 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.folder.FolderData.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.folder.FolderData.yml @@ -1,19 +1,18 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +label: QbStrField('label', dtype=, is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.data.core.int.Int.yml b/tests/orm/test_fields/fields_aiida.data.core.int.Int.yml index 457621f596..0e34cfd29a 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.int.Int.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.int.Int.yml @@ -1,20 +1,19 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +label: QbStrField('label', dtype=, is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) -value: QbField('value', dtype=typing.Any, is_attribute=True) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) +value: QbNumericField('value', dtype=, is_attribute=True) diff --git a/tests/orm/test_fields/fields_aiida.data.core.jsonable.JsonableData.yml b/tests/orm/test_fields/fields_aiida.data.core.jsonable.JsonableData.yml index 1166fbc570..3ea41ba032 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.jsonable.JsonableData.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.jsonable.JsonableData.yml @@ -1,21 +1,20 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +label: QbStrField('label', dtype=, is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) obj: QbField('obj', dtype=, is_attribute=True) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.data.core.list.List.yml b/tests/orm/test_fields/fields_aiida.data.core.list.List.yml index 4edd6d3380..e91319b9d6 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.list.List.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.list.List.yml @@ -1,20 +1,19 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +label: QbStrField('label', dtype=, is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) value: QbArrayField('value', dtype=typing.List[typing.Any], is_attribute=True) diff --git a/tests/orm/test_fields/fields_aiida.data.core.numeric.NumericType.yml b/tests/orm/test_fields/fields_aiida.data.core.numeric.NumericType.yml index 457621f596..ac20a817c7 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.numeric.NumericType.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.numeric.NumericType.yml @@ -1,20 +1,19 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +label: QbStrField('label', dtype=, is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) value: QbField('value', dtype=typing.Any, is_attribute=True) diff --git a/tests/orm/test_fields/fields_aiida.data.core.orbital.OrbitalData.yml b/tests/orm/test_fields/fields_aiida.data.core.orbital.OrbitalData.yml index 5bee2ef441..07acd8a330 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.orbital.OrbitalData.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.orbital.OrbitalData.yml @@ -1,19 +1,18 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +label: QbStrField('label', dtype=, is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.data.core.remote.RemoteData.yml b/tests/orm/test_fields/fields_aiida.data.core.remote.RemoteData.yml index 5086780659..dae0981bc0 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.remote.RemoteData.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.remote.RemoteData.yml @@ -1,20 +1,19 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +label: QbStrField('label', dtype=, is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) remote_path: QbStrField('remote_path', dtype=typing.Optional[str], is_attribute=True) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.data.core.remote.stash.RemoteStashData.yml b/tests/orm/test_fields/fields_aiida.data.core.remote.stash.RemoteStashData.yml index 35e6e4188e..fdb6988347 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.remote.stash.RemoteStashData.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.remote.stash.RemoteStashData.yml @@ -1,20 +1,19 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +label: QbStrField('label', dtype=, is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) stash_mode: QbField('stash_mode', dtype=, is_attribute=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.data.core.remote.stash.compress.RemoteStashCompressedData.yml b/tests/orm/test_fields/fields_aiida.data.core.remote.stash.compress.RemoteStashCompressedData.yml index 40e941f933..710840981b 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.remote.stash.compress.RemoteStashCompressedData.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.remote.stash.compress.RemoteStashCompressedData.yml @@ -1,23 +1,22 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) dereference: QbField('dereference', dtype=, is_attribute=True) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +label: QbStrField('label', dtype=, is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) source_list: QbArrayField('source_list', dtype=typing.List[str], is_attribute=True) stash_mode: QbField('stash_mode', dtype=, is_attribute=True) target_basepath: QbStrField('target_basepath', dtype=, is_attribute=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.data.core.remote.stash.custom.RemoteStashCustomData.yml b/tests/orm/test_fields/fields_aiida.data.core.remote.stash.custom.RemoteStashCustomData.yml index 82e177e738..6713968e95 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.remote.stash.custom.RemoteStashCustomData.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.remote.stash.custom.RemoteStashCustomData.yml @@ -1,22 +1,21 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +label: QbStrField('label', dtype=, is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) source_list: QbArrayField('source_list', dtype=typing.List[str], is_attribute=True) stash_mode: QbField('stash_mode', dtype=, is_attribute=True) target_basepath: QbStrField('target_basepath', dtype=, is_attribute=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.data.core.remote.stash.folder.RemoteStashFolderData.yml b/tests/orm/test_fields/fields_aiida.data.core.remote.stash.folder.RemoteStashFolderData.yml index 82e177e738..6713968e95 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.remote.stash.folder.RemoteStashFolderData.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.remote.stash.folder.RemoteStashFolderData.yml @@ -1,22 +1,21 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +label: QbStrField('label', dtype=, is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) source_list: QbArrayField('source_list', dtype=typing.List[str], is_attribute=True) stash_mode: QbField('stash_mode', dtype=, is_attribute=True) target_basepath: QbStrField('target_basepath', dtype=, is_attribute=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.data.core.singlefile.SinglefileData.yml b/tests/orm/test_fields/fields_aiida.data.core.singlefile.SinglefileData.yml index 71f35c46f7..c320eb4374 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.singlefile.SinglefileData.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.singlefile.SinglefileData.yml @@ -1,21 +1,20 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) content: QbField('content', dtype=, is_attribute=True) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -filename: QbStrField('filename', dtype=typing.Optional[str], is_attribute=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +filename: QbStrField('filename', dtype=, is_attribute=True) +label: QbStrField('label', dtype=, is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.data.core.str.Str.yml b/tests/orm/test_fields/fields_aiida.data.core.str.Str.yml index 457621f596..73117515a3 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.str.Str.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.str.Str.yml @@ -1,20 +1,19 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +label: QbStrField('label', dtype=, is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) -value: QbField('value', dtype=typing.Any, is_attribute=True) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) +value: QbStrField('value', dtype=, is_attribute=True) diff --git a/tests/orm/test_fields/fields_aiida.data.core.structure.StructureData.yml b/tests/orm/test_fields/fields_aiida.data.core.structure.StructureData.yml index 8e94962d01..bf702d4905 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.structure.StructureData.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.structure.StructureData.yml @@ -1,25 +1,24 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) cell: QbArrayField('cell', dtype=typing.List[typing.List[float]], is_attribute=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -kinds: QbArrayField('kinds', dtype=typing.Optional[typing.List[dict]], is_attribute=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +kinds: QbArrayField('kinds', dtype=typing.List[dict], is_attribute=True) +label: QbStrField('label', dtype=, is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) pbc1: QbField('pbc1', dtype=, is_attribute=True) pbc2: QbField('pbc2', dtype=, is_attribute=True) pbc3: QbField('pbc3', dtype=, is_attribute=True) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) -sites: QbArrayField('sites', dtype=typing.Optional[typing.List[dict]], is_attribute=True) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) +sites: QbArrayField('sites', dtype=typing.List[dict], is_attribute=True) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.data.core.upf.UpfData.yml b/tests/orm/test_fields/fields_aiida.data.core.upf.UpfData.yml index 71f35c46f7..c320eb4374 100644 --- a/tests/orm/test_fields/fields_aiida.data.core.upf.UpfData.yml +++ b/tests/orm/test_fields/fields_aiida.data.core.upf.UpfData.yml @@ -1,21 +1,20 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) +attributes: QbDictField('attributes', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +computer: QbStrField('computer', dtype=typing.Optional[str], is_attribute=False) content: QbField('content', dtype=, is_attribute=True) -ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], - is_attribute=False, is_subscriptable=True) -filename: QbStrField('filename', dtype=typing.Optional[str], is_attribute=True) -label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) -mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) -node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) -pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) +ctime: QbNumericField('ctime', dtype=, is_attribute=False) +description: QbStrField('description', dtype=, is_attribute=False) +extras: QbDictField('extras', dtype=typing.Dict[str, typing.Any], is_attribute=False, + is_subscriptable=True) +filename: QbStrField('filename', dtype=, is_attribute=True) +label: QbStrField('label', dtype=, is_attribute=False) +mtime: QbNumericField('mtime', dtype=, is_attribute=False) +node_type: QbStrField('node_type', dtype=, is_attribute=False) +pk: QbNumericField('pk', dtype=, is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, - bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, - typing.Any]], is_attribute=False) +repository_content: QbDictField('repository_content', dtype=dict[str, bytes], is_attribute=False) +repository_metadata: QbDictField('repository_metadata', dtype=typing.Dict[str, typing.Any], + is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) -user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) -uuid: QbStrField('uuid', dtype=typing.Optional[str], is_attribute=False) +user: QbNumericField('user', dtype=, is_attribute=False) +uuid: QbField('uuid', dtype=, is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.node.data.Data.yml b/tests/orm/test_fields/fields_aiida.node.data.Data.yml index 5bee2ef441..cf63271c5e 100644 --- a/tests/orm/test_fields/fields_aiida.node.data.Data.yml +++ b/tests/orm/test_fields/fields_aiida.node.data.Data.yml @@ -1,18 +1,22 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], +attributes: + QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) +computer: QbNumericField('computer', dtype=typing.Optional[str], is_attribute=False) ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], +extras: + QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], is_attribute=False, is_subscriptable=True) label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) node_type: QbStrField('node_type', dtype=typing.Optional[str], is_attribute=False) pk: QbNumericField('pk', dtype=typing.Optional[int], is_attribute=False) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, +repository_content: + QbDictField('repository_content', dtype=typing.Optional[dict[str, bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, +repository_metadata: + QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, typing.Any]], is_attribute=False) source: QbDictField('source', dtype=typing.Optional[dict], is_attribute=True, is_subscriptable=True) user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.node.process.ProcessNode.yml b/tests/orm/test_fields/fields_aiida.node.process.ProcessNode.yml index d8928ee1a4..6639d94fba 100644 --- a/tests/orm/test_fields/fields_aiida.node.process.ProcessNode.yml +++ b/tests/orm/test_fields/fields_aiida.node.process.ProcessNode.yml @@ -1,12 +1,14 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], +attributes: + QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) +computer: QbNumericField('computer', dtype=typing.Optional[str], is_attribute=False) ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) exception: QbStrField('exception', dtype=typing.Optional[str], is_attribute=True) exit_message: QbStrField('exit_message', dtype=typing.Optional[str], is_attribute=True) exit_status: QbNumericField('exit_status', dtype=typing.Optional[int], is_attribute=True) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], +extras: + QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], is_attribute=False, is_subscriptable=True) label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) @@ -17,9 +19,11 @@ process_label: QbStrField('process_label', dtype=typing.Optional[str], is_attrib process_state: QbStrField('process_state', dtype=typing.Optional[str], is_attribute=True) process_status: QbStrField('process_status', dtype=typing.Optional[str], is_attribute=True) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, +repository_content: + QbDictField('repository_content', dtype=typing.Optional[dict[str, bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, +repository_metadata: + QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, typing.Any]], is_attribute=False) sealed: QbField('sealed', dtype=, is_attribute=True) user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.node.process.calculation.CalculationNode.yml b/tests/orm/test_fields/fields_aiida.node.process.calculation.CalculationNode.yml index d8928ee1a4..6639d94fba 100644 --- a/tests/orm/test_fields/fields_aiida.node.process.calculation.CalculationNode.yml +++ b/tests/orm/test_fields/fields_aiida.node.process.calculation.CalculationNode.yml @@ -1,12 +1,14 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], +attributes: + QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) +computer: QbNumericField('computer', dtype=typing.Optional[str], is_attribute=False) ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) exception: QbStrField('exception', dtype=typing.Optional[str], is_attribute=True) exit_message: QbStrField('exit_message', dtype=typing.Optional[str], is_attribute=True) exit_status: QbNumericField('exit_status', dtype=typing.Optional[int], is_attribute=True) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], +extras: + QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], is_attribute=False, is_subscriptable=True) label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) @@ -17,9 +19,11 @@ process_label: QbStrField('process_label', dtype=typing.Optional[str], is_attrib process_state: QbStrField('process_state', dtype=typing.Optional[str], is_attribute=True) process_status: QbStrField('process_status', dtype=typing.Optional[str], is_attribute=True) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, +repository_content: + QbDictField('repository_content', dtype=typing.Optional[dict[str, bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, +repository_metadata: + QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, typing.Any]], is_attribute=False) sealed: QbField('sealed', dtype=, is_attribute=True) user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.node.process.calculation.calcfunction.CalcFunctionNode.yml b/tests/orm/test_fields/fields_aiida.node.process.calculation.calcfunction.CalcFunctionNode.yml index d8928ee1a4..6639d94fba 100644 --- a/tests/orm/test_fields/fields_aiida.node.process.calculation.calcfunction.CalcFunctionNode.yml +++ b/tests/orm/test_fields/fields_aiida.node.process.calculation.calcfunction.CalcFunctionNode.yml @@ -1,12 +1,14 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], +attributes: + QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) +computer: QbNumericField('computer', dtype=typing.Optional[str], is_attribute=False) ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) exception: QbStrField('exception', dtype=typing.Optional[str], is_attribute=True) exit_message: QbStrField('exit_message', dtype=typing.Optional[str], is_attribute=True) exit_status: QbNumericField('exit_status', dtype=typing.Optional[int], is_attribute=True) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], +extras: + QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], is_attribute=False, is_subscriptable=True) label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) @@ -17,9 +19,11 @@ process_label: QbStrField('process_label', dtype=typing.Optional[str], is_attrib process_state: QbStrField('process_state', dtype=typing.Optional[str], is_attribute=True) process_status: QbStrField('process_status', dtype=typing.Optional[str], is_attribute=True) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, +repository_content: + QbDictField('repository_content', dtype=typing.Optional[dict[str, bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, +repository_metadata: + QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, typing.Any]], is_attribute=False) sealed: QbField('sealed', dtype=, is_attribute=True) user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.node.process.calculation.calcjob.CalcJobNode.yml b/tests/orm/test_fields/fields_aiida.node.process.calculation.calcjob.CalcJobNode.yml index 8da4b34cb8..fc0b31b968 100644 --- a/tests/orm/test_fields/fields_aiida.node.process.calculation.calcjob.CalcJobNode.yml +++ b/tests/orm/test_fields/fields_aiida.node.process.calculation.calcjob.CalcJobNode.yml @@ -1,13 +1,15 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], +attributes: + QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) +computer: QbNumericField('computer', dtype=typing.Optional[str], is_attribute=False) ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) detailed_job_info: QbDictField('detailed_job_info', dtype=typing.Optional[dict], is_attribute=True) exception: QbStrField('exception', dtype=typing.Optional[str], is_attribute=True) exit_message: QbStrField('exit_message', dtype=typing.Optional[str], is_attribute=True) exit_status: QbNumericField('exit_status', dtype=typing.Optional[int], is_attribute=True) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], +extras: + QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], is_attribute=False, is_subscriptable=True) imported: QbField('imported', dtype=typing.Optional[bool], is_attribute=True) job_id: QbStrField('job_id', dtype=typing.Optional[str], is_attribute=True) @@ -22,15 +24,20 @@ process_state: QbStrField('process_state', dtype=typing.Optional[str], is_attrib process_status: QbStrField('process_status', dtype=typing.Optional[str], is_attribute=True) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) remote_workdir: QbStrField('remote_workdir', dtype=typing.Optional[str], is_attribute=True) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, +repository_content: + QbDictField('repository_content', dtype=typing.Optional[dict[str, bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, +repository_metadata: + QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, typing.Any]], is_attribute=False) -retrieve_list: QbArrayField('retrieve_list', dtype=typing.Optional[typing.List[str]], +retrieve_list: + QbArrayField('retrieve_list', dtype=typing.Optional[typing.List[str]], is_attribute=True) -retrieve_temporary_list: QbArrayField('retrieve_temporary_list', dtype=typing.Optional[typing.List[str]], +retrieve_temporary_list: + QbArrayField('retrieve_temporary_list', dtype=typing.Optional[typing.List[str]], is_attribute=True) -scheduler_lastchecktime: QbStrField('scheduler_lastchecktime', dtype=typing.Optional[str], +scheduler_lastchecktime: + QbStrField('scheduler_lastchecktime', dtype=typing.Optional[str], is_attribute=True) scheduler_state: QbStrField('scheduler_state', dtype=typing.Optional[str], is_attribute=True) sealed: QbField('sealed', dtype=, is_attribute=True) diff --git a/tests/orm/test_fields/fields_aiida.node.process.workflow.WorkflowNode.yml b/tests/orm/test_fields/fields_aiida.node.process.workflow.WorkflowNode.yml index d8928ee1a4..6639d94fba 100644 --- a/tests/orm/test_fields/fields_aiida.node.process.workflow.WorkflowNode.yml +++ b/tests/orm/test_fields/fields_aiida.node.process.workflow.WorkflowNode.yml @@ -1,12 +1,14 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], +attributes: + QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) +computer: QbNumericField('computer', dtype=typing.Optional[str], is_attribute=False) ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) exception: QbStrField('exception', dtype=typing.Optional[str], is_attribute=True) exit_message: QbStrField('exit_message', dtype=typing.Optional[str], is_attribute=True) exit_status: QbNumericField('exit_status', dtype=typing.Optional[int], is_attribute=True) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], +extras: + QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], is_attribute=False, is_subscriptable=True) label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) @@ -17,9 +19,11 @@ process_label: QbStrField('process_label', dtype=typing.Optional[str], is_attrib process_state: QbStrField('process_state', dtype=typing.Optional[str], is_attribute=True) process_status: QbStrField('process_status', dtype=typing.Optional[str], is_attribute=True) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, +repository_content: + QbDictField('repository_content', dtype=typing.Optional[dict[str, bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, +repository_metadata: + QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, typing.Any]], is_attribute=False) sealed: QbField('sealed', dtype=, is_attribute=True) user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.node.process.workflow.workchain.WorkChainNode.yml b/tests/orm/test_fields/fields_aiida.node.process.workflow.workchain.WorkChainNode.yml index d8928ee1a4..6639d94fba 100644 --- a/tests/orm/test_fields/fields_aiida.node.process.workflow.workchain.WorkChainNode.yml +++ b/tests/orm/test_fields/fields_aiida.node.process.workflow.workchain.WorkChainNode.yml @@ -1,12 +1,14 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], +attributes: + QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) +computer: QbNumericField('computer', dtype=typing.Optional[str], is_attribute=False) ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) exception: QbStrField('exception', dtype=typing.Optional[str], is_attribute=True) exit_message: QbStrField('exit_message', dtype=typing.Optional[str], is_attribute=True) exit_status: QbNumericField('exit_status', dtype=typing.Optional[int], is_attribute=True) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], +extras: + QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], is_attribute=False, is_subscriptable=True) label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) @@ -17,9 +19,11 @@ process_label: QbStrField('process_label', dtype=typing.Optional[str], is_attrib process_state: QbStrField('process_state', dtype=typing.Optional[str], is_attribute=True) process_status: QbStrField('process_status', dtype=typing.Optional[str], is_attribute=True) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, +repository_content: + QbDictField('repository_content', dtype=typing.Optional[dict[str, bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, +repository_metadata: + QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, typing.Any]], is_attribute=False) sealed: QbField('sealed', dtype=, is_attribute=True) user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False) diff --git a/tests/orm/test_fields/fields_aiida.node.process.workflow.workfunction.WorkFunctionNode.yml b/tests/orm/test_fields/fields_aiida.node.process.workflow.workfunction.WorkFunctionNode.yml index d8928ee1a4..6639d94fba 100644 --- a/tests/orm/test_fields/fields_aiida.node.process.workflow.workfunction.WorkFunctionNode.yml +++ b/tests/orm/test_fields/fields_aiida.node.process.workflow.workfunction.WorkFunctionNode.yml @@ -1,12 +1,14 @@ -attributes: QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], +attributes: + QbDictField('attributes', dtype=typing.Optional[typing.Dict[str, typing.Any]], is_attribute=False, is_subscriptable=True) -computer: QbNumericField('computer', dtype=typing.Optional[int], is_attribute=False) +computer: QbNumericField('computer', dtype=typing.Optional[str], is_attribute=False) ctime: QbNumericField('ctime', dtype=typing.Optional[datetime.datetime], is_attribute=False) description: QbStrField('description', dtype=typing.Optional[str], is_attribute=False) exception: QbStrField('exception', dtype=typing.Optional[str], is_attribute=True) exit_message: QbStrField('exit_message', dtype=typing.Optional[str], is_attribute=True) exit_status: QbNumericField('exit_status', dtype=typing.Optional[int], is_attribute=True) -extras: QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], +extras: + QbDictField('extras', dtype=typing.Optional[typing.Dict[str, typing.Any]], is_attribute=False, is_subscriptable=True) label: QbStrField('label', dtype=typing.Optional[str], is_attribute=False) mtime: QbNumericField('mtime', dtype=typing.Optional[datetime.datetime], is_attribute=False) @@ -17,9 +19,11 @@ process_label: QbStrField('process_label', dtype=typing.Optional[str], is_attrib process_state: QbStrField('process_state', dtype=typing.Optional[str], is_attribute=True) process_status: QbStrField('process_status', dtype=typing.Optional[str], is_attribute=True) process_type: QbStrField('process_type', dtype=typing.Optional[str], is_attribute=False) -repository_content: QbDictField('repository_content', dtype=typing.Optional[dict[str, +repository_content: + QbDictField('repository_content', dtype=typing.Optional[dict[str, bytes]], is_attribute=False) -repository_metadata: QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, +repository_metadata: + QbDictField('repository_metadata', dtype=typing.Optional[typing.Dict[str, typing.Any]], is_attribute=False) sealed: QbField('sealed', dtype=, is_attribute=True) user: QbNumericField('user', dtype=typing.Optional[int], is_attribute=False)