Skip to content

Conversation

@machow
Copy link
Collaborator

@machow machow commented Mar 15, 2023

This PR adds an article to the docs, that is a translation of "create consistent metadata for pins". It uses a pandas Categorical for the factor.

@machow machow marked this pull request as ready for review March 15, 2023 14:24
@machow machow requested a review from juliasilge March 15, 2023 14:25
@machow
Copy link
Collaborator Author

machow commented Mar 15, 2023

@juliasilge do you mind taking a quick look at the article? https://pr-188--pins-python.netlify.app/articles/customize-pins-metadata.html

Hopefully it looks very familiar 😄

@machow
Copy link
Collaborator Author

machow commented Mar 15, 2023

I can look into getting the output here to wrap:

image

Copy link
Member

@juliasilge juliasilge left a comment

Choose a reason for hiding this comment

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

Looks nice! 🙌

some_cat.categories
```

Notice that categories is just the unique values in the categorical.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Notice that categories is just the unique values in the categorical.
Notice that categories are just the unique values in the categorical.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, thanks! I switched it to "the categories attribute", to try and match up with this sentence later in the article: "the information we stored on categories is".

Does that seem okay? (It's tricky territory)

Copy link
Member

Choose a reason for hiding this comment

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

Yes, makes sense to me! 👍

@juliasilge
Copy link
Member

It would be nice for that really long output to wrap so it is easier to read.

Co-authored-by: Julia Silge <julia.silge@gmail.com>
@machow
Copy link
Collaborator Author

machow commented Mar 27, 2023

I've switched the docs build on github actions to use python 3.10, and call pprint.pprint in the article to nicely format metadata.

Note that this approach only works in python 3.10 and up, though :/. I tinkered with getting it working for earlier python versions, but it seems like a bit of work 😭.

@machow machow merged commit 486c776 into main Mar 27, 2023
@isabelizimm isabelizimm deleted the docs-article-metadata branch November 14, 2023 20:45
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