-
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
Fix 2183 Update QB Relationship Indicators #2224
Fix 2183 Update QB Relationship Indicators #2224
Conversation
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 |
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
Coverage decreased (-7.1%) to 61.71% when pulling d1b68df4734100d1fd984a8194e3a09e2c0df414 on ConradJohnston:Fix_2183_Update_QB_Relationship_Indicators into aa79072 on aiidateam:provenance_redesign. |
c5a796d
to
c3ec654
Compare
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
c3ec654
to
61b9126
Compare
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.
Absolutely grand!
Fixes #2183 .
Changes the existing QueryBuilder join types from
input_of
andoutput_of
towith_outgoing
andwith_incoming
respectively. For now,ancestor_of
,descendant_of
remain in use. The remaining join types are changed towith_{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, fromaiida.common.warnings
. This warning has the advantage of working with pycharm and not being swallowed likeDeprecationWarning
. All deprecation warnings in the code have now been replaced by this new warning and the documentation has been updated.