-
Notifications
You must be signed in to change notification settings - Fork 191
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
Migrate Node
to the new backend interface
#2481
Merged
Merged
Conversation
This file contains 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
sphuber
force-pushed
the
fix_2233_node_to_new_backend
branch
from
February 14, 2019 16:48
8fae6c1
to
1e5afdf
Compare
sphuber
force-pushed
the
fix_2233_node_to_new_backend
branch
2 times, most recently
from
February 15, 2019 13:31
18e0466
to
05fc2c3
Compare
The following parts have been moved: * Utility functions * Methods interacting with extras * Methods interacting with users * Methods interacting with computer * Methods interacting with comments
The following parts have been moved: * Methods interacting with attributes * Methods interacting with the label and description * Methods related to links * Methods related to storing a node Additionally, actual business logic is removed from the legacy workflow database models, because they were referencing the node code that is to be migrated, but the model classes are only kept such that a migration to drop the tables is not yet necessary. The API to run legacy workflows had already been dropped in a previous commit and is no longer supported.
sphuber
force-pushed
the
fix_2233_node_to_new_backend
branch
4 times, most recently
from
February 15, 2019 14:08
de3b5e7
to
c559700
Compare
A new abstract interface has been defined for `BackendNode` in the module `aiida.orm.implementation.nodes`. This has subsequently been implemented for the two current database backends Django and SqlAlchemy. The role of the `BackendNode` class is to provide a single interface, independent on the database backend implementation, to store and retrieve data from `Node` instances in the database. The front end `Node` class will then only ever interact with the backend entity that it encapsulates and shall never directly interact with the database model that is encapsulated within the `BackendNode` class. This commit deprecates quite a few methods from the old node class, notably all methods of the variant `*_db_*` that retrieved or set data directly from the database. These are now part of the `BackendNode` interface, but since all its methods will operate directly on the database, the `db` infix has been dropped. All business logic that does not operate directly on database data, such as the caching of links and attributes of unstored nodes, is implemented in the front end ORM class `aiida.orm.node.Node`. Also the biggest part of the business logic is implemented here, to keep the backend layer thin and lean.
sphuber
force-pushed
the
fix_2233_node_to_new_backend
branch
from
February 15, 2019 14:40
c559700
to
08e422c
Compare
That's great!!!! |
giovannipizzi
approved these changes
Feb 15, 2019
This was referenced Feb 15, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #2233
A new abstract interface has been defined for
BackendNode
in themodule
aiida.orm.implementation.nodes
. This has subsequently beenimplemented for the two current database backends Django and SqlAlchemy.
The role of the
BackendNode
class is to provide a single interface,independent on the database backend implementation, to store and
retrieve data from
Node
instances in the database. The front endNode
class will then only ever interact with the backend entity thatit encapsulates and shall never directly interact with the database
model that is encapsulated within the
BackendNode
class.This commit deprecates quite a few methods from the old node class,
notably all methods of the variant
*_db_*
that retrieved or set datadirectly from the database. These are now part of the
BackendNode
interface, but since all its methods will operate directly on the
database, the
db
infix has been dropped.All business logic that does not operate directly on database data, such
as the caching of links and attributes of unstored nodes, is implemented
in the front end ORM class
aiida.orm.node.Node
. Also the biggest partof the business logic is implemented here, to keep the backend layer
thin and lean.