Add minimal examples to API documentation#1243
Conversation
dougbrn
left a comment
There was a problem hiding this comment.
Nice, I have one larger structural comment, which is that these examples will try to be run by doctest I believe, so anything that produces output will need output alongside the input. That may even result in failed tests, though we wouldn't know for sure until the CI decides to actually do something (not sure what's going on there).
It's also good for these to have output for usefulness, check out map_rows for an example of that: https://docs.lsdb.io/en/latest/reference/api/lsdb.catalog.Catalog.map_rows.html
Generally, running these code blocks on command line will get you a copy-pastable output to put in the docstring.
I'm not sure what the best practice would be for the examples that generate plots...
Click here to view all benchmarks. |
|
I did not add output for plotting function or for write_catalog (for write catalog I even have dummy output PATH in the example, i.e., the code cant work automatically the way it is written). Not sure what to do there? I am also a bit worried about formatting. Is that a problem? My examples look like
while your example in map_rows looks like(difference is _healpix_29 is is in the same row as other columns, index is in front):
|
|
@nevencaplar the formatting does matter for the CI, you can lean on the actual failed test results on this PR to see what it expects: In cases where the code is actually non-operable, at least for CI, I think it's okay to let CI skip it, by adding |
|
Additionally, with LSDB's current setup pre-commit and doctest disagree on formatting, you will probably want to add |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1243 +/- ##
=======================================
Coverage 96.66% 96.66%
=======================================
Files 46 46
Lines 2877 2877
=======================================
Hits 2781 2781
Misses 96 96 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I believe that all tests are passing, through combination of |
Closes #1240.