Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 16:26
    peterroelants edited #970
  • 16:26
    peterroelants opened #970
  • 16:08
    jonmmease reopened #4704
  • 16:08
    jonmmease closed #4704
  • 16:07

    jonmmease on plotly_rgb_padding

    (compare)

  • 16:07

    jonmmease on master

    Fix datashader instability by d… (compare)

  • 16:07
    jonmmease closed #4705
  • 16:06
    jonmmease opened #4706
  • 16:03

    jonmmease on dash_autorange_fix

    Make Dash and HoloViews autoran… (compare)

  • 14:58
    jonmmease commented #4705
  • 14:57
    jonmmease synchronize #4705
  • 14:57

    jonmmease on plotly_rgb_padding

    Also disable for image and rast… (compare)

  • 14:53
    philippjfr commented #3548
  • 14:45
    jbednar commented #4705
  • 14:34
    Yura52 commented #3548
  • 14:33
    Yura52 commented #3548
  • 14:20
    jonmmease opened #4705
  • 14:14

    jonmmease on plotly_rgb_padding

    Disable plot padding for plotly… (compare)

  • 14:00
    jbednar commented #4567
  • 13:34
    jbednar synchronize #4567
Philipp Rudiger
@philippjfr
I can't tell you really, something must explicitly invoking matplotlib to make that happen.
Kim Pevey
@kcpevey
img = hv.RGB.load_image(path) was the call
Philipp Rudiger
@philippjfr
Ah okay.
Surprised plt.imread would create a figure.
Kim Pevey
@kcpevey
maybe it's just using this function https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/image.py#L1642 to create the array?
Philipp Rudiger
@philippjfr
I'd suggest replacing it with a PIL based solution.
And then make a PR to HoloViews to use that in RGB.load_image.
Right I have no idea why that would leak memory.
Kim Pevey
@kcpevey

I also tried

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

with the same results

Philipp Rudiger
@philippjfr
Also tracemalloc only checks memory allocations, not leakages.
Kim Pevey
@kcpevey
still drops to mpl
Right. so when I run the above, I can watch my machine memory increase incrementally every ttime and it never drops until I shutdown the kernel
Philipp Rudiger
@philippjfr
Does an explicit gc.collect() reclaim the memory?
Kim Pevey
@kcpevey
no
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.