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

[DOC] Adding minimal working examples to docstrings; a checklist #972

Closed
64 of 67 tasks
thatlittleboy opened this issue Jan 2, 2022 · 27 comments · Fixed by #1089
Closed
64 of 67 tasks

[DOC] Adding minimal working examples to docstrings; a checklist #972

thatlittleboy opened this issue Jan 2, 2022 · 27 comments · Fixed by #1089
Labels
good first issue Good for newcomers

Comments

@thatlittleboy
Copy link
Contributor

thatlittleboy commented Jan 2, 2022

Background

This thread is borne out of the discussion from #968 , in an effort to make documentation more beginner-friendly & more understandable.
One of the subtasks mentioned in that thread was to go through the function docstrings and include a minimal working example to each of the public functions in pyjanitor.

Criteria reiterated here for the benefit of discussion:

It should fit with our existing choice to go with mkdocs, mkdocstrings, and mknotebooks.
The examples should be minimal and executable and complete execution within 5 seconds per function.
The examples should display in rich HTML on our docs page.
We should have an automatic way of identifying whether a function has an example provided or not so that every function has an example.

Sample of what MWE should look like is shown here.


I'm thinking we can create a task list so that 1. we can encourage more users to join in the effort, and 2. make sure we don't do duplicate work. A lot of the groundwork can be covered by selectively copying one or two examples over from the software test suite.

Then we can label this issue as a Help Wanted / Low-Hanging Fruit and get people to mention in this thread if they're intending to work on the files?

Task list

  • functions/add_columns.py
  • functions/also.py
  • functions/bin_numeric.py
  • functions/case_when.py
  • functions/change_type.py
  • functions/clean_names.py
  • functions/coalesce.py
  • functions/collapse_levels.py
  • functions/complete.py
  • functions/concatenate_columns.py
  • functions/conditional_join.py
  • functions/convert_date.py
  • functions/count_cumulative_unique.py
  • functions/currency_column_to_numeric.py
  • functions/deconcatenate_column.py
  • functions/drop_constant_columns.py
  • functions/drop_duplicate_columns.py
  • functions/dropnotnull.py
  • functions/encode_categorical.py
  • functions/expand_column.py
  • functions/expand_grid.py
  • functions/factorize_columns.py
  • functions/fill.py
  • functions/filter.py
  • functions/find_replace.py
  • functions/flag_nulls.py
  • functions/get_dupes.py
  • functions/groupby_agg.py
  • functions/groupby_topk.py
  • functions/impute.py
  • functions/jitter.py
  • functions/join_apply.py
  • functions/label_encode.py
  • functions/limit_column_characters.py
  • functions/min_max_scale.py
  • functions/move.py
  • functions/pivot.py
  • functions/process_text.py
  • functions/remove_columns.py
  • functions/remove_empty.py
  • functions/rename_columns.py
  • functions/reorder_columns.py
  • functions/round_to_fraction.py
  • functions/row_to_names.py
  • functions/select_columns.py
  • functions/shuffle.py
  • functions/sort_column_value_order.py
  • functions/sort_naturally.py
  • functions/take_first.py
  • functions/then.py
  • functions/to_datetime.py
  • functions/toset.py
  • functions/transform_columns.py
  • functions/truncate_datetime.py
  • functions/update_where.py
  • spark/backend.py
  • spark/functions.py
  • xarray/functions.py
  • biology.py
  • chemistry.py
  • engineering.py
  • errors.py
  • finance.py
  • io.py
  • math.py
  • ml.py
  • timeseries.py
    B
@thatlittleboy
Copy link
Contributor Author

thatlittleboy commented Jan 2, 2022

  • functions/bin_numeric.py is already in PR

I'm currently having a look at

  • functions/rename_columns.py
  • functions/reorder_columns.py
  • functions/to_datetime.py
  • functions/also.py
  • functions/then.py
  • functions/dropnotnull.py
  • functions/groupby_agg.py
  • functions/flag_nulls.py

Will probably look at some more as and when I have time over the next week or so

@ericmjl
Copy link
Member

ericmjl commented Jan 2, 2022

This is awesome, @thatlittleboy! Thank you for handling this here 😄. I've invited you to the dev team to help move this along.

@ericmjl
Copy link
Member

ericmjl commented Jan 8, 2022

One trick I'm finding is that it's pretty easy to create a minimal working example from the test suite 😹.

@thatlittleboy
Copy link
Contributor Author

thatlittleboy commented Jan 10, 2022

Ongoing sprint, dibs on the following:

  • functions/change_type.py
  • functions/coalesce.py
  • functions/collapse_levels.py
  • functions/filter.py

@ericmjl
Copy link
Member

ericmjl commented Jan 11, 2022

Same here, dibs on:

  • functions/take_first.py
  • functions/sort_naturally.py

@ericmjl
Copy link
Member

ericmjl commented Jan 12, 2022

Dibs on:

  • functions/min_max_scale.py
  • functions/move.py

Two per PR seems to be the load that I personally can handle 😹.

@thatlittleboy
Copy link
Contributor Author

Ongoing sprint:

  • functions/concatenate_columns.py
  • functions/deconcatenate_column.py
  • functions/select_columns.py

@ericmjl
Copy link
Member

ericmjl commented Jan 22, 2022

Going to work on:

  • functions/drop_constant_columns.py
  • functions/drop_duplicate_columns.py

@thatlittleboy
Copy link
Contributor Author

Ongoing sprint:

  • functions/move.py
  • functions/remove_columns.py
  • functions/remove_empty.py
  • functions/limit_column_characters.py

@thatlittleboy
Copy link
Contributor Author

thatlittleboy commented Feb 4, 2022

Ongoing sprint:

  • functions/round_to_fraction.py
  • functions/row_to_names.py
  • functions/shuffle.py

@thatlittleboy
Copy link
Contributor Author

thatlittleboy commented Feb 20, 2022

Currently looking at:

  • functions/impute.py
  • functions/jitter.py
  • functions/join_apply.py

Also in the midst of updating:

  • functions/encode_categorical.py
  • functions/label_encode.py
  • functions/factorize_columns.py

@SamBauter
Copy link

Pycon 2022 - working on timeseries.py

@gahjelle
Copy link
Contributor

gahjelle commented May 2, 2022

I'll also do functions/find_replace.py

@Econundrums
Copy link
Contributor

I'll do functions/fill.py

@ethompsy
Copy link
Contributor

ethompsy commented May 2, 2022

Pycon 2022 - working on functions/get_dupes.py

@ethompsy
Copy link
Contributor

ethompsy commented May 2, 2022

Pycon 2022 - working on functions/groupby_topk.py

@ashenafiya ashenafiya mentioned this issue May 2, 2022
3 tasks
@gahjelle
Copy link
Contributor

gahjelle commented May 2, 2022

I'll do math.py

@Econundrums
Copy link
Contributor

Dibs on functions/transform_columns.py

catherinedevlin pushed a commit to catherinedevlin/pyjanitor that referenced this issue May 2, 2022
@catherinedevlin
Copy link
Contributor

For my next trick, I'd like to do biology.py

@Econundrums
Copy link
Contributor

It looks like transform_columns.py is already done :(

Dibs on update_where.py

ericmjl pushed a commit that referenced this issue May 2, 2022
* include gcc in container

* Doctests in chemistry.py docstrings - #972

Co-authored-by: Catherine Devlin <catherine.devlin@disneystreaming.com>
@dancassin
Copy link
Contributor

Dibs on finance.py

@gahjelle
Copy link
Contributor

gahjelle commented May 2, 2022

I'll do ml.py next

@gahjelle
Copy link
Contributor

gahjelle commented May 2, 2022

I'll do xarray/functions.py

ericmjl pushed a commit that referenced this issue May 2, 2022
* include gcc in container

* doc-972-doctests-in-biology

Co-authored-by: Catherine Devlin <catherine.devlin@disneystreaming.com>
@samukweku samukweku mentioned this issue May 8, 2022
3 tasks
@Zeroto521
Copy link
Member

functions/min_max_scale.py done via #1107 and #1112

@thatlittleboy thatlittleboy unpinned this issue Jul 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants