Skip to content
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

Orm design refactor #2190

Merged
merged 4 commits into from Nov 12, 2018
Merged

Orm design refactor #2190

merged 4 commits into from Nov 12, 2018

Conversation

muhrin
Copy link
Contributor

@muhrin muhrin commented Nov 12, 2018

Ported Computer, AuthInfo and User to new backend design where the user interacts with concrete classes which themselves contain the abstract class corresponding to the backend type for that class.

Having the user interact with concrete classes means that they can, amongst other things, instantiate them using the constructor and have the correct backend type be crated underneath (rather than using import magic as before).

There is also a corresponding Collection class for each object type to interact with the collection of those things eg. User.objects resolves to the collection of users and can be used to do things like delete users.

muhrin and others added 3 commits November 12, 2018 12:39
orm.User is now a concrete class.  Also get_automatic_user has been
replaced by:

from aiida.orm import User

User.objects.get_default()
Now the backend will not normalize the email because all User creation
is done through the concrete frontend class.
@coveralls
Copy link

Coverage Status

Coverage decreased (-7.3%) to 61.283% when pulling 4f28777 on muhrin:orm_design_refactor into eec38d8 on aiidateam:develop.

@coveralls
Copy link

coveralls commented Nov 12, 2018

Coverage Status

Coverage increased (+0.2%) to 68.83% when pulling ce2eef4 on muhrin:orm_design_refactor into eec38d8 on aiidateam:develop.

Copy link
Contributor

@sphuber sphuber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor changes. In addition, we might want to remove explicitly passing in the backend in objects() calls in the tests and just use the property to pass in the backend that is defined for the currently loaded profile

aiida/orm/computers.py Outdated Show resolved Hide resolved
aiida/backends/tests/cmdline/commands/test_node.py Outdated Show resolved Hide resolved
aiida/backends/tests/cmdline/commands/test_data.py Outdated Show resolved Hide resolved
aiida/orm/implementation/authinfos.py Outdated Show resolved Hide resolved
@sphuber sphuber merged commit 7ea30a7 into aiidateam:develop Nov 12, 2018
@muhrin muhrin deleted the orm_design_refactor branch November 12, 2018 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants