-
Notifications
You must be signed in to change notification settings - Fork 192
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
Make Code
a real sub class of Data
#2193
Make Code
a real sub class of Data
#2193
Conversation
Simplify code where nodes have had to be treated as either Code type or Data type.
3323169
to
c378d01
Compare
Code
a real sub class of Data
By making `Code` a proper sub class of `Data` instead of `Node`, its type string is also changed from `code.Code.` to `data.code.Code.` so we add a migration to update these for existing databases. In addition, the `aiida:code` plugin group no longer makes sense and so the entry point for the `Code` class is moved to `aiida.data:code`. The entity loaders and `QueryBuilder` will now do the right thing after updating the entry point loader logic to treat `Code` as a sub class of `Data`. Finally, the `Code` class no longer needed any backend specific code, so the `AbstractCode` class is made concrete, moved to `aiida.orm.data.code` and the backend specific implementations are removed.
c378d01
to
2c2fbc8
Compare
@giovannipizzi @muhrin this is now ready for review. @ConradJohnston requested me, but since I have now changed a significant portion as well, I think it is a good idea if one of you has a gander. I have made the code class concrete by removing the remaining backend dependent methods and moved it to |
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.
Fantastic!
|
||
if qb.count() == 0: | ||
raise NotExistent("'{}' is not a valid code " | ||
"name.".format(label)) | ||
raise NotExistent("'{}' is not a valid code " "name.".format(label)) |
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.
There are a few of " "
around, I guess after yapf, that could be fixed, maybe in a different PR.
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 will make a note, we can do one great sweep at the end of this project
Nice one @sphuber , thank you! |
Fixes #2173 .
Subclasses Code from Data rather than Node, and simplifies places in the code where code had to be treated as a 'special' data-like node.