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

Docs: Move in section on QueryBuilder to How-To #4080

Merged
merged 4 commits into from
May 28, 2020

Conversation

mbercx
Copy link
Member

@mbercx mbercx commented May 18, 2020

Fixes #3996

Move in the sections on the QueryBuilder to the 'Finding and querying for data' How-to of the revamped documentation.

Changes quite a bit of the section on the appender method:

  • Switches the examples to simple ones that are based on the ArithmeticAddCalculation process.
  • Gives the text a large overhaul. The text tries to be consistent in terminology, but this can probably still be improved. We should try and introduce terms like 'vertex', 'edge', etc. when they are first mentioned.

The section on the queryhelp has been largely left 'as is', save for the introduction and some reformatting along the new style guidelines.

@mbercx
Copy link
Member Author

mbercx commented May 18, 2020

I'm still not 100% happy with the current text, but I figured it would be good to first get some feedback on the content. Some open questions in this regard:

  • The How-To section now only explains the use of the QueryBuilder. Should other ways of finding data be discussed here?
  • The How-To is now rather long. Is this an issue?
  • How detailed should the section on the queryhelp be?

@mbercx mbercx requested review from ltalirz and csadorf May 18, 2020 12:31
Copy link
Contributor

@csadorf csadorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much! I've provided some comments and suggestions. I suggest that we address those first and then we revisit your concerns.

docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
@csadorf csadorf removed this from the Publish revised documentation milestone May 18, 2020
@sphuber
Copy link
Contributor

sphuber commented May 19, 2020

I was just discussing with @mbercx and we think the current page for the QueryBuilder is too extensive for the how-to. We were thinking then to move the existing content to a "Topic" section, with complete and detailed information on the builder and have a distilled version for the How-to section that really focuses on the basics. @csadorf and @ltalirz what do you think?

@csadorf
Copy link
Contributor

csadorf commented May 19, 2020

I was just discussing with @mbercx and we think the current page for the QueryBuilder is too extensive for the how-to. We were thinking then to move the existing content to a "Topic" section, with complete and detailed information on the builder and have a distilled version for the How-to section that really focuses on the basics. @csadorf and @ltalirz what do you think?

I agree notwithstanding that some of the content would better be placed within the reference chapter (see related comments).

docs/source/howto/data.rst Outdated Show resolved Hide resolved
@mbercx mbercx linked an issue May 25, 2020 that may be closed by this pull request
@mbercx
Copy link
Member Author

mbercx commented May 26, 2020

Thanks @csadorf and @sphuber for the comments! To distill the how-to, I was thinking of limiting the sections to the following:

  1. Selecting entities
  2. Retrieving results
  3. Filters
  4. Relationships
  5. Projections

And moving the other sections to the topics, perhaps under "advanced querying"?

For the reference section, do I simply make a querybuilder page in the top level reference section, or should this be part of a larger page that also contains references for other parts of the documentation?

@mbercx mbercx force-pushed the fix/3996/docs-howto-find-data branch from aa404e6 to 7252417 Compare May 26, 2020 16:39
@csadorf
Copy link
Contributor

csadorf commented May 26, 2020

Thanks @csadorf and @sphuber for the comments! To distill the how-to, I was thinking of limiting the sections to the following:

  1. Selecting entities
  2. Retrieving results
  3. Filters
  4. Relationships
  5. Projections

And moving the other sections to the topics, perhaps under "advanced querying"?

I think I need to see this to be really able to make a call. Maybe give it a shot and we see how it pans out?

For the reference section, do I simply make a querybuilder page in the top level reference section, or should this be part of a larger page that also contains references for other parts of the documentation?

Since the QueryBuilder is part of the Python API, I'd document this as part of the class doc-string and link there.

@mbercx mbercx requested a review from csadorf May 26, 2020 19:05
docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
@csadorf
Copy link
Contributor

csadorf commented May 27, 2020

I think this has the right length and scope now. I am really happy with the section now.

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.

Thanks a lot @mbercx . Really like the structure, scope and length. Just have some suggestions. Also do not forget to make clear here that we are only moving part of the existing docs, that is rephrased as well, and not all the content that is removed is addressed here. But you will do this in a separate PR for another issue. Would be good to link it once we decided which issue it will be

docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
docs/source/howto/data.rst Outdated Show resolved Hide resolved
@mbercx mbercx force-pushed the fix/3996/docs-howto-find-data branch from 02dd9ad to b502de0 Compare May 27, 2020 18:27
@mbercx
Copy link
Member Author

mbercx commented May 27, 2020

Thanks again @sphuber and @csadorf for the suggestions and discussion! A few notes:

  • The links to the "advanced queries" topics section do not work, as the target link is in another branch. I'll try to clean this branch up and create a PR tomorrow.
  • I've rewritten the projection subsection, to separate the last-entity and instances behaviour. Hopefully this is now less confusing.

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.

Honest to god, these are the last two comments :) and then we can merge

@@ -404,4 +659,4 @@ Notice that we haven't specified any port in the URLs since Apache listens conve

.. _#3996: https://github.com/aiidateam/aiida-core/issues/3996
.. _#3997: https://github.com/aiidateam/aiida-core/issues/3997
.. _#3998: https://github.com/aiidateam/aiida-core/issues/3998
.. _#3998: https://github.com/aiidateam/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an accidental change I imagine? You can restore this and actually remove the link for 3996, which is the one this PR solves

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this was accidental. I must have gotten a little overzealous while slimming down the section. ^^


qb = QueryBuilder()
qb.append(CalcJobNode, tag='calcjob')
qb.append(Int, with_incoming='calcjob', project=['id', '*', 'attributes.value'])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering: projecting both the instance and separate values might not make the most sense in most cases, as you can always get those properties from the instance once loaded. Note sure if it matters here, or if this slightly weird example may cause some confusion

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point! The idea was to introduce project='*' to another query to show that you can use '*' like any other projection. I've moved this concept to the next query example.

@mbercx mbercx requested a review from sphuber May 28, 2020 07:10
Copy link
Contributor

@csadorf csadorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect ! 👍

@sphuber sphuber merged commit 005acdf into aiidateam:docs-revamp May 28, 2020
@sphuber
Copy link
Contributor

sphuber commented May 28, 2020

Promises Made - Promises Kept 😉

Thanks @mbercx !

@sphuber sphuber mentioned this pull request May 28, 2020
@mbercx mbercx deleted the fix/3996/docs-howto-find-data branch May 28, 2020 08:15
csadorf pushed a commit that referenced this pull request May 29, 2020
Move in the sections on the `QueryBuilder` to the How-to section called

    "Finding and querying for data"

The original text was too extensive for the purposes of the How-to and
so it has been split in two. The detailed information on advanced
queries will be added in another PR in the section "Topic - Database".

The text for this How-to has been adapted from the original text with
significant changes in the structure and simplifying the examples. Here
wherever possible they use the `ArithmeticAddCalculation` for consistency
with other sections and tutorials. The new structure is as follows:

    * Selecting entities
    * Retrieving results
    * Filters
    * Relationships
    * Projections
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: How to find data
3 participants