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

code in application/config not being used #48

Closed
madeline-scyphers opened this issue Nov 26, 2021 · 4 comments
Closed

code in application/config not being used #48

madeline-scyphers opened this issue Nov 26, 2021 · 4 comments

Comments

@madeline-scyphers
Copy link
Contributor

Is your feature request related to a problem? Please describe.
There is a pretty large number of files inside the application/config directory that aren't being used at all (I assume they used to be, but aren't anymore).

Examples include:

  • menu_items.py
  • pages.py
  • themes.py
  • settings.py

and some others

I found awesome-panel when I was looking for panel resources for a work project for converting a dashboard from bokeh to holoviews and panel, and it is a great resource, but having a bunch of extra stuff in the source code that wasn't being used made it harder to see what the needed files for the application structure was.

Describe the solution you'd like
I can put in a PR that removes some of those unused files

Describe alternatives you've considered
If those files are needed from planned future stuff, or you would rather remove the code yourself, that is fine.

Additional context
There is also code elsewhere not being used, such as in assests, but probably not doing too much at once is a better plan. Also to get awesome-panel to run, I had to unpin some of the requirements, so I don't know if it would be bettter to just pin them to what pip resolved them to, or if I should branch of the branch that I saw you had for some of the requirements (assuming I make a PR).

@MarcSkovMadsen
Copy link
Collaborator

I love this push to get the repository cleaned up and would love a PR.

@MarcSkovMadsen
Copy link
Collaborator

MarcSkovMadsen commented Nov 26, 2021

Additionally any comments on what makes the repository useful (keep) and what does not (change) would be really, really valuable.

The intention is that this repo should be a valuable resource for inspiration and learning.

But it's also been on a journey pushing Panel forward and trying to find best practice solutions. 👍

@madeline-scyphers
Copy link
Contributor Author

One thought I had about a useful section would be to have a template for a basic project somewhere. Like just the site getting initialized, with a dummy author, and a page or two. It was a lot to look at with the whole repo. Though if all the unnecessary stuff is removed, maybe it will be fine as it is.

I also think that at least of some of the stuff that is in _site.py when you subclass _site.Site could potentially go directly into _site.Site making it easier to use.

For example in AwesomePanelSite.create_application

...
if "thumbnail" in params:
    params["thumbnail"] = THUMBNAILS_ROOT + params["thumbnail"]
if "resources" in params:
    resources = params["resources"]
    if "code" in resources:
        resources["code"] = CODE_ROOT + resources["code"]
    if "mp4" in resources:
        resources["mp4"] = MP4_ROOT + resources["mp4"]
    if "gif" in resources:
        resources["gif"] = GIF_ROOT + resources["gif"]
return super().create_application(**params)

You could work work that into _site.Site such that it takes certain input parameters that tells it which params to append certain roots to. something like {"thumbnail": THUMBNAILS_ROOT}, and then just evaluate and whatever ones were passed in. For the ones that are keys of a dictionary in params (i.e. resources), maybe something like the {("resources", "code"): CODE_ROOT} That feels bad. I don't like that, But I am just trying to think of a way to not have to subclass _site.Site if not needed.

@MarcSkovMadsen
Copy link
Collaborator

MarcSkovMadsen commented Dec 18, 2021

Hi @madeline-scyphers

I will close this one as I believe the initial problem code in application/config has been solved.

I would be helpful if you could move your suggestions above into new, specific feature requests. Thanks.

I have opened the following requests

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

No branches or pull requests

2 participants