Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 18:18
    yaaun synchronize #22270
  • 18:07
    tacaswell commented #22288
  • 17:51
    jklymak milestoned #22289
  • 17:51
    jklymak labeled #22289
  • 17:42
    jklymak closed #20016
  • 17:42
    jklymak commented #20016
  • 17:41
    jklymak opened #22289
  • 17:39
    tacaswell demilestoned #22288
  • 17:39
    tacaswell milestoned #22288
  • 17:39
    tacaswell milestoned #22288
  • 17:15
    impact27 opened #22288
  • 16:51
    jklymak synchronize #22244
  • 14:28
    oscargus edited #22287
  • 14:21
    oscargus opened #22287
  • 13:45
    oscargus synchronize #22283
  • 13:30
    timhoffm synchronize #22285
  • 13:17
    oscargus commented #22281
  • 13:16
    timhoffm commented #7560
  • 13:03
    timhoffm milestoned #22285
Ryan May
@dopplershift
That and they occassionally have manually uploaded windows builds for conda-forge. My point was more, currently our windows users can build everything from source, though I'm not sure how prevalent that is. If we depend on scipy, now getting a proper fortran compiler working with visual studio is added to the set. I have no idea whether that's too much to ask, or relevant, just pointing out that it becomes part of the stack.
Jody Klymak
@jklymak
Certainly a fortran compiler showing up in a build is a big bummer. I had to instal octave the other day for a 20 minutes chore that turned into 3 hrs of my old computer grinding away compiling a gfortran that I didn't need for anything else
Jody Klymak
@jklymak
ndimage, so far as I can tell, is all written in C. maybe vendoring it would be ugly, but is another option.
Its a bummer that it is not a standalone package...
Thomas A Caswell
@tacaswell
This was one of the motivations of stating skimage
Jody Klymak
@jklymak
skimage depends on ndimage I thought?
Thomas A Caswell
@tacaswell
I think so, there is (was atleast) a goal of eventually reversing the dependency
Jody Klymak
@jklymak
scikit-image definitely has scipy as a depedency
We vendor Agg now, so I guess I'd say vending ndimage is no worse. Regardless of today's discussion, it may be worth it to get around Agg's 0-1 restriction on the filters....
Thomas A Caswell
@tacaswell
I'm sure it would just change the problems we have, but I am a bit pessimistic....
Jody Klymak
@jklymak
Well, if you don't have to pre-clip the data, it makes the logic a lot more streamlined
Thomas A Caswell
@tacaswell
but it won't get us around having to make sure we do "the right thing" with wildly ill-conditioned user data, I have faith that floats will find some other way to miss-behave :-p
Jody Klymak
@jklymak
... yeah, but then we could blame it on ndimage ;-)
I put a winky there, but actually I think there is lots of power in us not rolling our own...
Bruno Beltran
@brunobeltran
any pointers on how to deprecate a class property? @deprecated works for properties, but not being able to call it using the class scope would technically be a change of API? and _deprecate_privatize_attribute seems to make it a property under the hood, which has the same issue
Bruno Beltran
@brunobeltran

tl;dr: if I do this

class Line2D(...):
    _validJoin = ('miter', 'round', 'bevel') 
    validJoin = _deprecate_privatize_attribute('3.4.0')

Then this no longer works

>>> Line2D.validJoin
Antony Lee
@anntzer
I think combining cbook.classproperty and deprecated can be made to work relatively easily
(untested)
I guess it's just a matter, in the implementation of deprecated, of replacing if isinstance(obj, property) by isinstance(obj, (property, classproperty)), and of changing the base class of _deprecated_property from property to type(obj)
Bruno Beltran
@brunobeltran
This is 99% of the way there, thanks @anntzer!
kirk86
@kirk86

Anyone has any idea why animation is not working in Colab?
MWE:

fig, ax = plt.subplots()

x = np.arange(0, 2*np.pi, 0.01)
line, = ax.plot(x, np.sin(x))

def init():  # only required for blitting to give a clean slate.
    line.set_ydata([np.nan] * len(x))
    return line,

def animate(i):
    line.set_ydata(np.sin(x + i / 100))  # update the data.
    return line,

ani = animation.FuncAnimation(
    fig, animate, init_func=init, interval=2, blit=True, save_count=50)

plt.show()

I've tried using the notebook backend but to no avail. The only way I could get a plot was using rc('animation', html='jshtml') and HTML(ani.to_jshtml()). But, it produces two plots and one of them requires pressing the play button which is something I don't want. I need a plot to live update. How to achieve that?

This is what I get with HTML(ani.to_jshtml())
image.png
hannah
@story645

you can remove the first image by moving

ani = animation.FuncAnimation(
    fig, animate, init_func=init, interval=2, blit=True, save_count=50)

into a new cell, and putting %%capture at the top of the first one

Jody Klymak
@jklymak
@QuLogic I guess I don't understand how to run our benchmarks.... https://github.com/matplotlib/mpl-bench
Jody Klymak
@jklymak
ok. I figured it out I think: asv
Elliott Sales de Andrade
@QuLogic
Yea, I should write a readme...
You need airspeed-velocity, and then can do asv dev to test out a benchmark
Jody Klymak
@jklymak
I did asv.run but it didn't pick up the new file. Trying asv dev
Is there somewhere I need to tell it what files to look in? I made a new benchmarks/dates.py file...
Elliott Sales de Andrade
@QuLogic
The function should be named time_*, but I don't think there are any requirements for file names
Jody Klymak
@jklymak
Hmm, I stuck it in a class. Could move it up a level
Oh, duh I didn't name then time_
That works. Thanks!
Elliott Sales de Andrade
@QuLogic
See also https://asv.readthedocs.io/en/stable/writing_benchmarks.html if you haven't found that already
kirk86
@kirk86

you can remove the first image by moving

ani = animation.FuncAnimation(
    fig, animate, init_func=init, interval=2, blit=True, save_count=50)

into a new cell, and putting %%capture at the top of the first one

Thanks!

Jody Klymak
@jklymak
There are a couple of PRs there now...
danuo
@danuo
I want to render text with ax.text() outside of the axis and it shall not effect the spacing of constrained_layout=True . How would I make ax.text invisible to spacing calculation?
Jody Klymak
@jklymak
t=ax.text(); t.set_in_layout(False)
Or t = fig.text()?
danuo
@danuo
awesome, thank you!
hannah
@story645
@jklymak do you know the answer here https://twitter.com/nicolaskruchten/status/1318887800796778496?s=19 - I think the answer is if users provide timestamps that incorporate est/day, that's what gets plotted - but wanted to confirm.
Thomas A Caswell
@tacaswell
We have had some bug reports on this, I think that if you give us timezone aware data we "do the right thing"
Jody Klymak
@jklymak
We have a whole test for this, but I didn't see too many good examples: def test_date2num_dst()
Also def _test_date2num_dst (for some reason...)
Gilles Jacobs
@gillesjac_twitter
Hi, I'm building a figure and want to change the font on the axis and secondary axis, what's the best way to do that?

I've seen the below

        plt.yticks(fontproperties=self.font_property)

But I'm not a fan because 1) it uses pyplot instead of my figure, and 2) it only does the primary axis or the secondary axis depending on calling order (probably can do both if I call it before and after .twinx())

Gilles Jacobs
@gillesjac_twitter

Also, unrelated;

How does zorder magic work? I have some lines (zorder 2) on the primary axis (zorder 0.1), and a polycollection (zorder 1) on the secondary axis (zorder 0); my primary axis has gridlines. If I set those gridlines (ax.yaxis.get_gridlines()) to zorder 0.1 they are still on top of my poly; do I have to set some other attribute?

Jody Klymak
@jklymak
@gillesjac_twitter This is probably best discussed on discourse.matplotlib.org where you can show some code. However if by "secondary axis" you mean a twinned axes, the axes are drawn in the order in which they are added to the figure, and the z-order is on a per-axes basis
Gilles Jacobs
@gillesjac_twitter
Yeah it's a .twinx()'d one; is there any way to work around this restriction? I could transform the data from my secondary axis to the domain of the first, and plot it on the first, but I'd rather avoid such an approach