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

Start best practices notebook #6819

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Start best practices notebook #6819

wants to merge 1 commit into from

Conversation

ahuang11
Copy link
Contributor

@ahuang11 ahuang11 commented May 9, 2024

Starts migrating the collection from https://discourse.holoviz.org/t/personal-opinions-about-best-practices-for-panel-holoviews/6789/27 to the official docs page, with examples

Thus far, I think it can be broken down into two sections: Dev Experience (or I was also thinking 'Nice to knows') and User Experience, and thus two separate notebooks.

Feedback appreciated on how to proceed (and what's missing; in particular, how to add it to the index).

@Coderambling
Copy link
Contributor

Coderambling commented May 10, 2024

Great iniative @ahuang11 ! As there are so many ways to do things in Panel, this is very useful (and necessary).

Regarding the recommendation to use pn.viewer.viewable instead of param; maybe add a (link to) an explanation as to why this is better?

See same question here:

https://discourse.holoviz.org/t/difference-between-param-parameterized-and-pn-viewable-viewer/6105

@ahuang11
Copy link
Contributor Author

ahuang11 commented May 10, 2024

Thanks for the feedback; links sprinkled within are good ideas.

I believe Viewer just makes it behave like a Panel object, i.e. include show(), servable(), etc. https://panel.holoviz.org/how_to/custom_components/custom_viewer.html

Check out the source:
https://github.com/holoviz/panel/blob/main/panel/viewable.py#L1024-L1071

@Coderambling
Copy link
Contributor

Coderambling commented May 10, 2024

Ok! Maybe include that link to the source in the Notebook as well?

Are you planning to make collapsible sections and subsections in the Notebook?

Will it be one Notebook with dev and user main sections, or 2 Notebooks? I would suggest 1 for now, otherwise in intro of each Notebook, mention a link to the other?

@Coderambling
Copy link
Contributor

Include a section on when (not) to use .rx, and instead of what?

@ahuang11
Copy link
Contributor Author

Are you planning to make collapsible sections and subsections in the Notebook?

No, I think this will be in the docs.

Will it be one Notebook with dev and user main sections, or 2 Notebooks? I would suggest 1 for now, otherwise in intro of each Notebook, mention a link to the other?

I believe this will be separate notebooks eventually.

@MarcSkovMadsen
Copy link
Collaborator

I'm positive on this PR.

I Think it would help shaping this with a motivating feature request. Why do we need this? What are we trying to achieve?

I also Think it would help to explain where in the docs this fits. Is it an Explanation? Is it a tutorial? Or ?

Personally i would prefer to write in a markdown file instead of notebook.

@Coderambling
Copy link
Contributor

Coderambling commented May 15, 2024

But Notebooks can contain interactive examples? Of both things that go right and go wrong. I find that quite useful.

On where it fits: good question. I like the Best Practices title. Or best practices: does and don'ts.

I think it should be somewhere in the Getting Started neighbourhood, because:

-It can help in preventing new users to go down a wrong path.

-It helps to get a "feel" for Panel.

If it achieves those 2 things, then that is a good justification.

Also, it provides a place to accumulate (verified and vetted) similar code snippets and advice in one place, after interactive discussion and iteration has taken place in more fluid places like Discord and Discourse.

@Coderambling
Copy link
Contributor

Coderambling commented May 15, 2024

But Notebooks can contain interactive examples? Of both things that go right and go wrong. I find that quite useful.

On where it fits: good question. I like the Best Practices title. Or best practices: does and don'ts.

I think it should be somewhere in the Getting Started neighbourhood, because:

-It can help in preventing new users to go down a wrong path.

-It helps to get a "feel" for Panel.

If it can achieve those things, that's already worth it.

Also, it provides a place to accumulate similar code snippets and advice from more fluid places like Discord and Discourse, after discussions and iterations have taken place there.

Like the below for example:-)

@Coderambling
Copy link
Contributor

Coderambling commented May 15, 2024

Hi @ahuang11 . How about including the excellent answer below by Jerry Vinokurov to the Best Practices? Do you think it is a good fit?

https://discourse.holoviz.org/t/what-is-meant-by-avoid-modifying-the-objects-parameter-directly/7234

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.

None yet

3 participants