Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 20:03
    philippjfr opened #4654
  • 20:02

    philippjfr on fix_reset_range

    Fix bug resetting ranges (compare)

  • 19:45
    kcpevey commented #4592
  • 19:45
    kcpevey commented #4592
  • 19:36
    jbednar commented #4653
  • 19:34
    kcpevey commented #4592
  • 19:34
    jbednar commented #4653
  • 19:31
    jbednar transferred #516
  • 19:31
    scottyhq opened #4653
  • 19:30
    kcpevey synchronize #4592
  • 19:30

    kcpevey on add_gh_actions

    run coveralls [ci skip] (compare)

  • 19:17
    xavArtley commented #1666
  • 19:15
    philippjfr commented #1666
  • 19:13
    xavArtley commented #1666
  • 18:54
    philippjfr commented #1666
  • 18:51
    xavArtley commented #1666
  • 18:44
    rsignell-usgs commented #516
  • 18:26
    Hoxbro commented #1673
  • 17:57
    philippjfr closed #1676
  • 17:57
    philippjfr commented #1676
Philipp Rudiger
@philippjfr

So repeatedly running:

from PIL import Image
img = hv.RGB(np.array(Image.open(path)))

increases memory usage?

Kim Pevey
@kcpevey
yes
Philipp Rudiger
@philippjfr
And this does not?
from PIL import Image
img = np.array(Image.open(path))
Kim Pevey
@kcpevey
good question. let me check
Philipp Rudiger
@philippjfr

Use this instead:

f = open(filename, 'rb')
image = Image.open(f)
image.load()
f.close()

Pillow is leaking the file pointer

Or rather use:
with open(filename, 'rb') as:
    image = np.array(Image.open(f))
And then please make a PR to HoloViews to use PIL in the same way in HoloViews.
(Replacing the imread)
Kim Pevey
@kcpevey
Hmm. I'll have to think though how I can implement this in my panel pipeline as well.
So if the image variable is deleted or replaced, it will close the file with your second example?
oh wait, the file is automatically closed after the image variable is created
Kim Pevey
@kcpevey
@philippjfr That didn't entirely solve the issue. I've opened an issue with a reproducible example holoviz/holoviews#4632
Marc Skov Madsen
@MarcSkovMadsen

FYI. I've tried out the https://shoelace.style/ web component library to create a Panel Template with a modal/ dialog to answer this user question https://discourse.holoviz.org/t/can-i-use-create-a-modal-dialog-in-panel/1207/4. It worked really well. For me Shoelace is currently the library of web components that I believe complements the existing Bokeh/ Panel widgets the most. They seem fairly mature and extensive. So if you needs some advanced layouts for your template take a look at them.

I believe a lot in Fast web components as well. But they are not so mature. But eventually they could be much, much bigger as they have the backing of Microsoft. And people are just starring it on Github and joining their discord forum at amazing speeds.

thumbnail.png
Checkout the live version here https://awesome-panel.org/dialog_template
Shoelace also comes with different stylesheets. And you can switch between them awesomely quick.
shoelace.gif
Marc Skov Madsen
@MarcSkovMadsen
I also think the Material MWC web components are important because Material is so widely used. But I find 1) the release cycle really slow. It's like Google is not really prioritizing this 2) The components heavy. With Shoelace and Fast you load one small library to get all components. In MWC you load a rather large library per component. And if you look at the implementation of MWC it's really just a wrapping of the "legacy" material design .js library. It does not seem that awesome.

But maybe it is better to go back to bokeh and invest in modernizing the existing css stylesheets. The problem right now is that the .css is based on a very old version of Bootstrap (I believe) and there is a lot of hard coding of colors in decentral places. Another problem is just that not so many layouts and widgets are provided.

The right thing for Bokeh styles would be to have one central place to define colors and then use them in the .css files. And create a dark version as well. And document how to customize the styles easily. And the built in styles should be as close to for example a current version of Bootstrap instead of something old or custom. This will make it a lot easier for users to customize or extend via custom templates and css.

With Fast I just need to change the background color. Then everything adjusts. That is easy ... and Fast :-).

James A. Bednar
@jbednar
Yes, Bokeh could definitely use some love from a good CSS wizard. You don't happen to know any, do you?
Marc Skov Madsen
@MarcSkovMadsen
Nope. How would Bokeh find funding to get the CSS improved visually, wrt. documention and wrt. customization? I'm thinking that the group of people developing and using Bokeh and Bokeh related things might typically not have those skills?
James A. Bednar
@jbednar
Bokeh is developed by programmers, and there isn't a resident graphic designer.
Anyone who has or could hire a good graphic designer could work with Bokeh on an overhaul, and anyone with money could work with Bokeh or Anaconda to start a project to hire one.
Marc Skov Madsen
@MarcSkovMadsen
Jacob Barhak
@Jacob-Barhak
Does anyone know how to conceal a large static html file generated by panel as another file? I have an issue with Netlify no longer supporting html files that take more than 30 seconds to load - apparently if I disguise them as non html it should work. Does anyone have an idea how to do it? Here is a link to the entire discussion: https://community.netlify.com/t/large-html-static-files-stopped-working-recently/23359 I am trying to avoid regeneration of the files that worked. I hope you have ideas.
And @jbednar , please check your email and give me an answer about the tutorial - I just need to know how to proceed, whatever your answer is.
Jacob Barhak
@Jacob-Barhak
The Netlify community found that files generated by panel are have some errors of missing map files. What does this mean? Can this be avoided. I am sending a screenshot found
unnamed.jpg
Jacob Barhak
@Jacob-Barhak
How do I force using matplotlib backend with holoviews rather than bokeh when I create holoviews plots that are later svaed by panel save. The following code generated bokeh figure even if I explicitly ask for matplotlib:
data = {}
data['Year'] =    [2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, ]
data['Cohorts'] = [  22,   34,   40,   47,   47,   91,   91,  123,  123, ]

holoviews.extension('matplotlib')
plot1 = holoviews.Scatter(data, kdims=['Year'], vdims=['Cohorts'], backend='matplotlib')
#
# I make a few more plots here - some are bokeh plots
# then I finish with
section3_2_1_right = panel.pane.HoloViews(plot1, width=400, height=170)
Am I using a proper syntax?
James A. Bednar
@jbednar
I don't think backend='matplotlib' does anything there; the backend is determined at the display or output stages, not during Element creation. Not sure why that's not an error, though.
And Panel is always based on Bokeh, so the full panel can only be Bokeh based. You should be able to set it up to render individual plots using Matplotib, though.
Jacob Barhak
@Jacob-Barhak
Thanks @jbednar , so I I want to show a maptplotlib plot and bokeh plot next to each other on different panels, how can I do this? I am trying to add this to the tutorial next week so people can see that Holoviews can handle multiple backends, yet if it is too complex, I will just use bokeh.
By the way, I plan to release the tutorial under CC0 - do you have any objections? I can use another open source license, yet I think CC are best for tutorials - since I put your name on the presentation, I rather you approve - I will put it on Gihub when it looks better - probably by tomorrow. Yet I want to know you are ok with the license.
James A. Bednar
@jbednar
No problem. I haven't tried that, but I'd guess it's something like pn.Row(hv.output(plot1, backend='bokeh'), hv.output(plot1, backend='bokeh'), where you probably have to pass some arguments to hv.output to specify you want a figure output rather than html, etc. @philippjfr would know...
Jacob Barhak
@Jacob-Barhak
Thanks @jbednar , problem solved - this actually works, the backend has to be specified at the panel level, and there is a warning - I just missed in among all the warnings the system shows - it tells me it does not recognize backend by Holoviews - This is good. If I move fast enough I will post the tutorial skeleton on Github under CC0 by tonight.
Jacob Barhak
@Jacob-Barhak
image.png
James A. Bednar
@jbednar
Cool!
Jacob Barhak
@Jacob-Barhak
Well @jbednar - not really - there are red boxes around the markdown text - no idea why - I am trying to figure it out now. not sure why they appear.
Jacob Barhak
@Jacob-Barhak
And @jbednar - this is odd, notice how markdown code section is shown once with red outline and once as colored keywords - this is at the markdown library level, yet it is very odd - I will investigate if this can be controlled.
James A. Bednar
@jbednar
Seems odd.
Jacob Barhak
@Jacob-Barhak
Yes,, Very odd, it happens every once in a while - not sure when - here is another example
image.png
I will go on and figure this out when everything is ready - it worked before so its a minor issue that can be taken care of.
Jacob Barhak
@Jacob-Barhak
Problem with code highlight is not really a problem - the markdown library supports different highlight for different languages. So to get python highlight one should use : ''''python
hoangthienan95
@hoangthienan95
Hi everyone, does hvplot support heatmap with datashading? Could not find an example in the docs and adding datashade=True to the examples in here causes an error. About to file github issue but just wanna double check
James A. Bednar
@jbednar
Datashader output is already a heatmap of sorts, so it depends what you mean.
Usually you'll add datashade=True on whatever your original data was, not on .heatmap.