-
Notifications
You must be signed in to change notification settings - Fork 235
Update node serialization/deserialization and other Pydantic issues #6990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
edan-bainglass
wants to merge
62
commits into
aiidateam:main
Choose a base branch
from
edan-bainglass:fix-node-serialization
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
7fc1ea0
Fix ORM pydantic schemas
edan-bainglass 5b76723
Add Kpoints constructor
edan-bainglass 90e08bf
Fix `Node.from_model`
edan-bainglass 2e4e231
Missed cast
edan-bainglass 3824387
Discard direct `orm` import from `cmdline` package
edan-bainglass 0da44c3
Allow unstored entity (de)serialization
edan-bainglass 9e41e53
Update tests
edan-bainglass 3bb2451
Fix computer type
edan-bainglass 5da92c3
Fix some typing issues
edan-bainglass e6d01ae
Allow (de)serialization of unstored nodes
edan-bainglass bf59376
Add guard for unhandled attributes at parent `Data` constructor
edan-bainglass 13b6ccc
Implement constructors for `KpointsData` and `BandsData`
edan-bainglass a667216
Fix tests
edan-bainglass b4c6cef
Serialize/validate arrays as numpy arrays, not bytes
edan-bainglass 8338657
Fix typing
edan-bainglass c55d068
Fix unhandled attributes check
edan-bainglass 5f8cfcd
Add `array_labels` back to `BandsData.Model` without constructor hand…
edan-bainglass 19f7b68
Nitpick some classes
edan-bainglass 773f22c
Fix docstring
edan-bainglass 424b2aa
Remove user/ctime/mtime default factories from read-only fields
edan-bainglass a28a45f
Include attributes in node input model
edan-bainglass 66d8dde
Remove some unrelated changes
edan-bainglass 5c87570
Make repo content serialization opt-in
edan-bainglass 85563be
Restore array base64 serialization
edan-bainglass 8ae7593
Discard explicit quotation for annotations
edan-bainglass c1f4239
Add field validator to transform computer pk to label
edan-bainglass d89fdcd
Fix `orm_to_model` type
edan-bainglass 234d919
Fix types
edan-bainglass da97155
Mark `InstalledCode.Model.computer` as an attribute
edan-bainglass 957308d
Fix `_prepare_yaml`
edan-bainglass 54ff1a8
Update regression tests
edan-bainglass 1a9435b
Centralize model field collection
edan-bainglass e65898e
Move unhandled node attributes gate to `Node` class
edan-bainglass f096b66
Add `attributes` to `Node` constructor
edan-bainglass 7d42525
Fix code fields
edan-bainglass 5be66a3
Fix centralized model field collection
edan-bainglass 285b7d2
Fix tests
edan-bainglass 67e6606
Enable `ArrayNode` numpy array POST payloads via model validator
edan-bainglass 0da4030
Allow arguments in `orm_to_model`
edan-bainglass 753eb2d
Fix formatting
edan-bainglass 17d7776
Fix `repository_path` default in portable code
edan-bainglass c3e9069
Fix iterable array posting
edan-bainglass 181eb10
Fix model inheritance
edan-bainglass 39ae6f8
Fix `from_serialized`
edan-bainglass 1e781f1
Rename `InputModel` and `as_input_model` to `CreateModel` and `as_cre…
edan-bainglass 1c51c7e
Discard `exclude_from_cli`
edan-bainglass 8968086
Exclude `attributes` from ORM
edan-bainglass a8c6178
Discard `unstored` from `from_serialized`
edan-bainglass c531320
Discard `unstored` serialization parameter
edan-bainglass ca381c0
Always pass `kwargs` to `orm_to_model`
edan-bainglass 9f5d293
Discard redundant class method in favor of correct model selection
edan-bainglass ebe1583
Use `is_stored` for model selection
edan-bainglass 3e700d6
Restore serialization of node `extras`
edan-bainglass 01ea414
Avoid using JSON Schema fields in `CreateModel` construction
edan-bainglass 7859cb2
Fix `readOnly` logic in `MetadataField`
edan-bainglass 035de42
Cleanup `CreateModel` definition
edan-bainglass 4da0a60
Add serialization for `JsonSerializableProtocol` model field type
edan-bainglass 95cd19a
Use pydantic built-in base64 (de)serialization
edan-bainglass ff576d1
Update QB projection map aliasing
edan-bainglass 0586747
Add `exclude` parameter to `to_model`
edan-bainglass 22ef919
Fix type hint
edan-bainglass ffdb1cb
Fix QB warning
edan-bainglass File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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]] | ||
|
Comment on lines
+170
to
+171
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The last argument of the tuple is the depth, which "can be used to control what level of nesting of the source folder hierarchy should be maintained". It is an integer. |
||
| 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]] | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer here we explicitly hardcode 'filepath_files', as it is the intended exclusion here.
is_attributeis used for other purposes, not for marking exclusion from the CLIshowcommand. Reminding @GeigerJ2 to open an issue (optionally reply here with a link to the issue).Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree, better to do it like this! I just created #7099 as a sub-issue of #7050, thanks for the reminder!