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

Fix 2183 Update QB Relationship Indicators #2224

Conversation

ConradJohnston
Copy link
Contributor

Fixes #2183 .

Changes the existing QueryBuilder join types frominput_ofand output_of to with_outgoing and with_incoming respectively. For now, ancestor_of, descendant_of remain in use. The remaining join types are changed to with_{entity} where the type of join performed depends contextually on the class passed in the qb.append() method. For example:
QueryBuilder().append(User, tag='u').append(Group, with_user='u').all()
Throughout the code, the old relationships have been replaced.

The old methods, if used, now print a deprecation warning, provided by the new AiidaDeprecationWarning class, from aiida.common.warnings. This warning has the advantage of working with pycharm and not being swallowed like DeprecationWarning. All deprecation warnings in the code have now been replaced by this new warning and the documentation has been updated.

@sphuber
Copy link
Contributor

sphuber commented Nov 20, 2018

I will have a look at it tomorrow. I can also show you then how to interactively rebase, so you can squash commits into nice commits, without losing the proper attribution to each one of you

@coveralls
Copy link

Coverage Status

Coverage decreased (-7.1%) to 61.71% when pulling d1b68df4734100d1fd984a8194e3a09e2c0df414 on ConradJohnston:Fix_2183_Update_QB_Relationship_Indicators into aa79072 on aiidateam:provenance_redesign.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-7.1%) to 61.71% when pulling d1b68df4734100d1fd984a8194e3a09e2c0df414 on ConradJohnston:Fix_2183_Update_QB_Relationship_Indicators into aa79072 on aiidateam:provenance_redesign.

@coveralls
Copy link

coveralls commented Nov 20, 2018

Coverage Status

Coverage decreased (-0.03%) to 68.793% when pulling 61b9126 on ConradJohnston:Fix_2183_Update_QB_Relationship_Indicators into bd59481 on aiidateam:provenance_redesign.

@ConradJohnston ConradJohnston force-pushed the Fix_2183_Update_QB_Relationship_Indicators branch from c5a796d to c3ec654 Compare November 21, 2018 11:05
giovannipizzi and others added 2 commits November 21, 2018 15:39
Also did some fixes to make sure that warnings are not suppressed
by the re-configuration of the loggers by Django.

Adding trajectory to prospector, and replacing NotImplementedError
with FeatureNotAvailable or other custom exceptions where appropriate
to avoid that propsector complains that it is a abstract method
Renames the querybuilder relationship names used for joins to the scheme.
Previously, complex names where used, but these were hard to remember. The new
scheme uses simple generic names, e.g. "with_computer" and gets the required
context from the class which is specified in the qb.append() method.

The main changes are:
1. - Change the relationship function map to a two-level dictionary, where the first
     level provides the context, indicating what class of node the relationship applies to.
2. - Add deprecation messages which are printed when the join functions are called
     using the old relationship names
3. - Remove the unimplemented "join_slaves/join_masters" methods

In addition, moving all deprecation warnings to the new system
(AiidaDeprecationWarning) and removing some very old deprecations
@ConradJohnston ConradJohnston force-pushed the Fix_2183_Update_QB_Relationship_Indicators branch from c3ec654 to 61b9126 Compare November 21, 2018 14:49
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.

Absolutely grand!

@sphuber sphuber merged commit eaee1cc into aiidateam:provenance_redesign Nov 21, 2018
@ConradJohnston ConradJohnston deleted the Fix_2183_Update_QB_Relationship_Indicators branch November 21, 2018 15:22
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.

4 participants