Changes to Data class attributes and TrajectoryData data storage#2422
Merged
sphuber merged 2 commits intoFeb 8, 2019
Merged
Conversation
90130f2 to
2ef384d
Compare
Data class attributes and TrajectoryData data storage
2ef384d to
81c5794
Compare
Contributor
|
@giovannipizzi and @asle85 I have cleaned Elsa's commits and squashed them into a single one on top of Andreas'. Since this was quite a complicated process due to various merge actions having created duplicate commits, there may have been some changes that have been lost. I doubt it but it would be good if you guys can check if in the changes everything is still there. |
81c5794 to
3b8556e
Compare
Methods changed to properties: * `Code.is_hidden` * `RemoteData.is_empty` Name changes: * `ArrayData.iterarrays` to `ArrayData.get_iterarrays` * `Code.full_text_info` to `Code.get_full_text_info` * `Code.is_hidden` to `Code.hidden` * `StructureData._get_cif` to `StructureData.get_cif` * `TrajectoryData._get_aiida_structure` to * `TrajectoryData.get_structure` * `TrajectoryData._get_cif` to `TrajectoryData.get_cif` Data structure storage changes: * Symbols in `TrajectoryData` are now passed as a list instead of * `numpy.ndarray` * Symbols in `TrajectoryData` are now stored as an attribute instead of * an array in the repository * `TrajectoryData.set_trajectory` arguments `stepid` and `cells` are now optional Change `TrajectoryData` to make passing stepids and cells optional. While nothing will be stored for cells if not given a consecutive sequence will be automatically assigned to stepids if missing from the inputs.
f9143b5 to
b515dc6
Compare
In the previous commit, the ORM for `TrajectoryData` was changed to start storing the `symbols` as a list in the attributes of the node instead of a `numpy` array in the repository, to make it possible to query for the symbols. This requires a data migration which is implemented in this commit. Since it involves the deletion of the data from the repository after it has been copied to the database, the migration is performed in two stages. The first will copy the data from the repository to the attributes on the node and the second will delete the data in the repository. In this way, if an exception occurs during the migration, no data will be lost.
b515dc6 to
5355a8b
Compare
sphuber
approved these changes
Feb 8, 2019
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
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 #201
Added migrations and tests for TrajectoryData symbols (from numpy array to attribute).
In sqlalchemy migrations and test I used load_node; to discuss if we want to rewrite it to avoid using aiida functionality (e.g. to get and delete numpy arrays).