-
Notifications
You must be signed in to change notification settings - Fork 189
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 Groups great again #2329
Make Groups great again #2329
Conversation
Also fixes #2075. Group documentation is still missing |
This commit should also fix the ambiguity of Group type as reported in #160 since we now rename type with type_string |
@giovannipizzi I looked at all Group-related issues and commented them in this PR. What is still missing is:
|
@yakutovicha I suggest to add a section Btw, you can now inspect the docs of the provenance-redesign branch here: |
thanks @ltalirz |
As we discussed today with @giovannipizzi I should also:
|
thanks @sphuber, your trick with auto groups did work |
I think it is now done. @sphuber would you like to review the PR? I am not sure whether @giovannipizzi will have time for that. |
I am not sure why travis fails from time to time. I restarted the test and everything went fine. |
@yakutovicha we merged migrations yesterday, so there will be conflicts if we update the branch. Please rebase your branch on the current |
it is done now |
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.
Very nice work @yakutovicha , I have a few comments, but should not take too long to address them
aiida/backends/djsite/db/migrations/0021_dbgroup_name2label_type2type_string.py
Outdated
Show resolved
Hide resolved
aiida/backends/djsite/db/migrations/0022_dbgroup_type_string_change_content.py
Outdated
Show resolved
Hide resolved
.../backends/sqlalchemy/migrations/versions/b8b23ddefad4_dbgroup_name2label_type2type_string.py
Outdated
Show resolved
Hide resolved
1) aiida.orm.importexport: while importing data from the export file allow to specify user-defined group and to put all the imported data in this group 2) aiida.common.utils: a) remove get_group_type_mapping function which was mapping machine-specific group names with the user-friendly ones 3) aiida.orm.groups a) Add GroupTypeString (Enum) which contains all allowed group types: data.upf (previously was 'data.upf.family') , auto.import (previously was 'aiida.import'), auto.run (previously was 'autogroup.run'), user (previously was '') b) Remove Group.query and Group.group_query functions, as they are redundant. Their functionality can be replaced by QueryBuilder() 3) aiida.orm.data.upf: a) Set UPFGROUP_TYPE from GroupTypeString.UPFGROUP_TYPE.value defined in aiida.common.utils b) Replace the usage of Group.query() by QueryBuilder() in get_upf_groups and get_upf_family_names functions 4) aiida.orm.autogroup: set VERDIAUTOGROUP_TYPE from GroupTypeString.VERDIAUTOGROUP_TYPE.value defined in aiida.common.utils 5) aiida.common.utils: add escape_for_sql_like that escapes % or _ symbols provided by user 6) aiida.cmdline.commands.cmd_group.py a) Add copy option b) "list": replace Group.query() with QueryBuilder c) Add option to show all available group types d) Add defaulf for group_type option e) remove usage of the get_group_type_mapping() function 7) aiida.cmdline.commands.cmd_import.py: add a posibility to chose the group where all the imported nodes will be put in. 8) aiida.cmdline.params.types.group.py add a possibility to the group parameter to create new group 9) dj and sqla backends: in Group (and tests, resapi) replace name with label and type with type_string 10) Add Groups documentation 11) Keep name and type for back-compatibility 12) Improve documentation for django and sqla backends migration
@sphuber I implemented your suggestions, please review it again. |
Fixes #2075 and fixed #160
aiida.orm.importexport
group and to put all the imported data in this group
aiida.common.utils
get_group_type_mapping
function which was mappingmachine-specific group names with the user-friendly ones
%
or_
symbols provided by useraiida.orm.groups
GroupTypeString
enum which contains all allowed group types:data.upf (was
data.upf.family
)auto.import (was
aiida.import
)auto.run (was
autogroup.run
)user (was empty string)
Group.query
andGroup.group_query
methods, as they are redundantaiida.orm.data.upf
:UPFGROUP_TYPE
toGroupTypeString.UPFGROUP_TYPE
Group.query
byQueryBuilder
inget_upf_groups
and
get_upf_family_names
methodsaiida.orm.autogroup
:VERDIAUTOGROUP_TYPE
toGroupTypeString.VERDIAUTOGROUP_TYPE
aiida.cmdline.commands.cmd_group
verdi group copy
Group.query
withQueryBuilder
inverdi group list
aiida.cmdline.commands.cmd_import
aiida.cmdline.params.types.group
GroupParamType
to create groups if they don't existaiida.backend*
:type
andname
totype_string
andlabel
for the database modelsImprove documentation for django and sqla backends migration