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

DM-46178: Documentation fixes for new query system #1149

Merged
merged 6 commits into from
Jan 31, 2025
Merged

Conversation

kfindeisen
Copy link
Member

@kfindeisen kfindeisen commented Jan 29, 2025

This PR addresses various documentation issues that came up while working on lsst-dm/prompt_processing#249.

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes
  • (if changing dimensions.yaml) make a copy of dimensions.yaml in configs/old_dimensions

Copy link

codecov bot commented Jan 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.47%. Comparing base (440f5ac) to head (c2c0ee8).
Report is 7 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1149   +/-   ##
=======================================
  Coverage   89.47%   89.47%           
=======================================
  Files         366      366           
  Lines       49115    49115           
  Branches     5955     5955           
=======================================
  Hits        43944    43944           
  Misses       3753     3753           
  Partials     1418     1418           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kfindeisen kfindeisen requested a review from TallJimbo January 30, 2025 00:23
Copy link
Member

@TallJimbo TallJimbo left a comment

Choose a reason for hiding this comment

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

For future reference, I think I prefer Sphinx's relative-name syntax (leading . for each parent level to move up) to qualifying everything with absolute module names, and I don't consider being able to reference a name in the exact same package without qualification to be lucky; it's correctly concise and just about the only part of Sphinx's name resolution rules/syntax that works like it should.

But this is a big improvement over the previous situation that you didn't have to contribute to get your work done, so I'm certainly not going to ask you to redo it here!

This might also be a good time to see if @timj, @dhirving, and @andy-slac have different opinions on how to handle namespaced references in docs.

python/lsst/daf/butler/queries/_base.py Outdated Show resolved Hide resolved
@kfindeisen
Copy link
Member Author

For future reference, I think I prefer Sphinx's relative-name syntax (leading . for each parent level to move up) to qualifying everything with absolute module names, and I don't consider being able to reference a name in the exact same package without qualification to be lucky; it's correctly concise and just about the only part of Sphinx's name resolution rules/syntax that works like it should.

The problem is that this is not a matter of "preference" -- the Sphinx links simply do not, and cannot, work the way you seem to think they do. The Sphinx parser does not have access to the source code, and evaluates relative links based on the package in which the component is documented. If a component is lifted into a higher-level namespace (a decision that often happens independently of writing the docstrings), links are relative to that. If it is documented in both high-level and low-level namespaces (as is common in MW), then any relative links will work in at most one of those places.

So I stand by my statement that the working links were such only through luck: many, if not most, of the links I fixed look like the writer assumed that the referenced component was in the same package when, in the context of the documentation, it wasn't.

@TallJimbo
Copy link
Member

I'm aware the syntax and lookup behavior is not the same as Python's actual import system (which is mind-bogglingly frustrating), but there is a relative syntax that does work, if you take into account where things are documented rather than where they are declared.

timj and others added 6 commits January 31, 2025 10:02
Many links were provided unqualified (and, therefore, attempted to be
resolved relative to the documentation namespace), and a few referred
to types that don't actually exist.

A few links previously worked by chance because they happened to be to
immediate members of `daf.butler.queries`. These have been replaced
with absolute links to make them more robust.
Some of the Query documentation conflated datasets with dataset types;
I've tried to correct the references.
A note for Query.datasets speaks of querying multiple dataset types,
even though it explicitly only supports single-type queries. I assume
this text was copy-pasted from Registry.queryDatasets.
The previous description referred to table joins and other
implementation details, which are not (and need not be) visible to
users.
GeneralQueryResults.iter_tuple (and DatasetAssociation.from_query_result, which
calls it) assume dataset_id and run columns for the dataset type(s) of
interest. However, these columns do not exist unless the query call
specifically asks for them.
@kfindeisen kfindeisen merged commit 3a57374 into main Jan 31, 2025
19 checks passed
@kfindeisen kfindeisen deleted the tickets/DM-46178 branch January 31, 2025 18:27
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.

3 participants