Latest / Talk Python To Me / #338: Using cibuildwheel to manage the scikit-HEP packages
Transcript
- 0:00How do you build and maintain a complex suite of Python packages?
- 0:03Of course, you want to put them on PyPI.
- 0:06The best format there is as a wheel.
- 0:08This means that when developers use your code,
- 0:10it comes straight down and requires no local tooling to install and use.
- 0:14But if you have complex dependencies, such as C or Fortran,
- 0:18then you have a big challenge.
- 0:20How do you automatically compile and test against Linux, macOS,
- 0:24that's Intel and Apple Silicon, Windows, 32 and 64-bit,
- 0:30and so on?
- 0:30That's the problem solved by CI Buildwheel.
- 0:33On this episode, you'll meet Henry Schreiner.
- 0:36He's developing tools for the next era of the Large Hadron Collider
- 0:39and is an admin of Scikit-HEP.
- 0:42Of course, CI Buildwheel is central to that process.
- 0:46This is Talk Python To Me, episode 338, recorded October 14th, 2021.
- 0:52Welcome to Talk Python To Me, a weekly podcast on Python.
- 1:08This is your host, Michael Kennedy.
- 1:09Follow me on Twitter, where I'm @mkennedy,
- 1:12and keep up with the show and listen to past episodes at talkpython.fm.
- 1:15And follow the show on Twitter via at Talk Python.
- 1:19We've started streaming most of our episodes live on YouTube.
- 1:22Subscribe to our YouTube channel over at talkpython.fm/youtube
- 1:26to get notified about upcoming shows and be part of that episode.
- 1:30Hey there, I have some exciting news to share before we jump into the interview.
- 1:34We have a new course over at Talk Python.
- 1:36HTMX plus Flask, modern Python web apps, hold the JavaScript.
- 1:40HTMX is one of the hottest properties in web development today,
- 1:44and for good reason.
- 1:45You might even remember all the stuff we talked about with Carson Gross back on episode 321.
- 1:50HTMX, along with the libraries and techniques we introduced in our new course,
- 1:55will have you writing the best Python web apps you've ever written.
- 1:58Clean, fast, and interactive, all without that front-end overhead.
- 2:01If you're a Python web developer that has wanted to build more dynamic, interactive apps,
- 2:06but don't want to or can't write a significant portion of your app in rich front-end JavaScript
- 2:11frameworks, you'll absolutely love HTMX.
- 2:14Check it out over at talkpython.fm/HTMX,
- 2:18or just click the link in your podcast player's show notes.
- 2:20Now let's get on to that interview.
- 2:22Henry, welcome to Talk Python To Me.
- 2:25Thank you.
- 2:26Yeah, it's great to have you here.
- 2:27I'm always fascinated with cutting-edge physics
- 2:31with maybe both ends of physics, right?
- 2:34I'm really fascinated with astrophysics and the super large,
- 2:37and then also the very, very small.
- 2:39And we're going to probably tend a little bit towards the smaller,
- 2:42high-energy things this time around,
- 2:45but so much fun to talk about this stuff and how it intersects Python.
- 2:48Some of the smallest things you can measure
- 2:50and some of the largest amounts of data you can get out.
- 2:52Yeah, the data story is actually really, really crazy,
- 2:57and we're going to talk a bit about that.
- 2:58So neat, so much stuff.
- 3:00We used to think that atoms were as small as things could get, right?
- 3:04I remember learning that in elementary school.
- 3:05There are these things called atoms.
- 3:07They combine to form compounds and stuff,
- 3:10and that's as small as it gets.
- 3:11And yeah, not so much, right?
- 3:13Yeah, that was sort of what atom was supposed to mean.
- 3:15Exactly, the smallest bit, but nope.
- 3:19But that name got used up, so there we are.
- 3:21All right, well, before we get into all that stuff, though,
- 3:23let's start with your story.
- 3:25How did you get into programming in Python?
- 3:26Well, I started with a little bit of programming
- 3:30that my dad taught me.
- 3:31He was a physicist.
- 3:33And I remember it was C++ and sort of taught the way you would teach Java,
- 3:37you know, all objects and classes.
- 3:39Yeah.
- 3:39Just a little bit.
- 3:41And then when I started at college,
- 3:43then I wanted to take classes,
- 3:45and I took a couple classes again in C++.
- 3:48But I just really loved objects and classes.
- 3:51Unfortunately, the courses didn't actually cover that much,
- 3:54but the book did.
- 3:55So I really got into that.
- 3:57And then for Python, actually, right when I started college,
- 4:00I started using this program called Blender.
- 4:02Oh, yeah.
- 4:03Blender.
- 4:03I've heard of Blender.
- 4:04It's like a 3D animation tool, like Maya or something like that, right?
- 4:08And it's very Python-friendly, right?
- 4:10Yes.
- 4:11It has a built-in Python interpreter.
- 4:13So I knew it had this built-in language called Python,
- 4:15so that made me really want to learn Python.
- 4:16And then when I went to an REU,
- 4:20a research experience for undergraduates
- 4:22at Northwestern University in Chicago.
- 4:25And when I was there,
- 4:26we had this cluster that we were working on.
- 4:29This was in solid-state physics, material physics.
- 4:32And we would launch these simulations on the cluster.
- 4:36And so I started using Python,
- 4:39and I was able to write a program that would go out,
- 4:42and it would create a bunch of threads,
- 4:44and it would watch all of the cluster,
- 4:46all the nodes in the cluster.
- 4:48And as soon as one became available, it would take it.
- 4:49So I could just,
- 4:50my simulation would just take the entire cluster.
- 4:52After a few hours, I would have everything.
- 4:54So at the end of that,
- 4:55everybody hated me,
- 4:56and everybody wanted my scripts.
- 4:58Exactly.
- 4:59They're like,
- 4:59this is horrible.
- 5:01I can't believe you did that to me,
- 5:02but I'll completely forgive you
- 5:04if you just give it to me and only to me,
- 5:06because I need that power.
- 5:07Yeah, that's fantastic.
- 5:09How neat.
- 5:10So I think that is one of the cool things about Python, right,
- 5:13is that it has this quick prototyping approachability.
- 5:18They're like,
- 5:18I'm just going to take over a huge hardware, right?
- 5:22Like a huge cluster of servers,
- 5:23but it itself doesn't have to be like intense programming.
- 5:26It can be like this elegant little bit of code, right?
- 5:28You can sort of do things that,
- 5:30normally I think the programming gets in the way more,
- 5:32but Python tends to stay out.
- 5:34It looks more like pseudocode.
- 5:35So you can do more and learn more,
- 5:38and eventually you can go do it in C++ or something.
- 5:40Yeah.
- 5:41Yeah, absolutely.
- 5:42Great way to start.
- 5:43Or maybe not.
- 5:44Sometimes you do need to go do it in some other language,
- 5:47and sometimes you don't.
- 5:48I think the stuff at CERN and LHC has an interesting exchange between C++
- 5:54and maybe some more Python and whatnot,
- 5:57so that'll be fun to talk about.
- 5:59Yeah.
- 5:59We've been C++ originally,
- 6:01but Python is really showing up in a lot more places,
- 6:04and there's been a lot of movement in that direction.
- 6:07And there have been some really interesting things that have come out.
- 6:09A lot of interesting things have come out of the LHC,
- 6:12computing-wise as well as physics.
- 6:13Awesome.
- 6:14Yeah.
- 6:15As a computing bit of infrastructure,
- 6:16there's a ton going on there.
- 6:18And as physics,
- 6:19it's kind of the center of the particle physics world, right?
- 6:22So it's got those two parallel things generating,
- 6:26all sorts of cool stuff.
- 6:27I want to go back to just really quickly to,
- 6:29you know,
- 6:30you talked about your dad teaching a little programming.
- 6:31If people are out there and they're the dad,
- 6:34they want to teach their kids a little bit of programming,
- 6:36I want to give a shout out to CodeCombat.com.
- 6:38Such a cool place.
- 6:39My daughter just yesterday was like,
- 6:41hey, dad, I want to do a little Python.
- 6:42Remember that game that taught me programming?
- 6:45Like, yeah, yeah, sure.
- 6:46So she's like,
- 6:47she logged in and started playing
- 6:48and basically solve a dungeon interactively by writing Python.
- 6:52And it's such an approachable way,
- 6:53but it's not the like draggy, dropy, fake stuff.
- 6:55You write real Python,
- 6:57which I think is cool to introduce kids that way.
- 6:59So anyway, shout out to them.
- 7:01I had them on the podcast before,
- 7:02but it's cool to see kids like taking to it in that way, right?
- 7:05Whereas you say it like,
- 7:06you could write a terminal app.
- 7:07They're like, I don't want to do that.
- 7:08But solve a dungeon.
- 7:10Yeah, they could do that.
- 7:11Yeah.
- 7:11I've actually played with a couple of those.
- 7:12They're actually really fun just to play.
- 7:13Yeah, they are.
- 7:14Exactly.
- 7:15I did like 40 dungeons along with my daughter.
- 7:17It was very cool.
- 7:18How about now?
- 7:19What do you do now?
- 7:19So I work in a lot of different areas
- 7:22and I jump around a lot.
- 7:24So I do a mix of coding.
- 7:26I do some work on websites
- 7:29because they just needed maintenance
- 7:31and somehow I got volunteered.
- 7:33And some writing.
- 7:35So less coding than I would like,
- 7:38but I definitely do get to do it,
- 7:40which is fun.
- 7:40Yeah.
- 7:40And this is at CERN or at your university
- 7:43or where is this?
- 7:44So now I'm at Princeton University
- 7:47and I'm part of a local group
- 7:49of RSEs, research software engineers.
- 7:52And I'm also part of Iris Hep,
- 7:56which we'll talk about a little bit.
- 7:57But that's sort of a very spread out group.
- 8:00Some of us are at CERN,
- 8:02a few are in some other places,
- 8:04a few in some Fermilab.
- 8:06And energy physicists are just used
- 8:08to working remote.
- 8:09The pandemic wasn't that big
- 8:10of a change for us.
- 8:11We were already doing
- 8:12all our meetings remote.
- 8:12We just eventually changed
- 8:14from video to Zoom.
- 8:15But other than that,
- 8:16it was pretty much the same.
- 8:17Exactly.
- 8:17It was real similar for me as well.
- 8:19That's interesting.
- 8:20Fermilab, that's in Chicago,
- 8:22outside Chicago, right?
- 8:23Yes.
- 8:23Is that still going?
- 8:24I got the sense that
- 8:25that was shutting down.
- 8:26They're big in neutrino physics.
- 8:27So they do a lot of neutrino things there.
- 8:30And then they're also very active
- 8:32just in the particle physics space.
- 8:34So you may be at Fermilab,
- 8:36but working on CERN data.
- 8:37I see.
- 8:37Okay.
- 8:38Interesting.
- 8:38Yeah.
- 8:39I got to tour that place a little bit
- 8:41and it's a really neat place.
- 8:42It is.
- 8:43CERN's a neat place too.
- 8:44I would love to tour CERN,
- 8:46but it wasn't 20 minutes down the street
- 8:49from where I happened to be.
- 8:50So I didn't make it there.
- 8:51Sadly, I hope to get back there someday.
- 8:53All right.
- 8:54Well, let's talk about
- 8:57sort of the scikit-hep side of things
- 9:01and how you got into
- 9:02maintaining all of these packages.
- 9:05So you found yourself in this place
- 9:06where you're working on tools
- 9:08that help other people build packages
- 9:10for the physicists and data scientists
- 9:13and so on, right?
- 9:14So where'd that all start?
- 9:16So with maintenance itself,
- 9:18the first thing I started maintaining
- 9:20was a package called Plumbum back in 2015.
- 9:23And at that point,
- 9:26I was starting to submit some PRs
- 9:29and the author came to me and said,
- 9:30I would like to have somebody do the releases.
- 9:32I need a release manager.
- 9:34I don't have time.
- 9:35And I said, sure, I'd be happy to do it.
- 9:36And it was exciting for me
- 9:37because it was the first package
- 9:39or like real package I got to join.
- 9:42And so I think on the page,
- 9:45it might even still have the original news item
- 9:47when it says, welcome to me.
- 9:48But-
- 9:49Nice.
- 9:50So that was the first thing I started maintaining.
- 9:52And then I was working on a IG physics tool
- 9:58called Goofit when I became a postdoc.
- 10:00And I worked on sort of really renovating that.
- 10:03It started out as a code written by physicists.
- 10:06And I worked on making it actually installable
- 10:09and packaged nicely
- 10:11and worked with a student to add Python bindings to it,
- 10:14things like that.
- 10:14And as part of that,
- 10:15I wrote a C++ package, CLI 11.
- 10:18It was just a first package I actually wrote
- 10:21and then maintained.
- 10:22And it's actually in C++.
- 10:24And that was written for Goofit,
- 10:26but now it's a fairly,
- 10:27I think it's done pretty well on its own.
- 10:30Nice.
- 10:31What's that one do?
- 10:32Microsoft Terminal uses it.
- 10:32Yeah.
- 10:33Microsoft Terminal uses it?
- 10:35Mm-hmm.
- 10:35Oh, nice.
- 10:36Yeah, I'm a big fan of Microsoft Terminal.
- 10:37I've for a while now
- 10:39kind of shied away from working on Windows
- 10:42because the terminal experience
- 10:44has been really crummy.
- 10:45You know, the cmd.exe command prompt style
- 10:48is just like,
- 10:48oh, why is it so painful?
- 10:50And people who work in that all day,
- 10:52they might not see it as painful.
- 10:53But if you get to work in something
- 10:54like a macOS terminal
- 10:56or even to not quite the same degree,
- 10:59but still in like a Linux one,
- 11:00then all of a sudden,
- 11:01yeah, it kind of gets there.
- 11:02But I'm kind of warming up to it again
- 11:06Windows Terminal.
- 11:06Yeah, the Xterm is one of the reasons
- 11:08I use,
- 11:09I really moved to Mac
- 11:11because I loved Xterm.
- 11:12And then Windows Terminal is amazing.
- 11:14Now it's a great,
- 11:15great team working on it,
- 11:16including the fact that they used my parser.
- 11:18But it's actually quite nice.
- 11:22The only problem I have in Windows 10
- 11:23is it's really hard to get the thing
- 11:24to show up instead of cmd prompt.
- 11:28Yeah.
- 11:28But Windows 11,
- 11:29I think it's supposed to be the only one.
- 11:31Yeah.
- 11:31I definitely think it's included now,
- 11:33which is great.
- 11:34So CLI 11,
- 11:36this is a C++ 11 command line parser,
- 11:39right?
- 11:39Like click or arg parse
- 11:41or something like that,
- 11:41but for C++, right?
- 11:42Yes.
- 11:43It was designed off of
- 11:44the Pumbum command line parser.
- 11:46Pumbum is sort of a toolkit
- 11:47and it has several different things.
- 11:48I wish those things had been pulled out
- 11:50because I think on their own,
- 11:51they might have
- 11:51maybe even been popular on their own.
- 11:55it has a really nice parser,
- 11:56but it was sort of designed off of that
- 11:57and off click.
- 11:58It has some similarities
- 12:01to the both of those.
- 12:01Yeah.
- 12:02I think probably that's a challenge.
- 12:04I mean,
- 12:04we're going to get into CiteGithub
- 12:06with a whole bunch
- 12:07of these different packages,
- 12:08but finding the right granularity
- 12:10of what is a self-contained unit
- 12:13that you want to share with people
- 12:14or versus things like
- 12:15pulling out a command line parser
- 12:17rather than some other library, right?
- 12:19This is a careful balance.
- 12:21It's a bit challenging.
- 12:23I think in Python,
- 12:24there's a really strong emphasis
- 12:26to having the individual
- 12:28separate pieces and packages,
- 12:29especially in Python,
- 12:31partially because it has
- 12:32a really good packaging system.
- 12:34And being able to take things,
- 12:37have just pieces
- 12:38and be able to swap out one
- 12:39that you don't like
- 12:40is really, really nice.
- 12:41And that's one of the things
- 12:42we'll talk about the PyPA as well.
- 12:44And that's one of the things
- 12:44that they focus on
- 12:46is small individual packages
- 12:48that each do a job
- 12:49versus all-in-one poetry.
- 12:51Yeah.
- 12:52Well, you'll have to
- 12:53do some checking
- 12:54or some fact-checking,
- 12:56balancing,
- 12:57modernizing for me.
- 12:58I did professional C++ development
- 13:00for a couple of years
- 13:01and I really enjoyed it
- 13:03until there were better options.
- 13:05And then I'm like,
- 13:06why am I still doing this?
- 13:07I would go work on those.
- 13:09But one of the things
- 13:11that struck me
- 13:12as a big difference
- 13:13to that world
- 13:14is basically
- 13:15the number of libraries
- 13:16you use,
- 13:17the granularity
- 13:18of the libraries you use,
- 13:19you know,
- 13:20the relative acceptance
- 13:22of things like pip
- 13:23and the ease
- 13:23of using another library,
- 13:25right?
- 13:25In C++,
- 13:26you've got the header
- 13:27and you've got the linked file
- 13:30and you've got the DLL
- 13:31and there's like
- 13:32all sorts of stuff
- 13:33that can like
- 13:33get out of sync
- 13:34and go crazy
- 13:35and like make weird crashes.
- 13:37Your app just goes away
- 13:38and that's not great.
- 13:39Is that still true?
- 13:40I feel like that
- 13:41that difference
- 13:42is one of the things
- 13:43that allows for people
- 13:44to make these smaller
- 13:45composable pieces
- 13:46in Python.
- 13:47I think that has
- 13:48a lot to do with it.
- 13:49What has happened
- 13:50in C++
- 13:51is there's sort of
- 13:52a rise of a lot
- 13:53of header-only libraries
- 13:54and these libraries
- 13:55are a lot easier
- 13:57to just drop
- 13:57into your project
- 13:59because all you do
- 14:00is you put in the headers
- 14:01and there's no,
- 14:03you don't have to deal
- 14:05with a lot of the
- 14:05original issues.
- 14:07So a lot of these
- 14:07small standalone libraries
- 14:09are header-only
- 14:10and one of the next
- 14:11things that I picked up
- 14:13as a maintainer
- 14:15was Pybind 11,
- 14:16which,
- 14:16and I've sort of
- 14:17been in that space
- 14:18sort of between C++
- 14:19and Python
- 14:20for quite a bit.
- 14:21I kind of like being
- 14:22in that area,
- 14:23joining the two.
- 14:26I get a sense
- 14:27from listening to the things
- 14:28that you've worked on
- 14:29previously
- 14:29and things like this
- 14:31that you're interested
- 14:32in connecting
- 14:32and enabling,
- 14:33like piecing together,
- 14:34like here's my script
- 14:35that's going to pull together
- 14:36the compute
- 14:37on this cluster
- 14:38or here's this library
- 14:39that pulls together
- 14:39Python and C++
- 14:41and so on.
- 14:41Yes,
- 14:42making different things
- 14:43work together
- 14:43and combining things
- 14:45like C++ and Python
- 14:46or combining different
- 14:47packages in Python
- 14:48and piecing together
- 14:49a solution.
- 14:49I think that's one
- 14:50of Python's strengths
- 14:51versus something like
- 14:52MATLAB.
- 14:53I spent quite a bit
- 14:53of time in MATLAB
- 14:54early on
- 14:55and got to move
- 14:57a lot of stuff
- 14:57over to Python.
- 14:58Right on,
- 14:59that's awesome.
- 14:59It was really nice.
- 15:00We didn't have to have
- 15:01a license
- 15:01and things like that.
- 15:02I know,
- 15:03it's so expensive
- 15:04and then you get the,
- 15:05what are they called,
- 15:06toolkits,
- 15:07the add-on toolkits
- 15:08and they're like,
- 15:08each toolkit
- 15:09is the price
- 15:10of another $1,000 a year
- 15:12or $2,000 a year.
- 15:13It's ridiculous.
- 15:14So I know of CFFI,
- 15:17which is a way
- 15:18for Python and C
- 15:20to get clicked together
- 15:21in a simple way.
- 15:23How's Pybind 11
- 15:26fit into that?
- 15:27This is seamless
- 15:28interoperability
- 15:28between C++11
- 15:30and Python.
- 15:30How are they different?
- 15:32So CFFI,
- 15:33I teach like
- 15:35a little short course
- 15:36where I can go through
- 15:36some of the different
- 15:38binding tools
- 15:38and it usually ends
- 15:40with me saying
- 15:40Pybind 11 is my favorite.
- 15:41Yeah, cool.
- 15:43Give us an overview
- 15:43of what the options are
- 15:44and stuff.
- 15:45CFFI is closer
- 15:46to C types.
- 15:47It's more of,
- 15:47it's focused on C
- 15:49versus C++
- 15:50and it's actually
- 15:53the one I've used
- 15:53the least.
- 15:54I was just helping,
- 15:54we're just talking
- 15:56with the CFFI developer
- 15:57but I've used it
- 15:59the least of those
- 15:59but I think it
- 16:01basically parses
- 16:02your C headers
- 16:04and then sort of
- 16:06automates a lot
- 16:06of what you would
- 16:07have to manually
- 16:08do with C types
- 16:08or you have to
- 16:09specify what
- 16:11symbol you want to call
- 16:12and what the arguments
- 16:13are and what the return
- 16:14type is and if one
- 16:15of those things is wrong
- 16:15you get a seg fault
- 16:16and that sort of thing.
- 16:17Whereas Pybind 11,
- 16:18this is about building
- 16:20modules, extension modules.
- 16:21So, and it's,
- 16:22and it's,
- 16:23the interesting thing
- 16:24about this
- 16:24is that it's written
- 16:26in pure C++.
- 16:26The other tools
- 16:28out there,
- 16:28so Cython can do this,
- 16:30it's not what
- 16:30it was designed for
- 16:31but it immediately
- 16:32became popular
- 16:33for doing this
- 16:34because Cython
- 16:35turned code,
- 16:37Python,
- 16:37Python-like code
- 16:38is a new language
- 16:40into,
- 16:40it transpiled it
- 16:42into C
- 16:42or C++
- 16:43that had a toggle
- 16:44you could change,
- 16:45has a toggle
- 16:45you can change
- 16:46and then
- 16:47when you're there
- 16:48you can now call
- 16:49C or C++
- 16:50but it's extremely verbose
- 16:52and you repeat yourself
- 16:53and you have to learn
- 16:53another language.
- 16:54This weird combined
- 16:55Python thing
- 16:56and just thinking
- 16:57in Cython is difficult
- 16:58because you have to think
- 16:59about well am I
- 17:00in Python
- 17:00or am I in Cython
- 17:02that can,
- 17:03that's going to be
- 17:04bound to Python
- 17:05or am I in Cython
- 17:06that's just going
- 17:06straight to C,
- 17:07C++
- 17:08or am I just in C++
- 17:09or C
- 17:10but I've actually used it.
- 17:11It's a lot of layers there,
- 17:12yeah.
- 17:12But Pybind 11
- 17:13is just C++
- 17:14and it's just,
- 17:15it's basically,
- 17:16it's like the,
- 17:18C API
- 17:19for Python
- 17:20but a C++ API.
- 17:21It's quite,
- 17:22it's quite natural
- 17:23and you don't have
- 17:24to learn a new language.
- 17:25It uses some fairly
- 17:26advanced C++
- 17:27but that's it.
- 17:28You're learning
- 17:28something useful anyway.
- 17:29Right.
- 17:29So do you do
- 17:31some sort of like
- 17:31template type thing
- 17:32and then say
- 17:33I'm going to expose
- 17:34this class to Python
- 17:36or something like that
- 17:37and then it figures out,
- 17:38does it write
- 17:38the Python code
- 17:39or what is it?
- 17:40It's writing the,
- 17:41build like .so files
- 17:43or what do you do here?
- 17:45It,
- 17:45it compiles
- 17:47into the C API calls
- 17:48and then that
- 17:49would compile
- 17:50into a .so
- 17:50and there's no
- 17:51separate step
- 17:52like Cython
- 17:53or Swig
- 17:53or these,
- 17:53or these other tools
- 17:55because it's just
- 17:56C++.
- 17:56You compile it
- 17:57like you do
- 17:57any other C++
- 17:58but it's actually
- 18:00internally using
- 18:01the CPython API
- 18:02or PyPy's
- 18:03wrapper for it
- 18:04and the language
- 18:05looks a lot like Python
- 18:06but the names
- 18:06are similar.
- 18:07You just do a def
- 18:08to define a function
- 18:09and you give it
- 18:10the name
- 18:10and then you just
- 18:11pass it the pointer
- 18:12to the,
- 18:13the underlying thing.
- 18:14It can figure out
- 18:15things like types
- 18:15and stuff like that
- 18:16for you.
- 18:16Give it a doc string
- 18:17if you want.
- 18:18Give the arguments
- 18:18names.
- 18:19You can make it
- 18:19as Pythonic as you want.
- 18:20It's verbose
- 18:22but it's not overly verbose.
- 18:23Yeah,
- 18:24that's really neat.
- 18:25Nice.
- 18:25And for people
- 18:26who haven't used
- 18:27those kind of outputs,
- 18:29basically,
- 18:29it's just import
- 18:30module name
- 18:31whether it's a
- 18:32.py file
- 18:34or it's a
- 18:34.so file.
- 18:36PyTorch
- 18:37if you've used
- 18:38.py
- 18:39if you've used
- 18:41any of those things
- 18:42you have,
- 18:42you've been importing
- 18:43some PyBind11 code.
- 18:44So let's talk
- 18:46a little bit
- 18:46about
- 18:47Scikit-Hep.
- 18:48This is
- 18:49one of the projects
- 18:50that it has
- 18:52a lot of these
- 18:52packages
- 18:53inside of it
- 18:54and your
- 18:55library
- 18:56CBuild
- 18:58Wheel
- 18:59is
- 19:01one of the things
- 19:02that is used
- 19:03to maintain
- 19:03and build
- 19:03a lot of
- 19:04those packages
- 19:04because I'm sure
- 19:05they have a lot
- 19:05of interesting
- 19:06and oddball
- 19:07dependencies,
- 19:08right?
- 19:08I mean,
- 19:09C++ is kind of
- 19:10standard,
- 19:11but there's probably
- 19:11others as well,
- 19:12right?
- 19:12It is.
- 19:14So one thing
- 19:14that is kind of
- 19:15somewhat unique
- 19:16to HEP
- 19:17is that we are
- 19:18very heavily invested
- 19:19in C++.
- 19:19So it's usually
- 19:21either you're going
- 19:22to see Python
- 19:22or you're going
- 19:23to see some sort
- 19:23of C++
- 19:24package of some sort.
- 19:25I mean,
- 19:26it could be
- 19:26varies in size there,
- 19:28but it's mostly
- 19:29C++ or Python.
- 19:30We really
- 19:30haven't used
- 19:32other languages
- 19:32much for the past
- 19:34early 90s or so.
- 19:35Is that inertia
- 19:36or is that
- 19:37by choice?
- 19:39You know,
- 19:39why is that?
- 19:40I think it's
- 19:41partially the community
- 19:42is a fairly
- 19:44cohesive community.
- 19:46We're really
- 19:47used to
- 19:48sort of working
- 19:48together.
- 19:48The experiments
- 19:49themselves
- 19:49are often,
- 19:51you know,
- 19:52might be a thousand
- 19:52or several thousand
- 19:54physicists working
- 19:55on a single experiment.
- 19:55And we have been
- 19:57fairly good about
- 19:58sort of meeting
- 19:59together and
- 20:00sort of deciding
- 20:01the direction
- 20:01that we want
- 20:02to go in
- 20:02and it's
- 20:03sort of sticking
- 20:03to that.
- 20:04So for C++,
- 20:06it was heavily
- 20:07root,
- 20:07which is a
- 20:08giant C++
- 20:10framework.
- 20:11And it's got
- 20:12everything in it.
- 20:13And that was
- 20:14C++ and that's
- 20:15what everybody
- 20:15used.
- 20:15So root is the
- 20:17library.
- 20:17If I was going
- 20:18to write code
- 20:19that would run
- 20:20and interact
- 20:21with like the
- 20:22grid computing
- 20:23or the data
- 20:24access and all
- 20:25that kind of
- 20:25stuff at LHC,
- 20:27I would use
- 20:28this root library
- 20:28if I was doing
- 20:29that in C++,
- 20:29right?
- 20:30Yes.
- 20:30You might be
- 20:31using interpreted
- 20:32C++,
- 20:32which is something
- 20:33we invented.
- 20:33Oh, okay.
- 20:35This is interesting.
- 20:37Is this something
- 20:38people can use?
- 20:38Oh, yes.
- 20:39We actually,
- 20:40so Cint
- 20:42was the original
- 20:42interpreter
- 20:43and then it got
- 20:43replaced by
- 20:44Cling,
- 20:45which is built
- 20:46on the LLVM.
- 20:47And I think
- 20:49recently it was
- 20:49merged to
- 20:50mainline LLVM
- 20:51as Clang
- 20:53Repl,
- 20:53I think it's
- 20:54called,
- 20:55but it's sort
- 20:55of a lightweight
- 20:56version.
- 20:56Yeah, it's
- 20:58a C++
- 20:58interpreter.
- 20:59You can actually
- 20:59get Zeus
- 21:00Cling,
- 21:00which I think
- 21:03Quantstack has,
- 21:05but they package
- 21:06it as well,
- 21:06I think,
- 21:07Zeus Cling.
- 21:08Okay, yeah,
- 21:09very interesting.
- 21:09It's not,
- 21:10C++ really wasn't
- 21:12designed for a
- 21:12notebook though.
- 21:13It does work,
- 21:14but you can't
- 21:15rerun a cell
- 21:15often because
- 21:16you can't
- 21:17redefine things.
- 21:18Python is just
- 21:19really natural
- 21:20in a notebook
- 21:20and C++
- 21:21is not.
- 21:21Yeah, especially
- 21:22if you change
- 21:23the type,
- 21:23you compile it
- 21:24as an int
- 21:24and then you're
- 21:25like, ah,
- 21:25that should be
- 21:25a string.
- 21:26Yeah, that's
- 21:27not going to
- 21:27be a string.
- 21:27It's compiled.
- 21:28Yeah, interesting.
- 21:29So it seems to
- 21:30me like the
- 21:31community at
- 21:32CERN has
- 21:33decided, look,
- 21:34we need some
- 21:34low-level stuff
- 21:35and there's some
- 21:36crazy low-level
- 21:36things that
- 21:37happen over there.
- 21:38People can check
- 21:39out a video,
- 21:40maybe I'll mention
- 21:41a little bit
- 21:41later.
- 21:41But for that
- 21:43use, they've
- 21:44sort of gravitated
- 21:44towards C and
- 21:46then for the
- 21:46other aspects,
- 21:47it sounds like
- 21:48Python is what
- 21:49everyone agreed
- 21:50to.
- 21:50It's like, hey,
- 21:51we want to
- 21:51visualize this,
- 21:52we want to do
- 21:52some notebook
- 21:53stuff, we want
- 21:53to piece things
- 21:54together,
- 21:55something like
- 21:56that, right?
- 21:56It's certainly
- 21:57moving that way.
- 21:58They definitely
- 22:00have sort of
- 22:00agreed that
- 22:01Python should
- 22:02be a first-class
- 22:03language and
- 22:05join C++.
- 22:05That was decided
- 22:06a few years ago.
- 22:07And I think
- 22:09that's been a
- 22:10great step in
- 22:10the right direction
- 22:11because what was
- 22:11happening, people
- 22:12were coming in
- 22:13with Python
- 22:14knowledge.
- 22:14They wanted to
- 22:14use Pandas.
- 22:15I came in
- 22:16that way as
- 22:17well.
- 22:17Pandas and
- 22:18Numba and all
- 22:19these tools were
- 22:20really, really
- 22:20nice.
- 22:21And we were
- 22:22basically just
- 22:23having to write
- 22:23them all
- 22:24ourselves in
- 22:25C++.
- 22:25It has a
- 22:26data frame,
- 22:27but why not
- 22:28just use Python,
- 22:30which is what
- 22:31people know
- 22:31anyway?
- 22:32Panda exists.
- 22:33There's a ton
- 22:34of people already
- 22:34doing the work
- 22:35maintaining it
- 22:36for us.
- 22:36Root literally
- 22:38has a string
- 22:38class.
- 22:39Literally,
- 22:41they do
- 22:42everything.
- 22:42So the idea,
- 22:44and this is
- 22:45sort of the
- 22:45idea behind
- 22:45Scikit-HEP
- 22:46was to build
- 22:47this collection
- 22:49of packages
- 22:50that would just
- 22:51fill in the
- 22:51missing pieces,
- 22:52the things that
- 22:53energy physicists
- 22:54were used to
- 22:54and needed.
- 22:55And some of
- 22:57them are general
- 22:57and were just
- 22:58gaps in the
- 22:59data science
- 23:00ecosystem,
- 23:00and some
- 23:01things are
- 23:01very specific,
- 23:02high energy
- 23:03physics.
- 23:03Scikit-HEP
- 23:04actually sort
- 23:05of originated
- 23:07as a single
- 23:08package.
- 23:08It sort of
- 23:10looked like
- 23:11root red at
- 23:12first,
- 23:12and it was
- 23:13invented by
- 23:14someone called
- 23:15Eduardo
- 23:15Rodriguez,
- 23:15who was
- 23:16actually in
- 23:16my office
- 23:17at CERN,
- 23:18and we're
- 23:18office mates.
- 23:19But he did
- 23:20something I think
- 23:21really brilliant
- 23:21when he did
- 23:22this,
- 23:22and that is
- 23:23he created
- 23:23an organization
- 23:24called Scikit-HEP
- 23:25around it,
- 23:25and then he
- 23:26went out and
- 23:27spoke with
- 23:27people and
- 23:28got some of
- 23:28the other
- 23:29Python packages
- 23:30that existed
- 23:30at the time
- 23:31to join
- 23:32Scikit-HEP,
- 23:32moved them
- 23:33over and
- 23:33started building
- 23:34a collection of
- 23:35some of the
- 23:36most popular
- 23:36Python packages
- 23:37at the time.
- 23:38And I thought
- 23:39that was great,
- 23:40and I really
- 23:41wanted Scikit-HEP
- 23:42to become a
- 23:43collection of
- 23:44tools,
- 23:44separate tools,
- 23:45and for the
- 23:45Scikit-HEP
- 23:46package to just
- 23:47be sort of a
- 23:48meta package that
- 23:48just grabbed all
- 23:49the rest.
- 23:50And that's
- 23:50actually kind of
- 23:51where it is now.
- 23:51Right.
- 23:52I can pip install
- 23:53Scikit-HEP.
- 23:53Is that right?
- 23:54You can,
- 23:55and mostly,
- 23:55other than a few
- 23:56little things that
- 23:57are still in there
- 23:57that never got
- 23:58pulled out,
- 23:59that will mostly
- 24:00just install our
- 24:01most popular,
- 24:01maybe 15 or so
- 24:03packages,
- 24:032015 of our
- 24:05most popular
- 24:05packages.
- 24:06Yeah, so it
- 24:07probably doesn't
- 24:08really do anything
- 24:08other than,
- 24:09say, it depends
- 24:10on those packages
- 24:11or something like
- 24:12that, right?
- 24:12And then by
- 24:13virtue of installing
- 24:14it, it'll grab
- 24:14all the pieces.
- 24:15Yeah, yeah,
- 24:16that's a really
- 24:17cool idea and I
- 24:17like it.
- 24:18So maybe one of
- 24:19the things I
- 24:19thought would be
- 24:20fun is to go
- 24:21through some of
- 24:22the packages there
- 24:23to give people a
- 24:24sense of what's
- 24:25in here.
- 24:25Some of these are
- 24:26pretty particular
- 24:27and I don't think
- 24:28would find broad
- 24:29use outside of
- 24:30CERN.
- 24:31For example,
- 24:31Conda Forge
- 24:32Root.
- 24:33It sounds like
- 24:35that's about
- 24:35building root so
- 24:36I can install it
- 24:37as a dependency
- 24:37or something like
- 24:38that, right?
- 24:39building root is
- 24:40horrible and
- 24:41you actually now
- 24:42can get it as
- 24:43part of a
- 24:44Conda package
- 24:45which is just
- 24:46way better than
- 24:47anything that was
- 24:48available for
- 24:49attaching it to a
- 24:49specific version of
- 24:50Python because it
- 24:51has to compile
- 24:52against a very
- 24:53specific version of
- 24:54Python but that's
- 24:55what it does.
- 24:56So unless you want
- 24:57something in root
- 24:57then that's very
- 25:00HEP specific.
- 25:00Yeah, absolutely.
- 25:01Some more general
- 25:02ones, probably
- 25:03our first, briefly
- 25:05Mitch, our very
- 25:05first package that I
- 25:07think was really
- 25:07popular among
- 25:08energy physicists
- 25:09that we actually
- 25:12produced was
- 25:13Uproot which was
- 25:15just a pure Python
- 25:16package so you
- 25:17didn't have to
- 25:17install it that
- 25:19read root files.
- 25:19Again, very
- 25:20specific for
- 25:21somebody who was
- 25:23in high energy
- 25:24physics but you
- 25:25could actually read
- 25:26a root file and
- 25:27get your data without
- 25:28installing root and
- 25:29that was a game
- 25:30changer.
- 25:31So now you can
- 25:32actually install
- 25:33root slightly easier
- 25:34but normally it's a
- 25:35multi-hour compile and
- 25:36it's got.
- 25:38gotten better but
- 25:38it's still a bit of
- 25:39a beast to compile
- 25:40especially for Python.
- 25:40Yeah, that does
- 25:41sound like a beast.
- 25:41Oh my gosh.
- 25:42And now you can
- 25:43just read in your
- 25:43files.
- 25:44Basically, Jim
- 25:46Povarsky basically
- 25:46just taught Python
- 25:47to understand the
- 25:49decompile the root
- 25:50file structure and
- 25:52actually can write
- 25:52right now too but
- 25:53originally reading.
- 25:54But that actually
- 25:55was really...
- 25:56So this is like if
- 25:56I want to do, if I
- 25:58want to create a
- 25:58notebook and maybe
- 25:59visualize some of
- 26:00the data but I
- 26:00don't really need
- 26:01access to anything
- 26:02else, I shouldn't
- 26:03depend on this
- 26:04beast of almost its
- 26:06own operating system
- 26:07type of thing.
- 26:08Yeah, we were
- 26:09very close to being
- 26:10able to use all the
- 26:11data science tools in
- 26:12Python, pandas, things
- 26:13like that.
- 26:13For most data
- 26:15worked fine.
- 26:15You just had to get
- 26:17the data.
- 26:17And I mean, I've
- 26:19done this too where
- 26:20I had one special
- 26:22install of Python and
- 26:23root together that I'd
- 26:24worked several hours on
- 26:25and it sat somewhere
- 26:26and I would convert
- 26:27data with it.
- 26:27I'd move it to HDF5
- 26:29and then I would do
- 26:31all the rest of the
- 26:31analysis in Python that
- 26:32didn't have it because
- 26:33then I could do
- 26:34virtual environments and all
- 26:35that read that HDF5
- 26:36format, right?
- 26:37Mm-hmm.
- 26:37Yeah.
- 26:38Right, okay.
- 26:39The first package we
- 26:40had that was really
- 26:41popular on its own was
- 26:43Awkward Array.
- 26:44Yeah.
- 26:44Awkward Arrays.
- 26:45I definitely heard
- 26:47about this one, yeah.
- 26:47Yeah, that was
- 26:49originally part of
- 26:50Upproot, sort of grew
- 26:50out of Upproot.
- 26:51When you're reading
- 26:52root files, you end up
- 26:53with these jagged
- 26:54arrays.
- 26:55So that's an array that
- 26:57is not rectangular.
- 26:58So at least one
- 27:00dimension is jagged.
- 27:01it depends on the data
- 27:02and this shows up in
- 27:04all sorts of places
- 27:05and not just particle
- 27:07collisions or obviously
- 27:08shows up lots of places
- 27:09in particle collisions
- 27:09like how many hits
- 27:10got triggered in the
- 27:11detector.
- 27:12That's a variable length
- 27:12list.
- 27:13How many tracks are in
- 27:14an event?
- 27:14You know, that's a
- 27:15variable length list
- 27:15and can be a variable
- 27:17length list of
- 27:18structured data.
- 27:18And to store that
- 27:20compactly the same way
- 27:21you'd use numpy was
- 27:23one thing, but you can
- 27:25arrow and there's some
- 27:26other, there's some
- 27:27other things that do
- 27:27this, but Awkward Array
- 27:28also gives you numpy
- 27:30like indexing and data
- 27:33manipulation.
- 27:33And that was the sort
- 27:35of the breakthrough
- 27:36thing here.
- 27:36It's like numpy.
- 27:38The original one was
- 27:39built on top of numpy.
- 27:40The new one actually
- 27:41has some pybind11
- 27:43compiled bits and pieces,
- 27:44but it makes working
- 27:47with that really well.
- 27:47In fact, Jim Povarsky
- 27:48has now got a grant
- 27:50to expand this to,
- 27:52I don't remember the
- 27:53number of different
- 27:54disciplines that he's
- 27:55working with, but lots
- 27:56of different areas,
- 27:57genomics and things
- 27:58like that have all
- 27:59use cases and he's
- 28:00adding things like
- 28:02complex numbers and
- 28:03things that weren't
- 28:03originally needed by
- 28:04energy physicists, but
- 28:05make it widely.
- 28:07Almost an evangelism,
- 28:08like dev evangelism
- 28:10type of role, right?
- 28:11Go talk to the other
- 28:13groups and say, hey,
- 28:14we think you should be
- 28:15using this.
- 28:16What is it missing for
- 28:17you to really love it?
- 28:18Something like that,
- 28:18right?
- 28:19How interesting.
- 28:20Yeah.
- 28:20So, yeah.
- 28:22Yeah.
- 28:22So looking at the
- 28:23Awkward Array page
- 28:25here says for a
- 28:26similar problem,
- 28:2710 million times
- 28:28larger than this
- 28:29example given above,
- 28:30which one above is
- 28:31not totally simple.
- 28:32So that's pretty
- 28:33crazy.
- 28:33It says Awkward
- 28:34Array, the one
- 28:36liner takes 4.6
- 28:38seconds to run and
- 28:39uses 2 gigs of
- 28:40memory.
- 28:40The equivalent
- 28:41Python list in
- 28:42dictionaries takes over
- 28:43two minutes and uses
- 28:4510 times as much
- 28:46memory, 22 gigs.
- 28:47So, yeah, that's a
- 28:48pretty appealing value
- 28:50proposition there.
- 28:50Yeah.
- 28:51And it supports
- 28:52Numba.
- 28:53Jim works very closely
- 28:55with the Numba team
- 28:56and really is one of
- 28:58the experts on the
- 28:58Numba internals.
- 28:59So, yeah, it has full
- 29:01Numba support now and
- 29:02he's working on adding
- 29:03Dask.
- 29:04He's working with
- 29:05Anaconda on this grant
- 29:06and then working with
- 29:08adding GPU support.
- 29:09Very cool.
- 29:10Maybe not everyone out
- 29:11there knows what
- 29:12Numba is.
- 29:12Maybe give us a quick
- 29:14elevator pitch on
- 29:15Numba.
- 29:15Yeah.
- 29:15I hear it makes
- 29:16Python code fast,
- 29:17right?
- 29:18Yeah, it's a just-in-time
- 29:20compiler and it takes
- 29:23Python.
- 29:23It takes Python.
- 29:24It actually takes the
- 29:25bytecode and then it
- 29:27basically takes that
- 29:30back to something or it
- 29:31parses the bytes code
- 29:32and turns it into LLVM.
- 29:34So it works a lot like
- 29:35Julia except instead of
- 29:37a new language, it's
- 29:38actually reading Python
- 29:39bytecode, which is
- 29:40challenging because the
- 29:41Python bytecode is not
- 29:43something that stays
- 29:44static or is supposed to
- 29:45be a public detail.
- 29:47Yeah, there's no
- 29:48public promises about
- 29:50consistency of bytecode
- 29:52across versions because
- 29:54they play with that all
- 29:55the time to try to
- 29:56speed up things and
- 29:57they add bytecodes and
- 29:58they try to do little
- 29:59optimizations.
- 30:00Yeah, so every Python
- 30:01release breaks Numba.
- 30:02So they have to, they
- 30:04just know the next
- 30:04Python release will not
- 30:05support Numba and it
- 30:06usually takes a month
- 30:07or two.
- 30:07But it's very
- 30:10impressive though.
- 30:11It's the speedups,
- 30:12you do get full sort of
- 30:13C type speedups for
- 30:15something that looks
- 30:16just like Python.
- 30:16It compiles really fast
- 30:18for a small problem and
- 30:20it's as fast as anything
- 30:22else you can do.
- 30:23I've tried lots of
- 30:25these various
- 30:26programming problems and
- 30:28you just about can't
- 30:29beat Numba.
- 30:29It actually knows what
- 30:30your architecture is
- 30:32since it's just in time
- 30:32compiling.
- 30:33So you have to do
- 30:34which is an advantage
- 30:35over say like C, right?
- 30:37It can look exactly at
- 30:38what your platform is and
- 30:40your machine architecture
- 30:41and say we're going to
- 30:41target, you know, I see
- 30:43your CPU supports this
- 30:44special vectorized thing
- 30:46or whatever and it's
- 30:46going to build that in,
- 30:47right?
- 30:47and then what sort of Jim
- 30:49does with Awkward and
- 30:50we've done with some
- 30:50other things with Vector
- 30:51does this too.
- 30:52You can control what
- 30:55Python turns into what
- 30:57LLVM constructs any
- 30:58Python turns into because
- 31:00you can control that
- 31:00compile phase.
- 31:02That's incredibly
- 31:03powerful because you can
- 31:04say and it doesn't have
- 31:05to be the same thing but
- 31:06obviously you want it to
- 31:08behave the same way.
- 31:08You can say if you see
- 31:09this structure, this is
- 31:11what it turns into.
- 31:12in LLVM machine code
- 31:16which then gets compiled
- 31:17or machine language
- 31:18which then gets compiled
- 31:19into your native machine
- 31:20language.
- 31:21Interesting.
- 31:21Assembling.
- 31:22So if you have like a
- 31:23certain data structure
- 31:24that you know can be
- 31:25well represented or gets
- 31:27packed up in a certain
- 31:28way to be super efficient
- 31:29you can control that?
- 31:30Yeah, you can say that
- 31:32well this like this
- 31:33operation on this data
- 31:34structure, this is what
- 31:35this is what it should do
- 31:36and then that turns into
- 31:38LLVM and maybe it can
- 31:38get vectorized or things
- 31:40like that for you.
- 31:41Yeah, yeah.
- 31:42That's super neat.
- 31:43Another package in the
- 31:44list that I got to talk
- 31:45about because just the
- 31:46name and the graphic is
- 31:47fantastic is a gassed.
- 31:49What is a gassed?
- 31:51It's got like this
- 31:51the scream.
- 31:53I forgot who was the
- 31:54artist of that but the
- 31:55scream sort of look as
- 31:58part of the logo is good.
- 31:59About half of the logos
- 32:01come from Jim and I did
- 32:02about half and he did
- 32:04about half and then
- 32:04use other around or from
- 32:06the individual package
- 32:07authors.
- 32:07A gassed was so this is
- 32:09sort of part of the
- 32:10histogramming area which
- 32:11is where sort of the
- 32:12area I work in,
- 32:13psychic hub.
- 32:13But Jim actually wrote
- 32:15a gassed and the idea
- 32:16was that it would
- 32:16convert between
- 32:17histogram representations.
- 32:19I think it came up
- 32:20because Jim got tired of
- 32:21writing histogram libraries.
- 32:22I think he's written at
- 32:23least five.
- 32:24Yeah, one of the things
- 32:25I got the sense of by
- 32:27looking through all the
- 32:28psychic hub stuff,
- 32:29there's a lot of
- 32:30histogram stuff happening
- 32:31over there.
- 32:32histograms are sort of the
- 32:34area that I was in and it
- 32:35ended up coming in in
- 32:36several pieces.
- 32:37But I think one of the
- 32:39important things was
- 32:40actually, and I think a
- 32:40gassed may not really
- 32:41matter, it may get
- 32:43archived at some point
- 32:44because instead of
- 32:45translating between
- 32:47different representations of
- 32:49histograms in memory,
- 32:50what you can do is define
- 32:52a static typing protocol
- 32:53and it can be checked by
- 32:56mypy that describes
- 32:57what a object needs
- 33:01to be called a
- 33:01histogram.
- 33:01And so I've defined that
- 33:03as a package called
- 33:04UHI, Universal Histogram
- 33:05Interface.
- 33:06And anything that
- 33:07implements UHI, it can
- 33:08be fully checked by
- 33:09mypy, will then be able
- 33:11to take any object
- 33:14from any library that
- 33:16implements UHI.
- 33:17And so all the libraries
- 33:19we have that produce
- 33:20histograms, so uproot,
- 33:21when it reads a root
- 33:22histogram or hist and
- 33:24boost histogram, when they
- 33:25produce histograms, they
- 33:26don't need to depend on
- 33:27each other.
- 33:28They don't even depend on
- 33:28UHI, that's just a
- 33:29static dependency for
- 33:31mypy time.
- 33:32And then they can be
- 33:34plotted in MPLHEP or
- 33:37they can be printed to
- 33:38the terminal with
- 33:39histoprint and there's
- 33:40no dependencies there.
- 33:42One doesn't need the
- 33:43other.
- 33:43And that's sort of
- 33:44making a gassed somewhat
- 33:46unneeded because now
- 33:47it really doesn't matter.
- 33:48You don't have to
- 33:49convert between two
- 33:49because they both just
- 33:51work.
- 33:51They work on the same
- 33:52underlying structure
- 33:54basically, right?
- 33:54They work through the
- 33:56same interface.
- 33:57Right.
- 33:58Yeah.
- 33:58So a gassed is a way to
- 34:00work with different
- 34:01histogramming libraries
- 34:02that kind of is the
- 34:04intermediary of that.
- 34:06It's like an abstraction
- 34:07layer on that.
- 34:08Okay.
- 34:08What are some other ones?
- 34:10Yeah.
- 34:11What are some other ones
- 34:12we should kind of give a
- 34:13shout out to?
- 34:14we talked about GUFIT, which
- 34:15is there.
- 34:16It's an affiliated package.
- 34:17It's not part of
- 34:18scikit-hep, but it has.
- 34:19So we developed this idea
- 34:21of an affiliated package
- 34:22for sure things that
- 34:23didn't need to be moved
- 34:24in, but had at least one
- 34:26scikit-hep developer
- 34:27working with them.
- 34:30At least that's my
- 34:31definition.
- 34:31I was never able to
- 34:32actually get the rest to
- 34:33agree to exactly that
- 34:34definition, but that's my
- 34:36working definition.
- 34:37And so that's why
- 34:38pybind11 gets listed
- 34:39there.
- 34:39It's an affiliated package
- 34:41because we share a
- 34:42developer, me, with the
- 34:44pybind11 library.
- 34:45And we sort of have a
- 34:47say in how that is
- 34:49developed.
- 34:50And most importantly, if
- 34:52we have somebody come
- 34:52into scikit-hep, we want
- 34:53them to use pybind11
- 34:54over the other tools
- 34:55because that one we have
- 34:57a lot of experience with.
- 34:58Very cool.
- 34:59Another one I thought
- 35:00was interesting is
- 35:01hep units.
- 35:02So this idea of
- 35:03representing units like
- 35:05the standard units,
- 35:07they're not enough for
- 35:08us.
- 35:08We have our own kind of
- 35:09things like molarity and
- 35:12stuff, but also luminosity
- 35:14and other stuff, right?
- 35:16Yeah.
- 35:16Different experience
- 35:17service can differ a bit.
- 35:20So there's a sort of a
- 35:21standard that got built up
- 35:22for units.
- 35:23And so this just sort of
- 35:25puts that together and
- 35:26has, and the unit that
- 35:29we've sort of decided on
- 35:30this should be the
- 35:31standard unit that's one
- 35:32and the rest are
- 35:32different scalers.
- 35:33It's a very tiny little
- 35:34library.
- 35:35It was the first one to be
- 35:36fully statically
- 35:36typed because it was
- 35:38tiny.
- 35:38That's easy to do.
- 35:39It was like, because
- 35:40mypy infers constants,
- 35:41there was like two
- 35:43functions or something
- 35:43and then it was done.
- 35:44Yeah.
- 35:45Probably a lot of floats.
- 35:46Mm-hmm.
- 35:47So, but, and that's,
- 35:49that's sort of what it is.
- 35:50So you can use that if,
- 35:51and the idea is that the
- 35:52rest of the libraries
- 35:53will, will adhere to
- 35:55that system of units.
- 35:57So then if you use this
- 35:58and then use that, the
- 35:59values it gives you,
- 36:00then you can have a nice
- 36:02human, human readable
- 36:03units and be sure of your
- 36:05units.
- 36:05Yeah.
- 36:05That's really neat.
- 36:06Have you heard of pint?
- 36:08Are you familiar with this
- 36:09one?
- 36:09Yes, I love pint.
- 36:10Oh gosh, I think
- 36:11pint is interesting as well.
- 36:13It takes the types
- 36:14through and I use pint
- 36:15some, but it actually
- 36:17gives you a quantity out
- 36:19or a numpy quantity.
- 36:21Whereas the happiness just
- 36:23stays out of the way and
- 36:24it's a way to be more
- 36:26clear in your code, but it's
- 36:27not enforced.
- 36:27Pint is enforced, which I
- 36:28like enforcing, but it's
- 36:30also can slow down.
- 36:31You can't, these are not
- 36:32actual real numbers
- 36:33anymore.
- 36:34So you pay it.
- 36:35Yeah.
- 36:35So it's going to add a ton
- 36:36of overhead, right?
- 36:36But pint's interesting
- 36:37because you can do things
- 36:38like three times meter
- 36:40plus four times centimeter
- 36:41and you end up with
- 36:433.04 meters.
- 36:44Yeah.
- 36:45Those are actually real
- 36:45quantities.
- 36:46They're actually a different
- 36:47object, which is the good
- 36:49thing about it, but it's
- 36:50also the reason that then
- 36:50it's not going to talk to
- 36:51say a C library that
- 36:52expects a regular number
- 36:54or something as well.
- 36:55Sure.
- 36:55Okay.
- 36:56Maybe one or two more and
- 36:58then we'll probably be out
- 36:59of time for these.
- 37:00What else should people
- 37:01maybe pay attention to that
- 37:02they could generally find
- 37:03useful over here?
- 37:04You mentioned vector.
- 37:05It's a little bit newer,
- 37:05but it's certainly for
- 37:07general physics.
- 37:08I think it's useful because
- 37:10it's a library for 2D,
- 37:123D and relativistic
- 37:14vectors.
- 37:15And there aren't really,
- 37:16it's a very common sort of
- 37:19learning example you see,
- 37:20but there aren't really
- 37:21very many libraries that do
- 37:22this, that actually have,
- 37:23if you want to take the
- 37:24magnitude of a vector in 3D
- 37:27space, there just isn't a
- 37:28nice library for that.
- 37:29So we wrote vector to do
- 37:31that.
- 37:31And vectors is supported by
- 37:33awkward.
- 37:34It has an awkward backend.
- 37:35It has a number backend,
- 37:36a numpy backend, and then
- 37:38plain object backend.
- 37:39Eventually we might work on
- 37:40more.
- 37:41And it even has a number
- 37:42awkward.
- 37:42So you can, you can use a,
- 37:44a vector inside an awkward
- 37:46array inside a number jet
- 37:48compiled loop and still take
- 37:50magnitudes and do stuff like
- 37:51that.
- 37:51That's really cool.
- 37:52That integration there.
- 37:53Yeah.
- 37:54vectors because we have a lot
- 37:55of those in physics.
- 37:56Sure.
- 37:56And you can, you can do things
- 37:58like ask if one vector is
- 38:00close to another vector and
- 38:01things like that, even in
- 38:03different, it looks like a
- 38:04one in polar coordinates and
- 38:05one in, you know, a
- 38:07Cartesian or something like
- 38:08that.
- 38:08It has different unit systems
- 38:09and it can actually, it
- 38:11actually stores the vector in
- 38:12that.
- 38:13So you don't waste memory or
- 38:14something.
- 38:15If that's, that's the
- 38:15representation you have, that
- 38:17was a feature from a route
- 38:18that we wanted to make sure we,
- 38:19we got.
- 38:20And it also has sort of the
- 38:21idea of, of momentums too
- 38:22and stuff for the, for the
- 38:23relativistic stuff.
- 38:24We end up with a lot of that.
- 38:26And then maybe just mention the,
- 38:27since we mentioned the
- 38:29histogramming stuff and that's
- 38:29the area, that's the ones that I
- 38:30really work on.
- 38:31The ones I specifically work on
- 38:33that are general purpose.
- 38:34Boost histogram is a wrapper for
- 38:36the C++ boost histogram library.
- 38:38Boost is the sort of the big
- 38:40C++ library, just one step below
- 38:43the standard library.
- 38:45And right at the time I was
- 38:47starting at, at Princeton, the,
- 38:49I met the author of boost
- 38:50histogramming who's from
- 38:51physics and he was in the
- 38:54process, I believe, of getting
- 38:55this accepted into boost.
- 38:57And it got accepted after that.
- 38:58But one of the things that he
- 39:00decided to do is pull out his
- 39:02initial Python bindings that
- 39:03were written in boost Python,
- 39:06which is actually very similar to
- 39:08pybind11, but requires boost
- 39:10instead of not requiring anything.
- 39:11But the design is intentionally
- 39:13very similar.
- 39:13And so I proposed I would, I
- 39:16would work on boost histogram
- 39:17and write these, this, the
- 39:20Python bindings for it inside
- 39:22scikit-hep.
- 39:22And that would be sort of the
- 39:23main project I started on when I
- 39:25started at Princeton.
- 39:26And that's, you know, that's
- 39:28what I did.
- 39:29Boost histogram is a extremely
- 39:30powerful histogramming library.
- 39:32So it's a histogram as an
- 39:33object rather than like a
- 39:35NumPy, you can, there's a
- 39:36histogram function and you give
- 39:37it an array and then it spits a
- 39:38couple of arrays back out at
- 39:40you.
- 39:40You are now, you now have to
- 39:43manage these.
- 39:44They don't have any special
- 39:45meaning.
- 39:45Whereas boost histogram,
- 39:46histograms really are much more
- 39:48natural as an object, just like a
- 39:49data frame is more natural as an
- 39:50object where you tie that
- 39:51information together.
- 39:52A histogram's really natural that
- 39:54way, where you still have the
- 39:55information about what the data
- 39:56actually was on the axes.
- 39:58If you have labels, you want to
- 40:00keep those attached to those, to
- 40:02that, to that data.
- 40:03And you may need to fill again,
- 40:04which is one of the main things
- 40:05that,
- 40:06energy physicists really wanted
- 40:07because we tend to fill
- 40:09histograms and then keep
- 40:09filling them or rebinning them
- 40:11or doing operations on them.
- 40:12And you can do all those very
- 40:13naturally.
- 40:14And boost histograms, the
- 40:15actual, the C++ wrapper in
- 40:18PyBind 11 and a lot of, and,
- 40:20I actually got involved in CI
- 40:22BuildWell because of boost
- 40:22histogram, because I, one of the
- 40:24things I wanted to just make sure
- 40:25it worked everywhere.
- 40:26And it obviously requires C++.
- 40:27It requires compilation.
- 40:30and then hist is a nice
- 40:31wrapper on top of that that just
- 40:32makes it a lot more friendly to,
- 40:33to use because the original
- 40:35boost histogram author wants to
- 40:37keep this, Hans Dubinsky wants
- 40:38to keep this quite, pure and
- 40:40clean.
- 40:40So hist is a more, the more
- 40:42natural.
- 40:43And even if you're not in hep,
- 40:44I think that's still the more
- 40:45natural one to use.
- 40:45Yeah.
- 40:46Gold.plot and plot.
- 40:48Right, right.
- 40:48There's a lot of people who do,
- 40:50who use histograms across all
- 40:52sorts of disciplines.
- 40:52So that would definitely be one of
- 40:54those that is generally useful.
- 40:56All right.
- 40:56So I think that brings us to CI
- 40:59build wheel.
- 40:59let's, let's talk a bit
- 41:01about that.
- 41:02And I mean, maybe the place to
- 41:04start here is, you want
- 41:05to wheels, right?
- 41:06The, the first sentence
- 41:08describing it as Python wheels
- 41:09are great building them across
- 41:10Mac, Linux, windows, and other
- 41:11multiple versions of Python.
- 41:13Not so much.
- 41:14So no description.
- 41:15Yeah, exactly.
- 41:17Well, wheels are good.
- 41:19There's times when there are no
- 41:21wheels and things install slower.
- 41:23They might not install at all.
- 41:24It's generally a bad thing if
- 41:26you don't have a wheel, but,
- 41:27they're, they're not easy
- 41:29to make.
- 41:29Right.
- 41:29So tell us what is a wheel and
- 41:31then let's talk about why maybe
- 41:32building them across all these
- 41:33platforms and this, cross
- 41:35product along with like versions
- 41:37of Python and whatnot.
- 41:38It's a mess.
- 41:39When you distribute Python, you
- 41:40have several options.
- 41:41The most common one and most
- 41:43packages have at least an S
- 41:45dist, which is just basically a
- 41:46tar ball of the, of the source.
- 41:48Right.
- 41:49When you pip install it,
- 41:50it basically, you're missing
- 41:51some things or adding some
- 41:52things, but right.
- 41:53Otherwise it's mostly
- 41:53unzips.
- 41:54Yeah.
- 41:54It unzips your source and puts
- 41:55it somewhere.
- 41:56Python will find it.
- 41:57And then that's that.
- 41:58Yeah.
- 41:58So it runs your build system.
- 42:00So set up tools traditionally
- 42:01that's become a lot more
- 42:02powerful recently, but, it
- 42:04has to run the build system to
- 42:06figure out what, what do you do
- 42:07with it?
- 42:07This is just a bunch of files.
- 42:08and then it puts it together in a
- 42:10particular structure in your, in
- 42:12your, on your computer.
- 42:14And so a wheel was a package that
- 42:16was already, everything was
- 42:19already in place.
- 42:19So it's already in a particular
- 42:21structure.
- 42:21It knows, knows the structure and
- 42:23all Python has to do for a pure
- 42:25Python wheel, one that does not
- 42:26have any, binary pieces in
- 42:29it.
- 42:30It just grabs the contents inside and
- 42:33dumps them following a specific,
- 42:35set of rules into places into your,
- 42:38um, site packages.
- 42:39Right.
- 42:39So then you now have something
- 42:40installed.
- 42:40There's no setup.py in your wheel.
- 42:42There's no pyproject.tomol.
- 42:45There's those sorts of things are
- 42:46not in the wheel.
- 42:47The wheel's already there.
- 42:48It can't run arbitrary code.
- 42:51Yeah, exactly.
- 42:51That was one of the points I was
- 42:52going to make is one of the
- 42:53things that can be scary about
- 42:55installing packages is just by
- 42:57virtue of installing them, you're
- 42:59running arbitrary code because
- 43:01often that is execute, you know,
- 43:03Python space, set up py space,
- 43:06you know, install or something
- 43:08like that.
- 43:08And like, whatever that thing
- 43:09does, that's what happens when
- 43:11you pip install.
- 43:11Right.
- 43:12But not with wheels, as you said,
- 43:13it comes down in a binary blob
- 43:14and just like, boom, here it is.
- 43:16Obviously the thinking is we have
- 43:18this package delivered to a
- 43:20million computers.
- 43:21Why do we need to have every
- 43:22million computer run all the
- 43:23steps?
- 43:24Why don't we just run it once and
- 43:25then go here?
- 43:26And then also that saves you a
- 43:28ton of time.
- 43:28Right.
- 43:29like I just installed micro
- 43:31whiskey and it took, I don't
- 43:32know, 30 seconds, 45 seconds to
- 43:34install because it didn't have a
- 43:36wheel.
- 43:36So it sat there and it just
- 43:37grinded away compiling it, you
- 43:39know?
- 43:39Yeah.
- 43:40So there's two possibilities.
- 43:41A pure Python package, a wheel is
- 43:44still superior because of the not
- 43:46running arbitrary code.
- 43:47Pip will actually go ahead and
- 43:49compile all your PYC files.
- 43:51Your, that goes ahead and makes
- 43:53the bytecode for all those.
- 43:55If it's a wheel, if it's an S, if
- 43:56it's a tarball, it doesn't do
- 43:58that.
- 43:58If it doesn't pass through the
- 44:00wheel stage anyway.
- 44:00And then when, every time you open
- 44:03the file, then it's going to have
- 44:04the first time it's going to have
- 44:05to make that, that bytecode.
- 44:06So it'll be a little slower the
- 44:07first time you open it.
- 44:08There's, there's a variety of, of
- 44:10reasons.
- 44:10I think it's pythonwheels.com,
- 44:12something like that.
- 44:13That describes why you should use
- 44:15wheels.
- 44:16That's maybe that's not it, but
- 44:18I think it is.
- 44:18Yes.
- 44:19Python wheels.
- 44:19So they have like a list of
- 44:20advantages there, but.
- 44:23Yeah.
- 44:23I also have a little like
- 44:25checklist.
- 44:25It says, how are we doing for the
- 44:28top 360 packages?
- 44:30And apparently 342 of them have
- 44:32wheels.
- 44:32And it shows you for your popular
- 44:34packages, which ones like click does,
- 44:37but future doesn't, for example, and so
- 44:38on.
- 44:39So.
- 44:39Future's been there for a long time.
- 44:41Yeah.
- 44:42But, but yeah, so wheels are really
- 44:44good.
- 44:45And they actually replaced an older
- 44:47mechanism that was trying to do
- 44:49something somewhat similar called
- 44:50eggs, but I avoid talking about
- 44:52those.
- 44:53I don't really understand.
- 44:54Let it live in the past.
- 44:55Let it live in the past.
- 44:56Wheels also are a great way if you
- 44:59have compile and compile that
- 45:01happens.
- 45:01So if you compile some code as part of
- 45:04your, as part of your build, then
- 45:07that of course is much slower.
- 45:08If you have the, if you just have
- 45:10the example.
- 45:11Yeah.
- 45:11It's like it was doing GCC or something
- 45:13forever.
- 45:13And if you don't have a compiler, it
- 45:14won't even work.
- 45:15Right.
- 45:15Exactly.
- 45:15You have to have some setup, at least
- 45:17a little setup.
- 45:18You have to have a compiler setup at
- 45:19the very moment.
- 45:20Right.
- 45:20How many windows users have seen
- 45:22cannot find vcvars.bat?
- 45:24Right.
- 45:25Like what is this?
- 45:26I don't want this.
- 45:26In windows you have to be in a, in
- 45:27the environment or you have to have
- 45:28the, the right script sourced.
- 45:30Yes.
- 45:30So wheels had also can contain binary
- 45:35components like .so's and things.
- 45:37And they have a tag as part of their
- 45:39name.
- 45:39They have a very special naming scheme
- 45:41for wheels and the tag is stored in
- 45:43the wheel too.
- 45:44And they can tell you what Python version
- 45:47they're good for, what platform they can,
- 45:51are supported on.
- 45:52They have a build number and then they
- 45:54have a, the Python's actually in two
- 45:57pieces.
- 45:57There's the AVI and the interface.
- 46:00Yeah.
- 46:01You can see there's some huge long name
- 46:03that with a bunch of underscores
- 46:04separating it.
- 46:05And basically, when you try to
- 46:07install it, sorry, go ahead.
- 46:09I was saying it's also one of the
- 46:10reasons that names are normalized.
- 46:11There's no difference between a dash
- 46:13and underscore.
- 46:13It's because that special wheel name
- 46:15has dashes in it.
- 46:16So the package name at that point in
- 46:18the, in the file name has to be
- 46:20underscores.
- 46:20Yeah.
- 46:21And so basically when you pip install,
- 46:22it says it, it builds up that, that
- 46:24name and says, do you have this as a
- 46:26binary?
- 46:27Give it to me, right?
- 46:27Something like this.
- 46:28Yeah.
- 46:29It knows how to pick out the, it
- 46:30looks for the right one.
- 46:31If it finds a binary, it'll just
- 46:32download it depending slightly on the
- 46:34system and how new your pip is.
- 46:36Right.
- 46:37And this is one of the main
- 46:38innovations ideas or philosophies
- 46:40behind Conda and, Anaconda,
- 46:44right?
- 46:44It's like, let's just take that and
- 46:45make sure that we build all of these
- 46:47things in a really clear way.
- 46:48And then sort of package up the,
- 46:50the testing and come compilation
- 46:52and distribute, distributing all
- 46:54that together.
- 46:54Right.
- 46:55Yes.
- 46:55This is very similar to this.
- 46:57This came, I think, I'm pretty sure it
- 46:58came after Conda.
- 46:59I think where they were still in
- 47:01eggs when Conda was invented and
- 47:03then sort of building up wheels was
- 47:05challenging.
- 47:05Building a wheel was, was challenging.
- 47:08That's, that's, yeah, build wheel has
- 47:09really changed that.
- 47:10if you want a pure Python, it's
- 47:11really easy.
- 47:12You use today, you should be using the
- 47:14build tool, which I'm also, I'm a
- 47:15maintainer of that as well.
- 47:17but build just builds an S
- 47:19dist for you or it builds a wheel.
- 47:22And so you would say something like
- 47:24Python, set up PY, B dist or
- 47:27something like that.
- 47:28And then boom, I shouldn't be doing
- 47:29that anymore.
- 47:29Please don't.
- 47:30But that is how you do it.
- 47:31Yeah.
- 47:31How would I do it?
- 47:32Tell me the right way.
- 47:33The best.
- 47:34well you could do Python, or
- 47:37pip install build and then Python dash
- 47:40M build, and that will build both an
- 47:42S dist and a wheel and it'll build the
- 47:44wheel from the S dist.
- 47:45if you use pip X, which I would
- 47:47recommend, then you can just say pip X
- 47:49run build and you don't have to do
- 47:50anything that'll, that'll download build
- 47:52into a virtual environment for you.
- 47:54It'll do it.
- 47:54And then it eventually it'll throw away
- 47:55the virtual environment, after a
- 47:57week.
- 47:57Interesting.
- 47:57Okay.
- 47:58So we could just use the build.
- 48:00We should be using the build.
- 48:01You should be using the build tool.
- 48:03It's for an S dist.
- 48:04There's a big, benefit to this.
- 48:06And that is it will, it will, use
- 48:09your piproject.toml.
- 48:10And if you say you require numpy, then
- 48:13it will go, like you're using the
- 48:15numpy headers, the C headers, then it
- 48:17will go and it will, when it's, when
- 48:19it's building S dist, it will make the
- 48:21pep, 517 virtual environment.
- 48:25It'll install numpy, anything that's in
- 48:27your, your, your, requires in
- 48:29your piproject.toml.
- 48:30And then it will run the setup.py,
- 48:34inside that environment.
- 48:35So you can now import numpy directly in
- 48:37there.
- 48:37and it'll work even when you're
- 48:39building an S dist.
- 48:40If you do Python S dist or Python,
- 48:42setup.py stuff, you can't do that because
- 48:45you're literally running Python, giving it
- 48:47setup.py import numpy.
- 48:49now it's broken.
- 48:50Right.
- 48:51It, it, nothing, nothing triggers that, that
- 48:54call to the, pyproject.toml to see what, what you need, for a wheel.
- 49:00The best way to do it is with pip.
- 49:01or the original way to do it was with pip wheel.
- 49:04because pip has to be able to build wheels in order to, install things.
- 49:08The, that got added to pip before build existed.
- 49:13but now the best way to do it would be with build wheel.
- 49:16And that's actually, it's doing the right thing.
- 49:17It's actually trying to build the wheel you want.
- 49:19Whereas pip wheel is actually just building a wheelhouse.
- 49:23So if you depend on numpy and numpy doesn't have wheels, which they did
- 49:27better with Python 3.10.
- 49:28So I'm not going to complain about, about numpy for Python 3.10, but for 3.9, they didn't
- 49:33have wheels for a while.
- 49:33So it'll build the wheels there and it'll build your wheels and it'll dump them all in the
- 49:37wheelhouse or whatever the output is.
- 49:39So you'll get, you'll be building numpy wheels, which you definitely don't want to try to upload.
- 49:43Yeah.
- 49:43Yeah, definitely not.
- 49:44All right.
- 49:45Well, that's, that's really cool.
- 49:46And I definitely learned something.
- 49:47I will start using build instead of, doing it the other way.
- 49:51You can now delete your setup.py too.
- 49:53Yeah.
- 49:53That's the big thing, right?
- 49:54So you don't have to run that kind of stuff, right?
- 49:56Yeah.
- 49:57The, they're trying to move away from the any commands to setup.py because you don't
- 50:01even need one anymore.
- 50:02And, you can't control that, that environment.
- 50:04It's, it's very much an internal detail.
- 50:06Like wrapping up this segment of the conversation, we want a wheel because that's best.
- 50:12It installs without requiring the compiler tools on our system.
- 50:15It installs faster.
- 50:16It's built just for our platform.
- 50:19The challenge is when you become a maintainer, you got to solve this, this matrix of different
- 50:26Python versions that are supported and different platforms.
- 50:28Like for example, there's macOS Intel, there's macOS, M1, Apple Silicon.
- 50:33There's multiple versions of windows.
- 50:35There's different versions of Linux, right?
- 50:38Like arm Linux versus AMD 64 Linux.
- 50:41Yeah.
- 50:42And now muscle, muscle Linux versus the other Linux varieties.
- 50:45Yeah.
- 50:46So one of the challenges with a wheel, is making it distributable.
- 50:51So if you just go out and you build a wheel and then you try to give it to someone else,
- 50:54it may not work.
- 50:54certainly on, Linux, if you try to pretty much, if you do that, that it just won't
- 51:00work.
- 51:00because the systems are going to be different.
- 51:02on macOS, it'll only work on the version you compiled it on and not anything, older.
- 51:07And, you'll even see people trying to compile on, on macOS 10.14 because they're,
- 51:13they want their wheels to work as in many places as you want.
- 51:16Well, you can use the latest one.
- 51:17There's ways to fix that.
- 51:19Well, exactly.
- 51:20It's fine.
- 51:20The jankiest, like I've got a Mac mini from nine, from 2009.
- 51:24We're building on that thing.
- 51:25Cause it will work for most people.
- 51:27Right.
- 51:27I think that's how they actually build the official Python binaries.
- 51:30Interesting.
- 51:31I'm not sure.
- 51:32But then Apple went in like last year around this time, they threw a big spanner in the
- 51:37works and said, you know what?
- 51:38We're going to completely switch to arm and our own silicon.
- 51:41And, you got to compile for something different now.
- 51:43Yeah.
- 51:44And cross compiling has always been a challenge.
- 51:46yeah.
- 51:47And then windows is actually the easiest of all of them.
- 51:49You're most likely on windows to be able to compile something that you can give to someone
- 51:53else.
- 51:53But, the rest of the, that is one of the things that Microsoft's been really pretty good
- 51:57at is backwards compatibility.
- 51:58I get holds them back in other ways, but yeah, typically you can run an app from 20 years ago
- 52:03and it'll still run.
- 52:04Yeah.
- 52:04And there are a few caveats, but not, not many compared, at least compared to the other
- 52:09systems.
- 52:09Apple's really good, but you do have to, you do have to understand how to, you do have
- 52:14to set your minimum version and you have to get a Python that had that
- 52:17minimum version set when it was compiled.
- 52:19But if you do that, it works really well.
- 52:21So what I actually did with what actually started with in scikit-heb, I had this, I had, I was
- 52:26building boost histogram, which needed to be able to run anywhere.
- 52:29That was something I absolutely wanted.
- 52:30It had to be pip install boost histogram and it just worked no matter what.
- 52:33And also we had several other compiled packages at the time, several we had inherited.
- 52:37and, I mean, you is, was compiled and that was quite popular.
- 52:41We had a couple of specific ones and we had a couple, a couple more that ended up being,
- 52:45becoming interested in, in that.
- 52:47fact during this sort of period is when awkward started compiling pieces.
- 52:51And so what I started with was building my own system to do this.
- 52:55It was called, Azure wheel helpers, which, was, as you can guess by the name, Azure
- 53:00was basically a set of Azure, DevOps scripts.
- 53:04It was right after Azure had come out.
- 53:05And I wrote a series of blog posts on this and described the exact process.
- 53:09and sort of the things I'd found out about how you build a compatible wheel.
- 53:13on macOS, you have to make sure you get the most compatible, CPython from, from
- 53:20python.org itself.
- 53:21You, you know, can't use, you can't use brew or something like that because those are
- 53:25going to be compiled for whatever system they were targeting.
- 53:27And on Linux, you have to, you have to run the mini Linux system and you should run audit
- 53:33wheel and actually in Mac, you should run develop.
- 53:35develop, bill wheel, although I might be getting him, I think it's the bill wheel.
- 53:39so there's this, this series of things that you have to do.
- 53:41And I started maintaining this, this multi hundred line set of scripts to do this.
- 53:47And, and I was also being limited by Azure at the time.
- 53:51They didn't have these, all the templates and stuff they have now.
- 53:53So everything had to be managed through get subtree because it couldn't be a separate
- 53:57repository.
- 53:58And, and I, and then when, Jim started working awkward, he went and just rewrote the
- 54:03whole thing to, cause it thought it.
- 54:05He wanted it to look simpler for him and took a couple of things out that were needed and
- 54:09suddenly made it two separate things.
- 54:11Now I had to, had to help maintain that.
- 54:13So when Python 3.8 or whatever it was came out, now I had, I had a completely different
- 54:17set of changes I had to make for that one.
- 54:18And it was really just not, it was not working out.
- 54:21it was not very easy to maintain.
- 54:22And I was watching, cibuildwheel.
- 54:25I, and it was this package.
- 54:27It was a Python package that would, would do this.
- 54:30And it didn't matter what CI system you were on because it was written in Python.
- 54:34and it, it followed nice, Python principles for good package design and had unit tests and all that sort of stuff.
- 54:40So it looked really good.
- 54:41There were a couple of things that was missing.
- 54:43I came in, I added, I made PRs for the things that I'd, I'd come up with that it didn't have.
- 54:47And they got accepted.
- 54:48And, there was a shared maintainer between PI bind 11 and cibuildwheel as well.
- 54:52I think that's one of the reasons that I sort of had heard about it.
- 54:55It was really watching it.
- 54:55And I finally decided just to make the switch.
- 54:57And, I did at some point, a little later, I actually became a maintainer of cibuildwheel.
- 55:02But, I think I started doing the switch before I made it really easy once I was a maintainer to say, oh, this is a package that, you know, we have some control over.
- 55:09It's okay.
- 55:09Let's just.
- 55:10Right.
- 55:10Your package is a choice to depend upon this.
- 55:13Cause we have a say.
- 55:14It just took out all of that, that maintenance.
- 55:16And now, depend about does all the maintenance for us.
- 55:20It does the pin moves for the pin and see a build wheel.
- 55:23And that's it.
- 55:23Nice.
- 55:23So if I want to accomplish, if I'm a package developer owner, and I want to share that package with everybody,
- 55:32we've already determined we would ideally want to have a wheel, but getting that wheel is hard.
- 55:37So cibuildwheel will let you integrate it as the name indicates into your continuous integration.
- 55:43And one of those steps of CI could be build the wheel, right?
- 55:46But it pretty almost, it reduces it down to pretty much that, that there's a step in your CI that says, you know, run cibuildwheel.
- 55:54And then cibuildwheel is designed to really integrate nicely with the build matrix.
- 55:59So, you could, in, for a fairly simple package or for many packages, you can really just do Mac, Windows, and Linux have the same job.
- 56:06I can get up actions.
- 56:07It's easy to do the same job.
- 56:09and then I'll see, I build wheel.
- 56:11And that's about it.
- 56:13It just goes through all the different versions of Python that are supported.
- 56:16It goes, it just goes through and makes, a wheel for each.
- 56:21And, in fact, it even has one feature that was really nice that, I'd always struggled with a bit is testing.
- 56:27So if you give it a test command, it will even take your, your package, it will install it in a new environment.
- 56:32That's not, you know, in a different directory.
- 56:33That's not related to your build at all.
- 56:35And make sure it works and passes whatever test you give it.
- 56:38And,
- 56:38We'll do that across the platforms.
- 56:40We'll do like a macOS test and a Windows test.
- 56:42Yeah.
- 56:43For each.
- 56:43So cibuildwheel really just sees the platform it's sitting on because it's inside the build matrix.
- 56:47And so it's run, run for each.
- 56:49And, yeah, it does for each, each one.
- 56:52It, it, will run that, that test.
- 56:55And the most, the simplest test is just echo.
- 56:57And that will just make sure it installs.
- 56:58Cause it won't try to install your wheel unless, there's something in that test command.
- 57:03Even that's useful sometimes.
- 57:04Even that's broken sometimes because of NumPy not supporting one of those things in that matrix.
- 57:09Yeah.
- 57:09It can't install the dependencies.
- 57:11So that step fails or something.
- 57:12So, it says it currently supports GitHub actions, Azure pipelines,
- 57:17which I don't know how long those are going to be two separate things.
- 57:20Maybe they'll always be separate, but Microsoft owning GitHub be like,
- 57:23they're saying do stuff in Azure pipelines.
- 57:26And then they're kind of moving.
- 57:27Like, yeah, I think they're similar.
- 57:28The runners are the same.
- 57:29They actually have the same environments.
- 57:31so I think they'll exist just as two different interfaces probably.
- 57:35And Azure is not so tied to GitHub and it has more of an enterprise type.
- 57:39Yeah, for sure.
- 57:40It definitely has a different focus.
- 57:41It was just a rewrite and a better rewrite in most cases of it.
- 57:44I got to learn.
- 57:45Yeah.
- 57:46They, I think GitHub actions came second.
- 57:47All right.
- 57:48So then Travis CI app, Bayer circle CI and get lab CI, at least all of those, right?
- 57:53At least those are the, those are the ones we test on.
- 57:56And then, it runs locally.
- 57:58there are some limitations to running it locally.
- 58:00if it's, if you target Linux and you can, any, any system that has Docker in target
- 58:06Linux, you can just ask to build Linux wheels.
- 58:08You can actually run it from like my Mac or from windows.
- 58:11I assume from a Windows machine.
- 58:12I tried Windows with Docker and, Windows.
- 58:15It does install to a, a standard location, C colon backslash cibuildwheel.
- 58:20But other than that, it's safe to run it there.
- 58:22And macOS, it will install to your macOS system.
- 58:25It's installed system versions of Python.
- 58:27So that's something we haven't solved yet.
- 58:29Might be able to someday.
- 58:30so it's not a good idea unless you really are okay with installing every version of Python
- 58:34that ever existed into your, into your system.
- 58:37maybe get a VM of your Mac.
- 58:40The Python.org Python.
- 58:41Yeah.
- 58:42Yeah.
- 58:42I mean, it's somewhat safe.
- 58:43if you're on Windows, you could use, a Windows subsystem for Linux, WSL as well.
- 58:50In addition to Docker, I suspect.
- 58:51Although I haven't tried that.
- 58:53Mini Linux has to run, you could, I'm sure as long as you can launch Docker, the thing
- 58:57that you have to be able to do is launch Docker because you have to use the, mini Linux
- 59:02Docker images or you should use that or derivative of that.
- 59:05There's lots of rules to exactly what can be in the environment and things like that.
- 59:09And PyPA maintains that.
- 59:12One thing that also helps is that we have the main, mini Linux maintainer is also a CI
- 59:17build wheel maintainer.
- 59:18So it's one reason that those things tend that, they fit well together.
- 59:22Features tend to match and come out at the same time.
- 59:25Like, like Musa Linux, which is a big, big thing recently.
- 59:27It's not actually in a released version of cibuildwheel yet.
- 59:30What is Musa Linux?
- 59:31So a normal Linux, is based on Glib C and that's actually what controls.
- 59:37It's one of two things that controls mini Linux.
- 59:39So if, can you download the binary wheel or do you have to build?
- 59:43If you have a old version of pip that will, they had to teach pip about each
- 59:48version of mini Linux.
- 59:48That was a mess.
- 59:50So they eventually switched to not to a standard numbering system.
- 59:53That is your G lib C number.
- 59:55And now pip come.
- 59:56Doesn't.
- 59:56And the current pip will be able to install a future mini Linux as long as your systems.
- 1:00:00But, that was a big problem.
- 1:00:02So pip nine can only install mini Linux one.
- 1:00:05It can't install mini Linux.
- 1:00:06And even if your G lib C is fine for it.
- 1:00:08So the real, the other thing is the G lib C version and, mini Linux one was based on
- 1:00:14Sinto S five, grid hat five.
- 1:00:16mini Linux 2010 was Sinto S six mini Linux 2014 was Sinto S seven.
- 1:00:22And then now they switched to Debian because of the, Sinto S sort of switching to the
- 1:00:26stream model.
- 1:00:27so mini Linux two 14 or two 24 is G lib C 2.24.
- 1:00:32And that's Debian eight or something like that.
- 1:00:36And so, but that's G lib C based.
- 1:00:38There are, distributions that are not G lib C based, most notably Alpine, very used
- 1:00:43Alpine.
- 1:00:44it's this tiny, tiny little Docker image.
- 1:00:47It's really fun distribution to use if you're on Docker, but, it actually sounds fun to
- 1:00:51install, but I've never tried it without Docker, but, it's these five megabyte Docker
- 1:00:56wheels or Docker is Docker doesn't do wheels.
- 1:00:58Docker images, Docker images.
- 1:01:00Yeah.
- 1:01:00But, that doesn't use G lib C.
- 1:01:02That uses muscle.
- 1:01:03And so muscle Linux will run on Alpine.
- 1:01:07Okay.
- 1:01:07Got it.
- 1:01:08So if you're building for the platform Alpine and similar ones, right.
- 1:01:12So anything.
- 1:01:14Yeah.
- 1:01:15And you said, I can run this locally as well.
- 1:01:17I know I would use it in CI cause I'm trying, I've got that matrix of all the versions
- 1:01:22of CPython and pipe pipe, P Y P Y, and then all the platforms that I want to check as many
- 1:01:28of those boxes as possible to put wheels in it.
- 1:01:30Right.
- 1:01:31yeah.
- 1:01:31Suppose I'm on my Mac and I want to make use of this to fill in, maybe do some testing,
- 1:01:37at least on some of these columns.
- 1:01:38Like, how do I do that?
- 1:01:39What's the benefit there?
- 1:01:41Well, I can tell you the case where it happened.
- 1:01:42so we were shipping, CMake and the psychic build organization ran out of Travis credits
- 1:01:50and, they were being built.
- 1:01:52We hadn't switched them over to being emulated builds on, GitHub actions yet.
- 1:01:57And it just ran out.
- 1:01:58We couldn't, we couldn't build them.
- 1:01:59And one of them had been missed and we also weren't waiting to upload.
- 1:02:02So we had uploaded everything, but we had one, one set or maybe, maybe it was all of the emulated
- 1:02:07builds.
- 1:02:07I think it was one set that didn't, didn't work.
- 1:02:09And so we wanted to go ahead and upload those, those missing wheels.
- 1:02:13And I tried, but, I couldn't actually get emulation.
- 1:02:16Docker Q, Q, Q, Q, E, M, U emulation.
- 1:02:20What?
- 1:02:20I couldn't get that working on my Mac.
- 1:02:22So, the mini links maintainer used his Linux machine and he, yeah, had Q, Q, E, M, U emulation
- 1:02:29on it and he built the emulated images a few hours, but he just built them locally and then sent
- 1:02:34and then uploaded, filled in the missing wheels.
- 1:02:36So if, if I'm, maintaining a package, I'm, I got some package I'm putting on pipe AI and I want
- 1:02:43to test it.
- 1:02:44Does it make sense to do it locally or does it just make sense to put it on a summit?
- 1:02:47Some CI system.
- 1:02:49for C and build wheel, usually I do some local testing, but I'm also developing C and build
- 1:02:54wheel, but, you know, usually it's probably fine to do this in your, just in your CI and
- 1:02:59usually don't want to run the full, full thing.
- 1:03:00Every time usually you have your regular unit tests, but C and build wheel is going to be
- 1:03:04a lot slower because it's going through and it's making each set of wheels and launching
- 1:03:08Docker images and things like that.
- 1:03:09and it's installing Python each time, for macOS and windows.
- 1:03:13So, usually unless if you have a fairly quick build, I've seen some people just run C and
- 1:03:17people just run cibuildwheel as part of their test suite.
- 1:03:19but usually you just run it, say right before release.
- 1:03:22Maybe I usually do it once before the release and then I'm the release.
- 1:03:25Right.
- 1:03:26Exactly.
- 1:03:26Okay.
- 1:03:26That makes sense.
- 1:03:27Cause it's a pretty heavyweight type of operation.
- 1:03:30So when I look at all these different platforms, I see macOS Intel, macOS, Apple Silicon, different,
- 1:03:35businesses of windows.
- 1:03:37And then I think about CI systems, you know, what CI systems can I use that support all these
- 1:03:43things?
- 1:03:43Like does GitHub actions support both versions of macOS, for example, plus windows.
- 1:03:48GitHub actions is by far our most popular, platform.
- 1:03:52It switched very quickly.
- 1:03:53It used to be Travis.
- 1:03:54Travis was a challenge cause they didn't do windows very well.
- 1:03:56They still don't do windows very well.
- 1:03:57and it's a challenge for us because we actually can't run our macOS, tests on them anymore.
- 1:04:02Because once we joined the pipe PA, the billing became an issue and we just basically just
- 1:04:07lost, macOS running for it.
- 1:04:09but, circle, I think, Azure and GitHub actions, I think they do all three.
- 1:04:16and you can always flip things up.
- 1:04:18I always do Travis for the Linux and then app fair for windows.
- 1:04:22You can do it that way.
- 1:04:24One of the big things that I had developed for cibuildwheel was the, pipe project
- 1:04:29dot Tomo or any Tomo configuration, usually that, configuration for cibuildwheel.
- 1:04:34That way you can get your cibuildwheel configuration out of your, your, YAML files.
- 1:04:40That way it works locally.
- 1:04:41which is one of the main, one of the things I was after, but also you can just do it and
- 1:04:45then run on several different systems.
- 1:04:47Like you might like the fact that Travis, Travis is, I think the only one that does the,
- 1:04:51native strange architectures.
- 1:04:53You have to emulate it other places, which is a lot slower, five times slower or something.
- 1:04:58Yeah.
- 1:04:58So kind of split that up, get the definition and then create maybe multiple
- 1:05:02CI, jobs.
- 1:05:04Your CI scripts are really simple.
- 1:05:05Yeah.
- 1:05:05Yeah.
- 1:05:06Yeah.
- 1:05:07Very cool.
- 1:05:07The example script is just a few lines.
- 1:05:09It doesn't, it does not take much to do this comparing.
- 1:05:12Oh yeah.
- 1:05:12Hundreds of lines it used to take.
- 1:05:14Yeah, sure.
- 1:05:15And I didn't even scroll down here.
- 1:05:16You've got a nice grid on github.com/IPA slash cibuildwheel that shows on GitHub actions,
- 1:05:22which is supported on Azure pipelines.
- 1:05:24What's supported.
- 1:05:25It's not right.
- 1:05:26Circle CI doesn't do this.
- 1:05:27No, but yeah.
- 1:05:29App there, Travis, Azure and GitHub do.
- 1:05:34Where does the macOS, but we can't test it.
- 1:05:36Theoretically, it does it.
- 1:05:38Gotcha.
- 1:05:39And then, yeah, I wonder about the M1, the Apple Silicon arm versions versus the Intel versions.
- 1:05:46I don't know how, how well that's permeated into the world yet.
- 1:05:49but the fact that they have Mac at all is kind of impressive.
- 1:05:52Nobody has an M1 runner yet.
- 1:05:53there are a few places I think now that you can purchase time on one, but no runners.
- 1:05:59I mean, last I checked GitHub actions, you couldn't even write yourself on the M1.
- 1:06:03that may be, that may have changed.
- 1:06:05I don't know.
- 1:06:06That was a while back.
- 1:06:07Yeah.
- 1:06:07I mean, there are some crazy, places out there.
- 1:06:10I think there's one called Mac mini Colo.
- 1:06:13I think that's what it's called.
- 1:06:14Let me see if that's, yeah, I think that's it.
- 1:06:17Yeah.
- 1:06:17So you can get, you can go to these places like Mac mini Colo and get, get a whole bunch
- 1:06:24of Mac minis and put them into this crazy data center.
- 1:06:28But you know, that's not the same as I upload a text file into GitHub that says run on Azure
- 1:06:35on GitHub actions.
- 1:06:36And then that's the end of it.
- 1:06:37Right.
- 1:06:37You probably got to set up your whole, like some whole build system into a set of minis.
- 1:06:42And like, that doesn't sound very practical for most people.
- 1:06:45Ideally with what you could do is, I mean, you just need one mini and then you set up
- 1:06:49a GitHub actions, hosted runner, a locally hosted runner.
- 1:06:53and other systems in that too, get, get, get lab CI was big on that.
- 1:06:57you can, you can do anything on get lab CI.
- 1:06:59We just haven't tested that because they don't have those publicly.
- 1:07:01But, if you, if you have your own, you can do that.
- 1:07:04I know, I know somebody who does this with basically with root and runs the, has a Mac mini
- 1:07:09and runs the M1 builds on that.
- 1:07:11But, you could do that.
- 1:07:13And I have a Mac mini and the lead developer of CI build.
- 1:07:15Will also has a, Mac mini or the M1.
- 1:07:18He has an M1 of something.
- 1:07:20I don't know.
- 1:07:20I have a Mac mini.
- 1:07:21Mine is Mac.
- 1:07:22That's what I'm, talking to you right now on.
- 1:07:24It's a fantastic little machine.
- 1:07:25Yeah.
- 1:07:25It's, it's very impressive.
- 1:07:27I love the way the boost histogram.
- 1:07:28It was fast.
- 1:07:29I have a 16 inch, almost maxed out, MacBook and the Mac mini M1.
- 1:07:34It was faster on boost histogram than this thing.
- 1:07:36Wow.
- 1:07:36Yeah.
- 1:07:37I have a maxed out six, 15 inches, a little bit older, a couple of years, but I just don't
- 1:07:42touch that thing unless I literally need it as a laptop because I want to be somewhere else.
- 1:07:45But yeah, I'm definitely not drawn to it.
- 1:07:47These, so you could probably set up one of these minis for 700 bucks and then tie it up.
- 1:07:52But that's again, not as easy as, you know, just clicking the public free option that works,
- 1:07:56but still it's, it's within the realm of possibility.
- 1:07:59Yeah.
- 1:08:00And Apple has actually helped out several, like, I know, homebrew and a few others they've
- 1:08:04helped out with, by giving them either Mac minis or some, some, something that they
- 1:08:10could build with.
- 1:08:10So they, I believe, brew actually builds, homebrew actually builds on him on real
- 1:08:17M1s.
- 1:08:17I know it does because they're, the builds are super fast.
- 1:08:20I remember that.
- 1:08:20Like it builds root like 20 minutes, the root recipe, because I maintain that.
- 1:08:24And the normal one takes about an hour because running on multiple cores, but, it's like
- 1:08:29three times faster.
- 1:08:30It's done in 20 minutes.
- 1:08:31I just thought something was wrong when I first saw that.
- 1:08:33That's it.
- 1:08:34How could it be done?
- 1:08:35Something broke.
- 1:08:36What broke?
- 1:08:36Interesting.
- 1:08:37All right, Henry, we're getting really short on time, a little bit over, but it's been a
- 1:08:40fun conversation.
- 1:08:41How about you give us a look at the future?
- 1:08:42Where are things going?
- 1:08:43with all the stuff.
- 1:08:45Next thing I'm interested in, in, being involved with is scikit build, which,
- 1:08:50is a, a package that currently sort of augments setup tools, but hopefully will eventually
- 1:08:57sort of replace setup tools as your, as the thing that you, build with.
- 1:09:01And it will call out to CMake.
- 1:09:02So you basically just, you basically write a CMake, file.
- 1:09:06And this could wrap an existing package, or maybe you need some of the other things that
- 1:09:11CMake has.
- 1:09:11And this will then let you build that as a regular Python package.
- 1:09:16In fact, recently somebody, sort of put together, see, I build a wheel.
- 1:09:19Yeah.
- 1:09:20It's like it built in the CMake example and, and built, LLVM and pulled out just the
- 1:09:25claim format tool and made wheels out of that.
- 1:09:28And now you can just do pip install clang format.
- 1:09:30It's one to two megabytes.
- 1:09:32It works on all systems, including Apple Silicon and things.
- 1:09:34I just tried it on Apple Silicon yesterday and it's a pip install.
- 1:09:37Now you can claim format C++ code.
- 1:09:39And that's just, you know, mind blowing.
- 1:09:41You can add it to pre-commit.
- 1:09:42The pre-commit CI, it runs in two.
- 1:09:44I mean, I'd been fighting for about a week to reduce the, the, size of the claim format
- 1:09:48recipe from 600 megabytes to just under the 250.
- 1:09:52That was the maximum for pre-commit.CI.
- 1:09:54And then you can now pip install under about a megabyte for Linux, that, that sort of thing.
- 1:09:59And I think that would be really, that would be a really great thing to, to work on.
- 1:10:04It's been around since 2014, but it needs some, some serious work.
- 1:10:08And so I'm currently actually working on writing a grant to, to try to get funded, to just work
- 1:10:13on, basically the scikit build, scikit build system and looking for interesting science
- 1:10:17use cases that would be interested in, adapting, or switching, existing build
- 1:10:23system over or adapting to it.
- 1:10:24or taking something that has never been available from Python and making it available.
- 1:10:30And yes, root, root might be one.
- 1:10:32Scikit build package.
- 1:10:33I'm looking for wide variety.
- 1:10:35Yeah.
- 1:10:35How neat.
- 1:10:36Scikit build package is fundamentally just the glue between set of tools, Python module and
- 1:10:40CMake.
- 1:10:40Yeah.
- 1:10:41So it's a real way to take some of these things that were based on CMake and sort of expose
- 1:10:45them to Python.
- 1:10:46Yeah.
- 1:10:46So you can just, have a CMake package that does all the CMake things well, you know,
- 1:10:51like finding, finding different libraries and, and that I'm a big CMake person.
- 1:10:55But how many of you physically uses it very heavily.
- 1:10:57Most C++ does.
- 1:10:58It's about 60%.
- 1:10:59I think of all field systems are, are CMake based now.
- 1:11:03going from GitWare's numbers, but they make CMake.
- 1:11:06But, it's, I think it's a, it's very powerful.
- 1:11:10It can be used for things like that.
- 1:11:11And, will really open up a much easier C++, more natural in C++ and C and, and
- 1:11:18Fortran and things like that.
- 1:11:19And CUDA then is currently available.
- 1:11:20Setup tools is, disto tools is going away in Python 3.12.
- 1:11:23Setup tools is not really designed to build C++ packages or packages.
- 1:11:29It was really just a hack on top of disto tools, which happened to be build just Python itself.
- 1:11:34So, well, scikit build sounds like the perfect tool to apply to the science space because
- 1:11:40there's so many of these weird compiled things that are challenging to, you know, install and
- 1:11:45deploy and share and so on.
- 1:11:47So making that easier.
- 1:11:48Sounds good.
- 1:11:48All right.
- 1:11:49Well, I think we're probably going to need, need to leave it there just for the sake of time,
- 1:11:53but it's been, it's been awesome to talk about all the internals of supporting scikit
- 1:11:59hep and people should check out cibuildwheel.
- 1:12:02It looks like it, you know, if you're maintaining a package either publicly or just for internal
- 1:12:06for your organization, it looks like it'd be a big help.
- 1:12:08Yeah.
- 1:12:09If it's got binary, any sort of binary build in it.
- 1:12:11Yes.
- 1:12:11Yeah, absolutely.
- 1:12:12If not build is fine.
- 1:12:13Yeah.
- 1:12:14Right.
- 1:12:14And I learned about build, which is good to know.
- 1:12:16All right.
- 1:12:17So before you get out of your Henry, let me ask you the two final questions.
- 1:12:20you're going to write some code, I mean, like Python code, what editor would you use?
- 1:12:25Depends on how much it'll either be VI.
- 1:12:27If it's a very small amount.
- 1:12:29if it's a really large project that let's say it takes several days, then I'll use,
- 1:12:34PyCharm.
- 1:12:35And then I've really started using VS Code quite a bit.
- 1:12:38And that's sort of expanding to fill in all the middle ground and kind of eating in on both
- 1:12:42of the other, both of the edges.
- 1:12:43Yeah.
- 1:12:44Yeah.
- 1:12:45There's some interesting stuff going there.
- 1:12:46Good choice.
- 1:12:46But all with the VI, mode or plugins added, of course.
- 1:12:51And then, notable PyPI package.
- 1:12:53I mean, we probably talked about 20 already.
- 1:12:55If you want to just give a shout out to one of those, that's fine.
- 1:12:57Or if you got a new idea.
- 1:12:58I'm going to go with one that's, unlike, I might not get mentioned, but I, I, I'm really
- 1:13:03excited by it.
- 1:13:04The development of it is, the, I think the developer is quite new, but what he's actually
- 1:13:09done as far as the actual package has been, been nice.
- 1:13:12It needs, it needs some, some nice touches.
- 1:13:14But, and that is plot text, yellow T T E X T.
- 1:13:19And I'm really excited about that because it makes these, the actual plots it makes are
- 1:13:23really, really nice.
- 1:13:24And they're plotted to the terminal and, it can integrate with rich.
- 1:13:28and of course, I'm, I'm interested in it because I want to integrate it with tech.
- 1:13:32I want to see it integrated with a textual, I think a textual app that combines this with,
- 1:13:38uh, file browsers and things like that.
- 1:13:41It'd be incredible.
- 1:13:42Yeah.
- 1:13:42So you can do things like the terminal, for example.
- 1:13:45Yeah.
- 1:13:45So you could like cruise around your files, use your, your root IO integration, pull
- 1:13:51these things up here and, you know, put the plot right on the screen.
- 1:13:53Right.
- 1:13:53But in the terminal.
- 1:13:54Okay.
- 1:13:55Yeah.
- 1:13:55This is really cool.
- 1:13:56I had no idea.
- 1:13:56And this is based on rich.
- 1:13:57You say.
- 1:13:58it can integrate with rich.
- 1:13:59It integrates with rich.
- 1:14:00Okay.
- 1:14:00Got it.
- 1:14:01Yeah.
- 1:14:01So as soon as I saw it, I started trying to make sure the two people were talking to each
- 1:14:04other.
- 1:14:05Will and the person who is developing this.
- 1:14:08Yeah, exactly.
- 1:14:08All right.
- 1:14:09These things work together.
- 1:14:10That's very cool.
- 1:14:11They seem like they should, right?
- 1:14:12They're in the same general zone.
- 1:14:14Yeah.
- 1:14:14And they do now.
- 1:14:15The, you had, there had to be some communication back and forth as far as what size the plots
- 1:14:19were.
- 1:14:19Right.
- 1:14:20This should, this should work in it.
- 1:14:21A good recommendation.
- 1:14:22definitely one I had not learned about.
- 1:14:24So I'm sure people will enjoy that.
- 1:14:25All right, Henry, final call to action.
- 1:14:27People want to do more with wheels, cibuildwheel, or maybe some of the other stuff we talked
- 1:14:31about.
- 1:14:31What do you tell them?
- 1:14:32look through, I think one of the best places to go is the psychic developer pages.
- 1:14:36If you have no interest in psychic tools or hep at all.
- 1:14:40and that sort of shows you how all these things integrate together really well.
- 1:14:43And, has nice, has nice documentation.
- 1:14:46Of course, cibuildwheel itself is nice.
- 1:14:48And the pipe PA, a lot of the IP projects have gotten, good documentation as well as packaging
- 1:14:54of python.org.
- 1:14:55We've updated that quite a bit.
- 1:14:56Look like to reflect some of these things, but I would really, I really like the psychic
- 1:15:01developer pages.
- 1:15:03I mean, I'm biased because I wrote most of them.
- 1:15:04Nice.
- 1:15:06Yeah.
- 1:15:06I'll link to those.
- 1:15:07And I'll, I'll try to link to pretty much everything else that we spoke to as well.
- 1:15:11So people can check out the podcast player show notes to find all that stuff.
- 1:15:14I guess one final thing that we didn't call out that I think is worth pointing out is CI build
- 1:15:18wheel is under the pipe, the Python packaging authority.
- 1:15:21So it gives it some officialness, I guess you should say.
- 1:15:24Yes.
- 1:15:24That happened after, after I joined one of the first things I wanted to do was I thought this
- 1:15:28should really be in the pipe PA.
- 1:15:30And, I was sort of pushing for that and the other developers were fine with that.
- 1:15:34And so we brought it up and, I actually joined the pipe PA just before that by becoming
- 1:15:39a member of build.
- 1:15:40so I got to vote on cibuildwheel coming in, but it was a very enthusiastic vote, even
- 1:15:44without my vote.
- 1:15:45and pipX joined right at the same time too.
- 1:15:48So those were, it was fighting time.
- 1:15:50PipX is a great library.
- 1:15:51I really like the way pipX works.
- 1:15:53It's a great tool.
- 1:15:54All right, Henry, thank you for being here.
- 1:15:56It's been great.
- 1:15:57Thanks for all the insight on all these internals around building and installing Python packages.
- 1:16:01There's also a lot more in my blog.
- 1:16:03So I sign them, pie.
- 1:16:04Dot.
- 1:16:04Get lab.
- 1:16:05Dot.
- 1:16:05I.
- 1:16:05Oh, so that's also a link to look that links to all those other things, obviously do.
- 1:16:09Thanks again for being here.
- 1:16:10Yeah.
- 1:16:11See ya.
- 1:16:11Thanks for having me.
- 1:16:11Yeah.
- 1:16:12You bet.
- 1:16:12This has been another episode of talk Python to me.
- 1:16:16Our guest on this episode was Henry Schreiner and it's brought to you by us over at talk
- 1:16:20Python training and the transcripts were brought to you by assembly AI.
- 1:16:24Do you need a great automatic speech to text API?
- 1:16:27Get human level accuracy in just a few lines of code.
- 1:16:30Visit talkpython.fm/assembly AI.
- 1:16:32Want to level up your Python?
- 1:16:34We have one of the largest catalogs of Python video courses over at talk Python.
- 1:16:38Our content ranges from true beginners to deeply advanced topics like memory and async.
- 1:16:43And best of all, there's not a subscription in sight.
- 1:16:46Check it out for yourself at training.talkpython.fm.
- 1:16:49Be sure to subscribe to the show.
- 1:16:51Open your favorite podcast app and search for Python.
- 1:16:54We should be right at the top.
- 1:16:55You can also find the iTunes feed at /itunes, the Google Play feed at /play, and the
- 1:17:01direct RSS feed at /rss on talkpython.fm.
- 1:17:05We're live streaming most of our recordings these days.
- 1:17:08If you want to be part of the show and have your comments featured on the air, be sure to
- 1:17:12subscribe to our YouTube channel at talkpython.fm/youtube.
- 1:17:16This is your host, Michael Kennedy.
- 1:17:17Thanks so much for listening.
- 1:17:19I really appreciate it.
- 1:17:20Now get out there and write some Python code.
- 1:17:22I'll see you next time.