WEBVTT

00:00:00.001 --> 00:00:03.800
We're all familiar with the data science tools like NumPy, Pandas, and others.

00:00:03.800 --> 00:00:09.800
These are numerical tools that work with floating point numbers, often to represent real-world systems.

00:00:09.800 --> 00:00:14.400
But what if you could exactly specify the equations, symbolically,

00:00:14.400 --> 00:00:17.980
like many of us did back in calculus or differential equations courses?

00:00:17.980 --> 00:00:20.960
With SymPy, you can do exactly that.

00:00:20.960 --> 00:00:24.280
Create equations, integrate, differentiate, and solve them.

00:00:24.280 --> 00:00:28.880
Then you can convert those solutions into Python or even C++ and Fortran code.

00:00:29.240 --> 00:00:34.380
We're here with two of the core maintainers, Andrei Sertik and Aaron Moyer, to learn about SymPy.

00:00:34.380 --> 00:00:40.180
This is Talk Python To Me, episode 364, recorded May 6th, 2022.

00:00:40.180 --> 00:00:56.460
Welcome to Talk Python To Me, a weekly podcast on Python.

00:00:56.460 --> 00:00:58.180
This is your host, Michael Kennedy.

00:00:58.480 --> 00:01:00.480
Follow me on Twitter, where I'm @mkennedy.

00:01:00.480 --> 00:01:04.380
And keep up with the show and listen to past episodes at talkpython.fm.

00:01:04.380 --> 00:01:07.400
And follow the show on Twitter via at Talk Python.

00:01:07.400 --> 00:01:11.020
We've started streaming most of our episodes live on YouTube.

00:01:11.020 --> 00:01:18.620
Subscribe to our YouTube channel over at talkpython.fm/youtube to get notified about upcoming shows and be part of that episode.

00:01:18.620 --> 00:01:26.280
This episode is sponsored by Microsoft for startups.

00:01:26.280 --> 00:01:29.160
Founders Hub to get early support for your startup.

00:01:29.160 --> 00:01:31.420
And it's brought to you by Sentry.

00:01:31.420 --> 00:01:33.680
Don't let those errors go unnoticed.

00:01:33.680 --> 00:01:34.700
Use Sentry.

00:01:34.700 --> 00:01:37.540
Get started at talkpython.fm/sentry.

00:01:37.540 --> 00:01:42.600
Transcripts for this and all of our episodes are brought to you by Assembly AI.

00:01:42.600 --> 00:01:45.280
Do you need a great automatic speech-to-text API?

00:01:45.280 --> 00:01:47.820
Get human-level accuracy in just a few lines of code.

00:01:47.820 --> 00:01:50.680
Visit talkpython.fm/assemblyai.

00:01:52.420 --> 00:01:54.720
Andre and Aaron, welcome to Talk Python To Me.

00:01:54.720 --> 00:01:56.060
Thanks for having us.

00:01:56.060 --> 00:01:56.660
Yeah.

00:01:56.660 --> 00:01:58.260
It's great.

00:01:58.260 --> 00:02:00.160
Yeah, it's fantastic to have you both here.

00:02:00.160 --> 00:02:01.540
You know, what a cool topic.

00:02:01.540 --> 00:02:03.820
Symbolic math with Python.

00:02:03.820 --> 00:02:11.760
I think I'd heard of SymPy before, but I didn't fully appreciate, you know, how neat and how advanced it really was.

00:02:11.760 --> 00:02:17.760
So people are going to enjoy diving into this and we can talk some internals and whatnot.

00:02:18.040 --> 00:02:23.660
And if you're doing anything scientific or computational, this is certainly a project worth checking out.

00:02:23.660 --> 00:02:27.080
But before we get to that, let's just hear your story.

00:02:27.080 --> 00:02:28.700
How did you get into programming in Python?

00:02:28.700 --> 00:02:29.820
Aaron, you want to go first?

00:02:29.820 --> 00:02:34.480
I've always kind of been into computers ever since I was a little kid.

00:02:34.480 --> 00:02:46.380
I actually started messing around with programming and AppleScript in my family's Macintosh back when I was, like, a really little kid.

00:02:46.380 --> 00:02:47.060
Nice.

00:02:47.060 --> 00:02:54.820
But didn't really do any serious programming until college when I started taking, like, computer science courses.

00:02:54.820 --> 00:03:04.100
And actually, for Python, my college had a free course that they were offering to teach this little language called Python.

00:03:04.100 --> 00:03:10.180
So, you know, the CS course that I was taking was in, like, Java and C.

00:03:10.180 --> 00:03:14.300
And those languages are – I wasn't a huge fan of those languages.

00:03:14.540 --> 00:03:18.220
But I learned about this language called Python, and, yeah, I thought it was great.

00:03:18.220 --> 00:03:25.500
Yeah, I was immediately hooked with Python just because it's, you know, it's so easy to use.

00:03:25.500 --> 00:03:32.880
It's so easy to just write a program, and you don't have to worry about compilers or all this boilerplate.

00:03:34.760 --> 00:03:42.560
Yeah, I'd always been a little suspicious of languages that described themselves that way, which is ironic given how much I do with Python.

00:03:42.560 --> 00:03:47.560
But still often when you hear that, it's like, oh, it doesn't need all the symbols, and it's super easy to get started.

00:03:47.560 --> 00:03:52.820
That means, like, oh, it's really easy to do easy stuff, but then you can't do interesting things.

00:03:52.820 --> 00:03:56.120
And I think one of the things that's special about Python is, like, you can keep going.

00:03:56.120 --> 00:03:58.960
You know, you don't have to stop once you need advanced ideas.

00:03:58.960 --> 00:04:00.080
That's pretty awesome.

00:04:00.080 --> 00:04:01.360
Yeah, it really is.

00:04:01.360 --> 00:04:02.580
You're right.

00:04:02.580 --> 00:04:04.700
A lot of languages kind of stop.

00:04:04.700 --> 00:04:15.780
But Python, I mean, it's got a lot of advanced stuff as well, and it's got a huge ecosystem of libraries you can do just pretty much anything you want in it.

00:04:15.780 --> 00:04:17.740
Yeah, for sure.

00:04:17.740 --> 00:04:23.620
The big paradox for me is there's a joke T-shirt that I've seen that says, I learned Python.

00:04:23.620 --> 00:04:25.920
It was a great weekend, which I think is kind of true.

00:04:25.920 --> 00:04:26.640
You can do that.

00:04:26.640 --> 00:04:31.760
But at the same time, for many, many years now, I've been studying Python, and there's still just so much more to learn.

00:04:32.460 --> 00:04:40.000
One, about the language, and also just, like, as you said, all the different libraries, like, oh, I want to learn Pydantic now, or this other thing, or so on.

00:04:40.000 --> 00:04:41.160
Very cool.

00:04:41.160 --> 00:04:42.080
All right, how about now?

00:04:42.080 --> 00:04:43.500
What are you working on day-to-day?

00:04:43.500 --> 00:04:47.640
Yeah, so I work at a company called Quansight.

00:04:48.520 --> 00:04:55.600
We do consulting, mostly around open source Python, open source data science stack.

00:04:56.720 --> 00:05:04.540
I work about 50% of my time on SimPy as part of a grant, which we might talk about later, I think.

00:05:04.540 --> 00:05:09.460
And I also work on different consulting projects.

00:05:10.460 --> 00:05:29.720
Actually, right now, I'm part of a project called the Data APIs Consortium, which is trying to standardize the array API libraries for different Python array libraries, the APIs for those.

00:05:30.200 --> 00:05:32.940
So, you know, like, NumPy and X-Array and those types of things?

00:05:32.940 --> 00:05:36.700
NumPy, PyTorch, Jax, QPy.

00:05:36.700 --> 00:05:47.180
So, the idea is that all these libraries have very slightly different APIs, and it makes it hard to write code against that just works against all of them.

00:05:47.320 --> 00:05:52.760
So, what we're doing is creating a standard API that all of these libraries will target.

00:05:52.760 --> 00:06:04.660
And so, you can write code that will just work with NumPy, but you can also just, instead of importing NumPy, you can import QPy, and that same code will run on the GPU, for example.

00:06:04.660 --> 00:06:05.740
Oh, that's fantastic.

00:06:05.740 --> 00:06:08.800
Yeah, that's a really good, ambitious goal.

00:06:08.800 --> 00:06:12.800
It sounds so easy, and I'm sure it's pretty challenging.

00:06:12.800 --> 00:06:15.340
Yeah, well, I think we're being successful.

00:06:15.340 --> 00:06:25.660
We just released the first version of the specification, and we've got several libraries that are implementing it already, including NumPy, QPy, several others.

00:06:25.660 --> 00:06:35.640
So, it's actually, I think it's being a successful project and should really help push the Python data science ecosystem forward.

00:06:35.640 --> 00:06:37.440
Yeah, it sounds like a definitely good step.

00:06:37.440 --> 00:06:38.720
Andrei, how about you?

00:06:38.720 --> 00:06:40.260
How did you get into programming in Python?

00:06:40.260 --> 00:06:44.440
You know, probably in high school, I was trying to figure it out when I got into it.

00:06:44.440 --> 00:06:45.160
I think at high school.

00:06:45.160 --> 00:06:45.620
I don't know.

00:06:45.620 --> 00:06:51.200
I don't remember how I found it, but it was early 2000s, I'm guessing.

00:06:51.200 --> 00:06:53.160
It was before NumPy.

00:06:53.160 --> 00:06:55.420
It was, I think, it was NumArray, I think.

00:06:55.420 --> 00:06:57.780
It was the array library in Python.

00:06:57.780 --> 00:07:01.320
And during my undergrad, I was studying physics.

00:07:01.320 --> 00:07:05.900
I wanted to play with the mathematical formulas in Python.

00:07:06.140 --> 00:07:07.560
So, that's when I started SymPy.

00:07:07.560 --> 00:07:12.940
And then I used Python, you know, pretty much, probably close to 20 years now, or over 20 years.

00:07:12.940 --> 00:07:15.980
And I cannot say I'm an expert.

00:07:15.980 --> 00:07:18.600
You know, it wasn't a good weekend.

00:07:20.280 --> 00:07:20.920
I don't know.

00:07:20.920 --> 00:07:26.240
A lot of the stuff I'm not that great at, you know, but the basics, I would say I know pretty well.

00:07:26.240 --> 00:07:27.020
Yeah, sure.

00:07:27.500 --> 00:07:32.800
After my PhD in physics, I went to work at Los Alamos National Lab for about eight years.

00:07:32.800 --> 00:07:34.280
Computational physicist.

00:07:34.280 --> 00:07:36.000
I use Python.

00:07:36.000 --> 00:07:39.020
I use a lot of Fortran, a lot of computational codes, and a lot of C++.

00:07:39.020 --> 00:07:40.120
That sounds fun.

00:07:40.180 --> 00:07:42.820
There's a lot of Python stuff happening there at Los Alamos.

00:07:42.820 --> 00:07:43.780
Yeah, it is.

00:07:43.780 --> 00:07:48.040
The NetworkX, I think, library was started here.

00:07:48.040 --> 00:07:53.900
And then, very recently, half a year ago, I changed jobs.

00:07:53.900 --> 00:08:00.960
I now work at a company called GSI Technology, which is a hardware vendor, as a compiler developer.

00:08:00.960 --> 00:08:06.420
And so, at Los Alamos, I started this compiler for Fortran called L-Fortran.

00:08:07.220 --> 00:08:11.920
It's a compiler for Fortran, but it also allows you to use it interactively, just like you would Python.

00:08:11.920 --> 00:08:14.860
It runs in a Jupyter Notebook, as well, as a kernel.

00:08:14.860 --> 00:08:22.740
And at this new company, we are also, in addition to L-Fortran, creating a new frontend called L-Python,

00:08:22.740 --> 00:08:28.960
which takes Python, but compiles it through the same pipelines, through the same intermediate representation

00:08:28.960 --> 00:08:29.840
and all the backends.

00:08:29.840 --> 00:08:31.020
All the code is the same.

00:08:31.020 --> 00:08:33.280
So, effectively, it treats Python like Fortran.

00:08:33.280 --> 00:08:36.680
So, the same speed, and so forth.

00:08:37.040 --> 00:08:37.380
Oh, wow.

00:08:37.380 --> 00:08:38.380
That sounds awesome.

00:08:38.380 --> 00:08:39.140
It is awesome.

00:08:39.140 --> 00:08:39.380
Yes.

00:08:39.380 --> 00:08:41.180
Very, very cool.

00:08:41.180 --> 00:08:42.340
All right.

00:08:42.340 --> 00:08:48.400
Well, super fun to be talking about SymPy with you all today, symbolic math.

00:08:48.400 --> 00:08:56.460
I want to start this off, though, with a write-up from Aaron that is maybe not what people would expect

00:08:56.460 --> 00:08:58.400
as the first topic to introduce SymPy.

00:08:58.400 --> 00:09:02.500
SymPy has been in the news a little bit for the wrong reasons recently, right?

00:09:02.500 --> 00:09:03.720
Right, Aaron?

00:09:04.720 --> 00:09:12.520
So, it was even on the front page of Hacker News because this company, HackerRank, reached

00:09:12.520 --> 00:09:20.900
out to GitHub, sounds like through automated ways, and said, we seem to see some math that

00:09:20.900 --> 00:09:23.560
looks like questions we might ask or something like that.

00:09:23.560 --> 00:09:29.460
So, we need to completely ban SymPy because they're stealing our interview questions or something

00:09:29.460 --> 00:09:30.220
like that, right?

00:09:30.220 --> 00:09:31.520
Give us the story.

00:09:31.520 --> 00:09:32.900
What kind of madness was this?

00:09:33.700 --> 00:09:33.940
Yeah.

00:09:33.940 --> 00:09:40.380
So, we sort of just got this notice from GitHub that a DMCA takedown had been issued against

00:09:40.380 --> 00:09:43.260
one of the pages on our documentation.

00:09:44.100 --> 00:09:51.820
And the way the DMCA works and the way GitHub's DMCA policy works is when somebody issues a notice,

00:09:51.820 --> 00:09:54.640
they basically just have to take it down.

00:09:55.920 --> 00:10:03.020
And GitHub basically took down the entire documentation site for about 12 hours.

00:10:03.020 --> 00:10:09.440
And so, I've got a timeline of everything that happened here in this blog post.

00:10:10.560 --> 00:10:20.180
But basically, yeah, they had some company that they were working with to try to find their

00:10:20.180 --> 00:10:25.060
solutions on GitHub and issued DMCA takedown notices against them.

00:10:25.060 --> 00:10:32.900
And somehow, this SWIRTH IT solutions company decided that our docs was one of these, and they

00:10:32.900 --> 00:10:33.940
just issued the notice.

00:10:33.940 --> 00:10:42.320
And so, yeah, it ended up taking down our documentation, which immediately, like you said, it made it

00:10:42.320 --> 00:10:46.320
to the top of Hacker News and kind of tension.

00:10:46.320 --> 00:10:46.880
Because it's too outrageous.

00:10:46.880 --> 00:10:47.840
Yeah.

00:10:47.840 --> 00:10:53.560
So, the notice itself, it was completely ridiculous.

00:10:53.560 --> 00:11:02.680
Like, the stuff that they were claiming was their copyright is probably not even copyrightable.

00:11:02.680 --> 00:11:08.480
Like, if you look at the examples on that documentation page that they took down, they're just like

00:11:08.480 --> 00:11:09.480
simple math examples.

00:11:09.480 --> 00:11:09.840
Yeah.

00:11:09.840 --> 00:11:16.160
It was like X squared minus two solution is, you know, negative plus or minus radical two.

00:11:16.160 --> 00:11:16.720
Right?

00:11:16.720 --> 00:11:19.120
Like, that you shouldn't be able to copyright.

00:11:19.120 --> 00:11:23.000
I think that actually predates HackerRank's foundation.

00:11:23.000 --> 00:11:26.440
I think it predates HackerRank as a company.

00:11:26.440 --> 00:11:27.660
Yeah.

00:11:27.660 --> 00:11:27.740
Yeah.

00:11:27.740 --> 00:11:36.320
So, the CEO of HackerRank, I guess, noticed the buzz that was being made about it and retracted

00:11:36.320 --> 00:11:36.820
the notice.

00:11:36.820 --> 00:11:41.380
So, the docs ended up going back online about 12 hours later.

00:11:41.380 --> 00:11:47.300
If they hadn't done that, we would have had to issue a counter notice, which would have kept

00:11:47.300 --> 00:11:52.920
the docs offline for about two weeks before that counter notice would have taken effect.

00:11:53.420 --> 00:11:55.960
And that's just because of the way the DMCA law works.

00:11:55.960 --> 00:12:00.540
I also explained how the DMCA law works in this blog post.

00:12:00.540 --> 00:12:04.180
If anyone's wondering, like, why would GitHub even do this?

00:12:04.180 --> 00:12:07.760
Like, well, they're kind of required to do this kind of stuff by law.

00:12:07.760 --> 00:12:12.260
There are some ways I think they could have improved what they did here, which I go over

00:12:12.260 --> 00:12:12.660
as well.

00:12:12.660 --> 00:12:14.840
But this DMCA law is really...

00:12:14.840 --> 00:12:15.700
It's probably like pointing those out.

00:12:15.760 --> 00:12:15.860
Yeah.

00:12:15.860 --> 00:12:22.060
So, I mean, the DMCA provides what's called safe harbor for places that host user-generated

00:12:22.060 --> 00:12:22.980
content, basically.

00:12:22.980 --> 00:12:25.840
YouTube, the social media places.

00:12:25.840 --> 00:12:29.500
GitHub clearly has a ton of user-generated content that's public.

00:12:29.500 --> 00:12:35.740
If you got the source code of Windows or something and you posted it up there, right?

00:12:35.740 --> 00:12:38.640
Theoretically, Microsoft might say, you know, we don't really want you hosting this.

00:12:38.640 --> 00:12:40.020
It's not supposed to be open source.

00:12:40.020 --> 00:12:41.080
Please take it down, right?

00:12:41.680 --> 00:12:43.260
So that's the idea.

00:12:43.260 --> 00:12:49.520
The way it works, though, is basically once there's a request to take it down, they just

00:12:49.520 --> 00:12:50.520
have to...

00:12:50.520 --> 00:12:52.200
Here's the part that I think that got missed.

00:12:52.200 --> 00:12:55.460
Decide that it's a valid request and then just take it down.

00:12:55.460 --> 00:13:00.460
Like, they don't really try to negotiate or determine the right...

00:13:00.460 --> 00:13:03.260
The correctness of that assertion, right?

00:13:03.260 --> 00:13:03.960
Yeah.

00:13:03.960 --> 00:13:11.340
So they sort of have to stay, like, as a disinterested third party, I guess.

00:13:11.340 --> 00:13:17.680
And the reason is that in order for them to have the safe harbor, the safe harbor status

00:13:17.680 --> 00:13:24.020
sort of frees them from the liability on either side if there is a copyright claim or if there's

00:13:24.020 --> 00:13:25.080
a lawsuit or something.

00:13:25.080 --> 00:13:28.600
They can just say, okay, well, we're just hosting the content.

00:13:29.140 --> 00:13:31.560
The law sort of allows them to do that.

00:13:31.560 --> 00:13:34.300
But in order to do that, they sort of have to just...

00:13:34.300 --> 00:13:36.760
If they get a DMCA claim, they have to just take it down.

00:13:36.760 --> 00:13:40.440
And then if there's a counter notice issued, then they can put it back up.

00:13:40.440 --> 00:13:42.140
And the DMCA has these...

00:13:42.140 --> 00:13:49.340
The DMCA sort of tells them that if they get a claim, they have to sort of take it down expeditiously.

00:13:49.340 --> 00:13:53.760
And if there's a counter notice, they have to put it back up in 10 to 14 days.

00:13:54.140 --> 00:13:55.380
So it's...

00:13:55.380 --> 00:13:59.440
There's a lot of parts of the law that they sort of have to do.

00:13:59.440 --> 00:14:02.540
There's some things I think that they could have done better.

00:14:02.540 --> 00:14:06.660
And there's also some things that they already do, which they don't have to do, which are nice,

00:14:06.660 --> 00:14:12.460
including they have a repo where they actually post every single DMCA notice that they've received,

00:14:12.460 --> 00:14:15.500
going all the way back to 2011, actually.

00:14:15.500 --> 00:14:16.300
Interesting.

00:14:16.420 --> 00:14:22.800
So you can actually see all the DMCA notices that have been issued against GitHub repositories on that repo.

00:14:22.800 --> 00:14:25.900
It's github.com/github slash DMCA.

00:14:28.380 --> 00:14:32.920
This portion of Talk Python To Me is brought to you by Microsoft for Startups Founders Hub.

00:14:32.920 --> 00:14:35.000
Starting a business is hard.

00:14:35.000 --> 00:14:39.920
By some estimates, over 90% of startups will go out of business in just their first year.

00:14:39.920 --> 00:14:45.640
With that in mind, Microsoft for Startups set out to understand what startups need to be successful

00:14:45.640 --> 00:14:49.400
and to create a digital platform to help them overcome those challenges.

00:14:49.400 --> 00:14:52.100
Microsoft for Startups Founders Hub was born.

00:14:52.100 --> 00:14:58.740
Founders Hub provides all founders at any stage with free resources to solve their startup challenges.

00:14:58.740 --> 00:15:04.400
The platform provides technology benefits, access to expert guidance and skilled resources,

00:15:04.400 --> 00:15:07.380
mentorship and networking connections, and much more.

00:15:07.380 --> 00:15:13.180
Unlike others in the industry, Microsoft for Startups Founders Hub doesn't require startups to be

00:15:13.180 --> 00:15:16.940
investor-backed or third-party validated to participate.

00:15:16.940 --> 00:15:19.640
Founders Hub is truly open to all.

00:15:19.640 --> 00:15:21.120
So what do you get if you join them?

00:15:21.120 --> 00:15:25.960
You speed up your development with free access to GitHub and Microsoft Cloud computing resources

00:15:25.960 --> 00:15:29.420
and the ability to unlock more credits over time.

00:15:29.420 --> 00:15:34.100
To help your startup innovate, Founders Hub is partnering with innovative companies like OpenAI,

00:15:34.100 --> 00:15:39.120
a global leader in AI research and development, to provide exclusive benefits and discounts.

00:15:39.120 --> 00:15:44.540
Through Microsoft for Startups Founders Hub, becoming a founder is no longer about who you know.

00:15:44.540 --> 00:15:49.760
You'll have access to their mentorship network, giving you a pool of hundreds of mentors across a range of

00:15:49.760 --> 00:15:55.800
disciplines and areas like idea validation, fundraising, management and coaching, sales and marketing,

00:15:55.800 --> 00:15:58.100
as well as specific technical stress points.

00:15:58.100 --> 00:16:03.320
You'll be able to book a one-on-one meeting with the mentors, many of whom are former founders themselves.

00:16:03.320 --> 00:16:08.440
Make your idea a reality today with the critical support you'll get from Founders Hub.

00:16:08.600 --> 00:16:13.160
To join the program, just visit talkpython.fm/founders hub, all one word.

00:16:13.160 --> 00:16:14.420
No links in your show notes.

00:16:14.420 --> 00:16:16.700
Thank you to Microsoft for supporting the show.

00:16:19.200 --> 00:16:24.920
I want to preface this by saying I'm not a lawyer, so I'm only speculating here.

00:16:24.920 --> 00:16:28.840
But one of the things that seems very, very much like it fell through the cracks.

00:16:28.840 --> 00:16:36.560
And this part, I think, is both maliciousness and laziness on the worth IT company, as well as,

00:16:36.560 --> 00:16:42.560
you know, sort of either laziness or disinterest, I guess, from GitHub.

00:16:42.660 --> 00:16:43.880
I don't really know how to characterize it.

00:16:43.880 --> 00:16:50.820
But this company came and said, on your documentations, there is content that is copyright.

00:16:50.820 --> 00:16:52.700
And it comes from our website.

00:16:52.700 --> 00:16:56.120
And it just linked just to the homepage of that other website.

00:16:56.120 --> 00:16:57.360
You got to take it down.

00:16:57.360 --> 00:17:04.700
That seems like insufficient information to GitHub to go, yeah, well, they said there's a website.

00:17:04.700 --> 00:17:05.400
And here's a website.

00:17:05.400 --> 00:17:06.760
That website doesn't like this one.

00:17:06.820 --> 00:17:07.560
So it should go away.

00:17:07.560 --> 00:17:11.560
It should say, do you see these lines of code here?

00:17:11.560 --> 00:17:13.600
That was stolen from us.

00:17:13.600 --> 00:17:15.060
And here's where it originates.

00:17:15.060 --> 00:17:16.940
Or, you know, our thing is not public.

00:17:16.940 --> 00:17:17.940
But these are the lines.

00:17:17.940 --> 00:17:19.880
They didn't even say what was wrong, right?

00:17:19.880 --> 00:17:22.740
It just said, we believe this code is going to destroy them.

00:17:22.740 --> 00:17:25.620
It was insufficient even for us if it was an accurate claim.

00:17:25.620 --> 00:17:30.360
Because if you look at this page that they put the claim on, it's a huge page.

00:17:30.360 --> 00:17:34.220
Because it's got, like, about a dozen different functions on it.

00:17:35.380 --> 00:17:38.160
And it just said that they copied our examples.

00:17:38.160 --> 00:17:41.980
It didn't say which part of the page was copied or anything.

00:17:41.980 --> 00:17:49.720
So, yeah, I mean, I still don't know, like, how they even decided that this was a thing.

00:17:49.720 --> 00:17:54.520
That somehow their automation got flagged incorrectly or something.

00:17:54.520 --> 00:17:55.100
I don't know.

00:17:55.100 --> 00:17:57.960
Like, I don't know if we're ever going to know that.

00:17:57.960 --> 00:17:58.800
Yep.

00:17:58.800 --> 00:17:59.340
All right.

00:17:59.340 --> 00:18:00.960
Well, I don't want to spend the whole time on this.

00:18:01.020 --> 00:18:04.200
But let me wrap it up with a quick thought.

00:18:04.200 --> 00:18:13.100
The CEO of HackerRank, Vivek, posted a message that said, this was not our intended consequence.

00:18:13.880 --> 00:18:14.320
Yes.

00:18:14.320 --> 00:18:30.060
But if you send bots running around the internet looking for algebraic equations and saying that those are, you know, like, this is your problem, even if it was not your intent to do these things.

00:18:30.720 --> 00:18:34.060
And so they fixed it.

00:18:34.060 --> 00:18:35.500
I don't know what they're doing now.

00:18:35.500 --> 00:18:38.900
But they said, we're going to stop the whole process for now and figure out what we can do better.

00:18:38.900 --> 00:18:45.740
But on the other hand, we should give them props for donating $25,000 to the Senpai project as a, we're sorry.

00:18:45.740 --> 00:18:47.580
That's actually kind of cool.

00:18:47.580 --> 00:18:48.580
They didn't have to do that.

00:18:49.060 --> 00:18:50.540
No, they did not have to do that.

00:18:50.540 --> 00:18:53.920
And they did send the money, I think, last week.

00:18:53.920 --> 00:18:55.700
And so just...

00:18:55.700 --> 00:18:56.540
You guys are all on vacation?

00:18:56.540 --> 00:18:57.520
What is this, Hawaii?

00:18:57.520 --> 00:18:58.160
I'm just teasing.

00:18:58.160 --> 00:19:03.380
Or if the finances are online, you can find them up.

00:19:03.380 --> 00:19:07.800
I think it's an open collective and it pretty much almost doubles our budget.

00:19:07.800 --> 00:19:11.680
And so it will allow us to really fund all kinds of cool development.

00:19:11.680 --> 00:19:23.300
One thing on this note I wanted to say is that I was thinking, so when it all started, I felt like a little guy completely being crushed by some huge corporation or just this.

00:19:23.300 --> 00:19:29.440
You know, they just take down the documentation and GitHub just says, you know, it's not enough to put a commit to fix it.

00:19:29.440 --> 00:19:32.380
You have to excise the commit from the Git history.

00:19:32.380 --> 00:19:36.320
So we would have to figure out exactly what line was copied.

00:19:36.320 --> 00:19:42.340
And so I went to the Git history and tried to look up, well, maybe some of our contributors maybe copied some stuff from HackerRank.

00:19:42.340 --> 00:19:45.540
So I went to the history, but they didn't see anything.

00:19:45.540 --> 00:19:47.500
They did not see any mention of HackerRank.

00:19:47.500 --> 00:19:49.000
You know, oh, I copied this from HackerRank.

00:19:49.000 --> 00:19:50.300
They didn't see anything like that.

00:19:50.300 --> 00:19:51.760
They didn't see anything suspicious.

00:19:51.760 --> 00:19:54.020
But the consequence was dire.

00:19:54.020 --> 00:19:57.720
And also the documentation is generated from the Simpi source code.

00:19:57.720 --> 00:20:03.420
So really, the offending lines are coming from the Simpi repository itself, not just the documentation.

00:20:03.420 --> 00:20:05.800
So luckily they missed it.

00:20:05.800 --> 00:20:09.820
We were really, I was like, well, this might be, this is terrible.

00:20:09.820 --> 00:20:16.080
And then they, oh, and also we thought maybe, maybe this looks like a spam, you know, maybe it's just a spam.

00:20:16.080 --> 00:20:20.180
So we kind of ignored it a little bit, not ignored it, but, you know, we didn't know.

00:20:20.180 --> 00:20:24.000
And so I emailed GitHub right away, is this real or is this just a spam?

00:20:24.000 --> 00:20:26.940
And they got back to us on Monday evening and said, no, this isn't real.

00:20:27.280 --> 00:20:29.960
And then the next morning they took down the whole documentation.

00:20:29.960 --> 00:20:38.480
So I felt really just, you know, I spent, Aaron and others spent so many hours just trying to figure out what we should do and what the options are.

00:20:38.480 --> 00:20:44.240
And I was, it was, Google Summer of course was, Redline was on that Tuesday, I think as well.

00:20:44.240 --> 00:20:46.060
So I was just super busy with that.

00:20:46.300 --> 00:20:48.940
I just felt, you know, this is, and I'm doing this for free for Simpa.

00:20:48.940 --> 00:20:52.540
I don't think I've ever paid anybody to work on Simpa.

00:20:52.540 --> 00:20:55.220
I just felt, you know, this is, this is not right.

00:20:55.540 --> 00:21:02.040
And then when it got to Hacker News, I thought, you know, I thought about how can the company, what can they do to like fix it?

00:21:02.040 --> 00:21:04.720
And I thought, you know, there's not much they can do, the time was wasted.

00:21:04.720 --> 00:21:10.040
But then Drag Race got an idea, Oliphant got an idea, well, why don't they donate some money?

00:21:10.040 --> 00:21:12.020
And I thought, you know, this would fix it.

00:21:12.020 --> 00:21:15.500
And so I didn't think they would do that, but I'm very happy that they did.

00:21:15.500 --> 00:21:25.220
As far as I'm concerned, personally, I don't, I think we are even, they, they give us the money and we can use it to really progress the development forward.

00:21:25.220 --> 00:21:28.720
So I'm very happy that how it all ended for Simpa.

00:21:28.720 --> 00:21:29.340
Sure.

00:21:29.340 --> 00:21:37.720
You could pay to hire somebody to work on some important part, or you could pay to have sprints, like bring the people together to work together or something like that.

00:21:37.720 --> 00:21:37.860
Right?

00:21:37.860 --> 00:21:38.480
Nice.

00:21:38.480 --> 00:21:38.620
Yeah.

00:21:38.620 --> 00:21:40.820
We're still, we're still talking about what we're going to do.

00:21:40.820 --> 00:21:42.180
Cool.

00:21:42.180 --> 00:21:46.680
Well, I'm glad it came out well, but what a wild story.

00:21:46.680 --> 00:21:50.940
I've had, I've had run-ins like this before, and they are incredibly frustrating.

00:21:51.220 --> 00:21:58.320
Even when you're on the right side of it, it's just like, you know, you're, you're up against lawyers from.

00:21:58.320 --> 00:21:59.220
Yeah.

00:21:59.220 --> 00:22:00.140
You're on, you're on YouTube.

00:22:00.140 --> 00:22:03.040
So I've heard that DMCA is going to be pretty bad on YouTube.

00:22:03.040 --> 00:22:05.460
I don't know if that you've ever been hit by anything like that there.

00:22:05.460 --> 00:22:11.220
I, you know, what's so funny is only once as it happened on YouTube, it's happened for my courses.

00:22:12.100 --> 00:22:16.020
It's not exactly, it's happened sort of almost in reverse for my courses.

00:22:16.020 --> 00:22:24.080
I put one of my free courses on Udemy as a way to try to reach out to people who didn't already know about my content.

00:22:24.080 --> 00:22:25.880
Like, I'll put it up there for free.

00:22:25.880 --> 00:22:31.200
People can experience it there, and then maybe they'll go look for other courses for me, like, you know, something like that.

00:22:31.880 --> 00:22:39.760
Someone stole my free course, started selling it on Udemy, and it took me two weeks to get them to, to even take it down.

00:22:39.760 --> 00:22:43.160
Even though at the beginning, it's a picture of me saying, hi, I'm Michael.

00:22:43.160 --> 00:22:46.380
And I'm like, you gotta, we don't believe this is yours.

00:22:46.380 --> 00:22:47.000
Like, what do you mean?

00:22:47.000 --> 00:22:48.480
Have you watched it?

00:22:49.280 --> 00:22:55.760
The person who is the account it's under is absolutely clearly not Michael.

00:22:55.760 --> 00:23:04.880
Anyway, on YouTube, what has happened to me is I was doing a webcast way back in the day when people would call in, sometimes on phones,

00:23:04.880 --> 00:23:11.220
and somebody interrupted someone else on, during the webcast, and they put it on hold.

00:23:11.220 --> 00:23:16.120
And it was really frustrating because their hold music started playing back into the webcast.

00:23:16.240 --> 00:23:21.360
And for some reason, the way it was set up by the company I was working with to do it, they couldn't stop it.

00:23:21.360 --> 00:23:26.240
So there was just like five minutes of hold music going along with the presentation.

00:23:26.240 --> 00:23:30.940
That hold music got a DMCA takedown, and it took down my webcast.

00:23:30.940 --> 00:23:33.520
So what are you going to do?

00:23:33.520 --> 00:23:35.140
I didn't really mind.

00:23:35.140 --> 00:23:38.640
It was kind of a crappy thing anyway, but, you know, it was up there, and it got taken down.

00:23:38.640 --> 00:23:43.100
All right, let's talk about Senpai because I think this is a really neat project.

00:23:43.400 --> 00:23:49.260
Like I said, when I think about the data science stack and the scientific computing stack of Python,

00:23:49.260 --> 00:23:59.280
traditionally what I've thought of is NumPy, Pandas, Matplotlib, the stuff that does numerical processing,

00:23:59.280 --> 00:24:03.960
and then maybe visualizes that or does machine learning off of it or something like that.

00:24:03.960 --> 00:24:11.100
But Senpai, I think, occupies a slightly different but really important space in this whole computational Python stuff.

00:24:11.480 --> 00:24:11.980
Tell us about it.

00:24:11.980 --> 00:24:18.000
Yeah, so Senpai, like you said, it sort of stands in contrast to these other libraries in that it's not,

00:24:18.000 --> 00:24:22.600
it is a mathematics library, but it's not numerical, it's symbolic.

00:24:22.600 --> 00:24:29.440
So the focus is on computing with mathematical expressions exactly.

00:24:29.440 --> 00:24:37.540
So, you know, if you tell Senpai to, like you said earlier, solve the equation x squared minus 2 equals 0,

00:24:37.540 --> 00:24:41.720
you'll get the exact answer, square root of 2 minus square root of 2.

00:24:41.820 --> 00:24:48.080
You won't get a numerical answer like, you know, 0.7, whatever square root of 2 is.

00:24:48.080 --> 00:24:48.640
Yeah.

00:24:48.880 --> 00:24:52.900
But you'll get that exactly, square root of 2.

00:24:52.900 --> 00:24:57.820
And so there's all sorts of things that you can do with symbolic mathematics.

00:24:57.820 --> 00:25:06.400
People may be familiar with other similar tools called, it's basically, it's called the computer algebra system.

00:25:07.220 --> 00:25:10.240
There's proprietary tools like Maple and Mathematica.

00:25:10.240 --> 00:25:17.400
There are some other open source systems that people may have used as well, like Sage and Maxima.

00:25:18.520 --> 00:25:23.460
So just, if you've ever heard of any of those, Senpai sort of occupies a similar space.

00:25:23.460 --> 00:25:30.800
But Senpai, I guess, sort of stands apart from those in that it's open source and it's also, it's a Python library.

00:25:30.800 --> 00:25:37.360
So if you're familiar at all with Python, it's really easy to start using Senpai because it's just Python.

00:25:37.360 --> 00:25:38.600
Yeah.

00:25:38.600 --> 00:25:45.040
I think people who have not seen this kind of stuff in action should definitely go poke around and check it out.

00:25:45.040 --> 00:25:49.360
And we'll talk about some ways in which you can play with it just online with super low effort.

00:25:49.360 --> 00:25:56.260
I remember the first time I had been previously using MATLAB or something like that.

00:25:56.260 --> 00:26:02.900
And I saw Maple, which is one of the ones you called out, which is a symbolic sort of solving thing.

00:26:02.900 --> 00:26:07.780
You can say, oh, here, I want to do the integral from negative infinity to positive infinity of this thing.

00:26:07.780 --> 00:26:12.260
And it looks like it would come out of the textbook and it will sometimes even show you the steps.

00:26:12.260 --> 00:26:13.600
It's unbelievable.

00:26:13.600 --> 00:26:15.540
And that was 20 years ago when I saw it.

00:26:15.540 --> 00:26:18.380
I'm like, that's unbelievable that this computer is doing this.

00:26:18.380 --> 00:26:22.180
And Senpai is like that, but for Python, which is fantastic.

00:26:22.180 --> 00:26:22.980
Yeah.

00:26:22.980 --> 00:26:28.320
So it's, you know, it's basically, you know, it's the math that you would learn in a classroom.

00:26:28.320 --> 00:26:31.980
Except it, you know, it can also get very advanced.

00:26:31.980 --> 00:26:34.540
Like you said, we can do integrals.

00:26:34.640 --> 00:26:37.740
We have lots of very advanced mathematical features.

00:26:37.740 --> 00:26:44.160
We can do, we have a module for doing various areas of physics, for example.

00:26:44.160 --> 00:26:45.820
Nice.

00:26:45.820 --> 00:26:49.500
And it's also the foundation of many other things as well.

00:26:49.500 --> 00:26:59.580
Just as a, like setting the stage, a preview is you've got algebra, you've got calculus, you've got differential equations, you've got linear algebra and matrices.

00:27:00.020 --> 00:27:01.960
It's there's a lot of, a lot of good stuff in here.

00:27:01.960 --> 00:27:08.160
Andrei, do you want to maybe give us a little run through of like sort of the selling points of Senpai?

00:27:08.160 --> 00:27:10.440
Yeah, that's very easy.

00:27:10.440 --> 00:27:16.320
I was an undergrad student and, you know, studied physics or any kind of engineering a lot of times, even math.

00:27:16.320 --> 00:27:21.440
You have to do a lot of symbolic, you know, I would say derivations on paper.

00:27:21.440 --> 00:27:27.380
And I remember sitting in a physics class and I thought, you know, this, I would like to do this from Python, interactively.

00:27:29.080 --> 00:27:30.360
And so that's the idea.

00:27:30.360 --> 00:27:34.300
And then of course I sat down and I thought, well, let's get started.

00:27:34.300 --> 00:27:38.500
And my friends were telling me, you know, what, you know, can it do Gaussian integrals?

00:27:38.500 --> 00:27:42.940
You know, it's this integral of exponential, some polynomial, you know, X squared, for example.

00:27:42.940 --> 00:27:48.040
And I said, you know, it cannot because, but it will in five years, just not now.

00:27:48.040 --> 00:27:50.280
That's the hard problem.

00:27:51.280 --> 00:27:53.380
Oh, and I said, well, then use Mathematica.

00:27:53.380 --> 00:27:54.780
It could do it now.

00:27:54.780 --> 00:27:58.640
But, but they asked me, well, why don't you use Mathematica?

00:27:58.640 --> 00:28:00.760
You know, and I said, you know, Mathematica is great.

00:28:00.760 --> 00:28:02.480
Maple as well.

00:28:02.480 --> 00:28:10.540
It's absolutely, as you said, Michael, absolutely amazing that, you know, 20 years ago, and it could do all these integrals and, and serious expansion of these functions.

00:28:10.540 --> 00:28:13.240
Yeah, I was using Windows NT when I did that.

00:28:13.240 --> 00:28:14.240
I like how old that was.

00:28:14.240 --> 00:28:14.780
I did too.

00:28:14.780 --> 00:28:15.880
I did too, actually.

00:28:15.880 --> 00:28:21.160
And so, yeah, and, but, but the motivation is,

00:28:21.160 --> 00:28:27.460
to be able to do this from Python interactively allows you to kind of almost program with the symbolics using a language.

00:28:27.460 --> 00:28:32.440
That's a pretty decent language that you might already use for something else.

00:28:32.440 --> 00:28:43.840
And so what I wanted to do is assign the expression to a variable, then use the variable interactively and write some scripts to kind of handle my, my calculation and maybe save it to a file after that.

00:28:43.840 --> 00:28:44.840
And, and so on.

00:28:44.840 --> 00:28:50.680
And so that's, once you want to program with that, Mathematica, it allows you to program, but you have to learn.

00:28:50.680 --> 00:28:51.180
Yeah.

00:28:51.180 --> 00:28:53.680
And so that's why I wanted to have that in Python.

00:28:53.680 --> 00:28:53.680
Yeah.

00:28:53.680 --> 00:28:57.680
And so that's why I wanted to have that in Python.

00:28:57.680 --> 00:29:07.100
Well, the other thing that from this perspective, sitting on the Python or the comp size side of things and looking back is obvious.

00:29:07.100 --> 00:29:13.300
I don't know that it is as obvious coming from the other perspective of like, oh, I'm doing a MATLAB.m file or whatever.

00:29:13.680 --> 00:29:20.220
But in that world, if you work in MATLAB or Mathematica, you can do what MATLAB or Mathematica does.

00:29:20.220 --> 00:29:21.200
Right.

00:29:21.200 --> 00:29:26.260
That's a, it's really amazing in its specialty, but it's very specialized and limited.

00:29:26.260 --> 00:29:26.540
Right.

00:29:26.540 --> 00:29:33.200
You can't build like, you know, FastAPI and database driven apps that are doing some of this kind of computation along the way.

00:29:33.200 --> 00:29:46.200
right, if you move it to Python, like this is now, this capability is now accessible for all the applications, not just within, you know, the MATLAB or Maple environment.

00:29:46.200 --> 00:29:47.200
Yeah.

00:29:47.200 --> 00:29:58.200
And I guess it's an argument, you know, what's the advantage of Python, let's say for numerical computing, let's use it by or scientific, let's say for scientific computing, but the advantage of Python over, let's say Mathematica.

00:29:58.200 --> 00:30:00.200
And I think it's not a clear good answer.

00:30:00.200 --> 00:30:01.200
I think Mathematica is great.

00:30:01.200 --> 00:30:10.200
And they've done actually, it's quite amazing how good job they've done because they designed the language, I believe in the early eighties and they did not have to really modify the language too much.

00:30:10.200 --> 00:30:11.200
it was same spirit.

00:30:11.200 --> 00:30:12.200
So that's kind of amazing.

00:30:12.200 --> 00:30:14.200
It's much older than Python.

00:30:14.200 --> 00:30:19.200
So it's quite amazing how far, and then it still works pretty well and it's a decent language.

00:30:19.200 --> 00:30:29.200
But I think what I like about Python for scientific computing, you know, is that it's open source and it's the language just seems more kind of robust and kind of easier, more imperative.

00:30:29.200 --> 00:30:30.200
Don't have to really learn too much.

00:30:30.200 --> 00:30:37.200
It seems that anybody can learn it quickly and doesn't seem to have too many kind of things that would surprise you.

00:30:37.200 --> 00:30:38.200
Yeah.

00:30:38.200 --> 00:30:39.200
Very cool.

00:30:39.200 --> 00:30:42.200
So how long ago did you start on Senpai?

00:30:42.200 --> 00:30:45.200
I think I started in 2005 or six.

00:30:45.200 --> 00:30:46.200
Nice.

00:30:46.200 --> 00:30:47.200
It's been going for a while.

00:30:47.200 --> 00:30:48.200
Yes.

00:30:48.200 --> 00:30:54.200
So that really predates a lot of the scientific computing frameworks that are well known today, right?

00:30:54.200 --> 00:31:04.200
So you must have felt good about picking the right horse as you saw, you know, Jupyter or IPython at the time come along and those libraries like that.

00:31:04.200 --> 00:31:07.200
Way before Jupyter, IPython was there.

00:31:07.200 --> 00:31:11.200
Somebody told me about it and I tested it out and I thought, you know, this is pretty cool.

00:31:11.200 --> 00:31:12.200
It looks like Mathmerica.

00:31:12.200 --> 00:31:16.200
Then I later, when I talked to Fernando Perez who wrote it, he said, yeah, it's Mathmerica.

00:31:16.200 --> 00:31:17.200
That's what I wanted to have in Python.

00:31:17.200 --> 00:31:18.200
That's what I wanted to have in Python.

00:31:18.200 --> 00:31:20.200
So kind of the same motivation almost.

00:31:20.200 --> 00:31:28.200
Just, you know, so he kind of provided the foundation for the interactive part, you know, with the prompt and the numbers.

00:31:28.200 --> 00:31:32.200
This portion of Talk Python To Me is brought to you by Sentry.

00:31:32.200 --> 00:31:34.200
How would you like to remove a little stress from your life?

00:31:34.200 --> 00:31:40.200
Do you worry that users may be encountering errors, slowdowns or crashes with your app right now?

00:31:40.200 --> 00:31:43.200
Would you even know it until they sent you that support email?

00:31:43.200 --> 00:31:54.200
How much better would it be to have the error or performance details immediately sent to you, including the call stack and values of local variables and the active user recorded in the report?

00:31:54.200 --> 00:31:57.200
With Sentry, this is not only possible, it's simple.

00:31:57.200 --> 00:32:00.200
In fact, we use Sentry on all the Talk Python web properties.

00:32:00.200 --> 00:32:07.200
We've actually fixed a bug triggered by a user and had the upgrade ready to roll out as we got the support email.

00:32:07.200 --> 00:32:09.200
That was a great email to write back.

00:32:09.200 --> 00:32:12.200
Hey, we already saw your error and have already rolled out the fix.

00:32:12.200 --> 00:32:14.200
Imagine their surprise.

00:32:14.200 --> 00:32:16.200
Surprise and delight your users.

00:32:16.200 --> 00:32:20.200
Create your Sentry account at talkpython.fm/sentry.

00:32:20.200 --> 00:32:26.200
And if you sign up with the code talkpython, all one word, it's good for two free months of Sentry's business.

00:32:26.200 --> 00:32:32.200
This is a great idea of Sentry's business plan, which will give you up to 20 times as many monthly events as well as other features.

00:32:32.200 --> 00:32:36.200
Create better software, delight your users and support the podcast.

00:32:36.200 --> 00:32:41.200
Visit talkpython.fm/sentry and use the coupon code talkpython.

00:32:41.200 --> 00:32:47.200
When you work with Senpai, we'll see some examples and talk about them in a minute.

00:32:47.200 --> 00:32:59.200
You can put it into this pretty printing mode where it attempts with as much as it can within the terminal output to have more formal mathematical representation.

00:32:59.200 --> 00:33:09.200
So instead of like E^x, it might put a little smaller x up high and then an E down slightly to the lower left of it like you would try to write it.

00:33:09.200 --> 00:33:16.200
It seems that if it's in a notebook, it should be able to do even better, like maybe a LaTeX rendering or something really shiny.

00:33:16.200 --> 00:33:17.200
Yeah, it does.

00:33:17.200 --> 00:33:19.200
So in the notebook, it'll use the MathJax.

00:33:19.200 --> 00:33:24.200
So it'll, it'll, yeah, it'll, it'll just use, it'll look, it'll look great basically.

00:33:24.200 --> 00:33:28.200
Cause it, the MathJax looks just like, it's the same as a Logitech document.

00:33:28.200 --> 00:33:29.200
Yeah.

00:33:29.200 --> 00:33:30.200
Yeah.

00:33:30.200 --> 00:33:31.200
Oh man.

00:33:31.200 --> 00:33:32.200
Yeah.

00:33:32.200 --> 00:33:46.200
And in the terminal we use, we use, we use all these different Unicode characters to, to sort of render it as 2D text in the terminal so that it looks, it looks pretty decent in the terminal considering the constraints of a terminal.

00:33:46.200 --> 00:33:47.200
Nice.

00:33:47.200 --> 00:33:49.200
And I personally use it.

00:33:49.200 --> 00:33:51.200
I mainly use it in the terminal.

00:33:51.200 --> 00:33:52.200
I saw it.

00:33:52.200 --> 00:33:53.200
Yeah.

00:33:53.200 --> 00:33:57.200
So let's go and maybe, maybe we could walk through a little bit on one of the tutorials here.

00:33:57.200 --> 00:34:09.200
I mean, obviously we don't want to talk too much code or whatever, but I do think maybe just touching on this, will give people a sense of what it's like to work with this because.

00:34:09.200 --> 00:34:10.200
Yeah.

00:34:10.200 --> 00:34:11.200
So I think.

00:34:11.200 --> 00:34:12.200
Yeah.

00:34:12.200 --> 00:34:13.200
Yeah.

00:34:13.200 --> 00:34:14.200
Give it, give us a sense of what.

00:34:14.200 --> 00:34:16.200
In the tutorial, there's a, there's actually a section somewhere.

00:34:16.200 --> 00:34:19.200
where is that section?

00:34:19.200 --> 00:34:20.200
This one perhaps.

00:34:20.200 --> 00:34:22.200
But didn't get deleted.

00:34:22.200 --> 00:34:25.200
That's, it's in the introduction page.

00:34:25.200 --> 00:34:26.200
Yeah, it's on that page.

00:34:26.200 --> 00:34:33.200
But, if you maybe, scroll down, to this, the power of symbolic computation is the name of the header.

00:34:33.200 --> 00:34:34.200
There you go.

00:34:34.200 --> 00:34:41.200
So this is just, this is just sort of a, a bucket list of, just sort of a, a bunch of different examples of, of things that can do.

00:34:41.200 --> 00:34:45.200
So just to give you an idea and actually you can see there.

00:34:45.200 --> 00:34:51.200
also you can also see the pretty printing there as well, that Unicode pretty printing, that it does.

00:34:51.200 --> 00:34:54.200
that law tag is what we would see in the notebook.

00:34:54.200 --> 00:34:57.200
So you have to run underscore printing using Unicode equals true, right?

00:34:57.200 --> 00:34:59.200
It, it doesn't do it by default.

00:34:59.200 --> 00:35:00.200
it, it, yeah.

00:35:00.200 --> 00:35:03.200
So that in, in the notebook, it does actually do it by default.

00:35:03.200 --> 00:35:04.200
Sure.

00:35:04.200 --> 00:35:05.200
But not in the terminal or the rebel.

00:35:05.200 --> 00:35:06.200
Yeah.

00:35:06.200 --> 00:35:08.200
In the terminal, you need to, you need to run this.

00:35:08.200 --> 00:35:13.200
Otherwise it'll just print out like a one dimensional string that, that, you would get.

00:35:13.200 --> 00:35:16.200
it would, it looks sort of like what you would input.

00:35:16.200 --> 00:35:21.200
but yeah, you can see here, we can, it can take derivatives, take integrals.

00:35:21.200 --> 00:35:28.200
if you keep scrolling down, you can see, I think limits and, differential equations.

00:35:28.200 --> 00:35:30.200
you can solve.

00:35:30.200 --> 00:35:31.200
Yeah.

00:35:31.200 --> 00:35:34.200
So let me, let me talk people through just a couple of things, because I think.

00:35:34.200 --> 00:35:37.200
it's a little hard to understand how this might work.

00:35:37.200 --> 00:35:45.700
And the trick, I think really Andre, you tell me your thoughts on this is the ability

00:35:45.700 --> 00:35:50.200
for it to, define these symbols and these functions, here.

00:35:50.200 --> 00:35:51.200
Yeah.

00:35:51.200 --> 00:35:54.200
So the trick able to represent the expression symbolically.

00:35:54.200 --> 00:35:59.200
So you type, X plus Y, and plus some function sine X.

00:35:59.200 --> 00:36:04.200
And in, in memory, it represents it as a tree and it, and it, of course, the expression in symbolic

00:36:04.200 --> 00:36:05.200
form.

00:36:05.200 --> 00:36:09.200
And then it allows, it has all kinds of functionality that allows you to manipulate the expression,

00:36:09.200 --> 00:36:11.200
print it, you know, differentiate it.

00:36:11.200 --> 00:36:15.700
So many differentiate, or let's say an expression that takes the original expression and creates

00:36:15.700 --> 00:36:17.200
a new expression, the derivative.

00:36:17.200 --> 00:36:18.200
Right.

00:36:18.200 --> 00:36:24.200
With normal math, like pen and paper math, you don't usually define variables every now and

00:36:24.200 --> 00:36:28.700
then you say, you know, let X be an element of like the real L, real numbers such that,

00:36:28.700 --> 00:36:29.200
whatever.

00:36:29.200 --> 00:36:34.200
Normally you just say F of X or F of T or something like that, or Y.

00:36:34.200 --> 00:36:35.200
And it just works.

00:36:35.200 --> 00:36:44.200
You needed some way in Python to allow you to write expressions like X plus two Y without Python

00:36:44.200 --> 00:36:45.200
going, I have no idea what that means.

00:36:45.200 --> 00:36:46.200
Right.

00:36:46.200 --> 00:36:47.200
Yes, that's right.

00:36:47.200 --> 00:36:50.200
So, and yes, you first have to declare what X and Y is.

00:36:50.200 --> 00:36:52.200
You declare it as a symbol and then you can use it.

00:36:52.200 --> 00:36:58.200
We override the Python operation like plus, minus, and then you can construct the expression.

00:36:58.200 --> 00:37:02.200
And so what's nice about Python is that when I started with simple, I mean, I was kind of

00:37:02.200 --> 00:37:03.200
investigating the idea.

00:37:03.200 --> 00:37:07.200
What's nice that Python pretty much allows you to override all these operations.

00:37:07.200 --> 00:37:12.200
And so you can write it almost like math, you, in exponential, two stars.

00:37:12.200 --> 00:37:13.200
Yeah.

00:37:13.200 --> 00:37:18.200
Only caveat is that if you write, let's see one divided by two, and we started in Python

00:37:18.200 --> 00:37:20.200
two, that gives you a zero, I believe.

00:37:20.200 --> 00:37:24.200
And that's very confusing from Synthy's perspective, because you would like it, you would like it

00:37:24.200 --> 00:37:28.200
to give, the expression one over two, not, not zero.

00:37:28.200 --> 00:37:34.200
And because, and so I don't think there is any way still to, to, to fix that, to override

00:37:34.200 --> 00:37:35.200
this division.

00:37:35.200 --> 00:37:36.200
Yeah.

00:37:36.200 --> 00:37:38.200
At least in Python three, you get the right, at least you can load.

00:37:38.200 --> 00:37:41.200
I, what you get, I float double precision.

00:37:41.200 --> 00:37:42.200
Yeah.

00:37:42.200 --> 00:37:43.200
Yeah.

00:37:43.200 --> 00:37:44.200
You don't want that.

00:37:44.200 --> 00:37:46.200
You want one divided by two as simple expression.

00:37:46.200 --> 00:37:51.200
So, so when you have something like that, you have to wrap the number one into a teacher

00:37:51.200 --> 00:37:52.200
S.

00:37:52.200 --> 00:37:53.200
Yeah.

00:37:53.200 --> 00:37:57.200
Or, define some kind of symbol with that value and then use it like, like you have

00:37:57.200 --> 00:38:01.200
to go over B from, you know, quadratic equation.

00:38:01.200 --> 00:38:02.200
Right.

00:38:02.200 --> 00:38:03.200
You could like that kind of thing.

00:38:03.200 --> 00:38:09.200
but yeah, so you create these symbols and then you can write simple math that looks

00:38:09.200 --> 00:38:10.200
like it's just straight Python.

00:38:10.200 --> 00:38:13.200
So you could say X and Y are symbols.

00:38:13.200 --> 00:38:18.200
And then you could say something like X plus two times Y plus one.

00:38:18.200 --> 00:38:22.200
And that, that isn't not evaluated in any way.

00:38:22.200 --> 00:38:26.200
It's just becomes this, like, as you said, as tree, this expression that then you can operate

00:38:26.200 --> 00:38:31.200
on, like integrate it, take the derivative of it, find the limit of it, all those kinds of

00:38:31.200 --> 00:38:32.200
things.

00:38:32.200 --> 00:38:32.200
Right.

00:38:32.200 --> 00:38:33.200
So, yeah, that's the basic idea.

00:38:33.200 --> 00:38:34.200
Yeah.

00:38:34.200 --> 00:38:35.200
Yeah.

00:38:35.200 --> 00:38:36.200
That's the basic idea.

00:38:36.200 --> 00:38:42.200
and, and you can use it to do any, basically any sort of math that you would normally do,

00:38:42.200 --> 00:38:46.200
uh, with, with so that sort of expression, except you're doing it on the computer.

00:38:46.200 --> 00:38:47.200
So cool paper.

00:38:47.200 --> 00:38:52.200
You can do, you know, just like a real simple example might be, rational polynomials

00:38:52.200 --> 00:38:53.200
or something like that.

00:38:53.200 --> 00:39:00.200
Like if you had X squared minus one is one equation and then X plus one as another equation,

00:39:00.200 --> 00:39:05.200
you could say the first equation divided by a second and get, geez, which did I say minus

00:39:05.200 --> 00:39:08.200
that you get X minus one as simplifications.

00:39:08.200 --> 00:39:13.200
Another one where you can take something and it'll, it can figure out how to simplify it to

00:39:13.200 --> 00:39:14.200
an equivalent form.

00:39:14.200 --> 00:39:18.200
That's like, like dividing out factors and things like that.

00:39:18.200 --> 00:39:19.200
Yeah.

00:39:19.200 --> 00:39:20.200
Okay.

00:39:20.200 --> 00:39:22.200
These are, are super neat.

00:39:22.200 --> 00:39:23.200
you can do factors.

00:39:23.200 --> 00:39:28.200
So like you say, you could say like, polynomial factors, you know, one of the things I don't

00:39:28.200 --> 00:39:33.200
know if I should point this out, or maybe this should have been a warning to the whole show.

00:39:33.200 --> 00:39:41.200
If you're in high school or early college, this might be a terrible cheat sheet for homework

00:39:41.200 --> 00:39:44.200
and other types of is fantastic, right?

00:39:44.200 --> 00:39:49.200
If you're in an algebra course, you can do, do your work and then you could type this in and

00:39:49.200 --> 00:39:51.200
type this in and go, did I get it right?

00:39:51.200 --> 00:39:52.200
Wham.

00:39:52.200 --> 00:39:53.200
And out it comes, especially in a notebook.

00:39:53.200 --> 00:39:54.200
Right.

00:39:54.200 --> 00:39:55.200
Yep.

00:39:55.200 --> 00:39:56.200
Yeah.

00:39:56.200 --> 00:39:58.200
I mean, I think that's kind of unavoidable these days.

00:39:58.200 --> 00:40:05.200
you know, there's cause I mean, there's, there's also, you know, just graphing calculators

00:40:05.200 --> 00:40:07.200
that do this as well from alpha.

00:40:07.200 --> 00:40:11.200
I think simple is a great, a great way to do that if you're going to do it because now

00:40:11.200 --> 00:40:12.200
you're also learning Python.

00:40:12.200 --> 00:40:13.200
Right.

00:40:13.200 --> 00:40:19.200
Which I think is, would be great for someone who's like a high school student or an undergraduate

00:40:19.200 --> 00:40:22.200
because that, that's an actual useful skill as well.

00:40:22.200 --> 00:40:29.200
It might be even more, utilitarian in the long run than the calculus they're learning.

00:40:29.200 --> 00:40:35.200
so yeah, you can do like, derivatives and integrals of these equations.

00:40:35.200 --> 00:40:41.200
So you could say integrate E to the X times sine of X plus E to the X times cosine of X.

00:40:41.200 --> 00:40:45.200
And it will give you the result, which apparently is E to the X sine of X.

00:40:45.200 --> 00:40:46.200
I used to be able to do that.

00:40:46.200 --> 00:40:47.200
I can't anymore.

00:40:47.200 --> 00:40:51.200
Well, you can see that the line above it, it's differentiating that.

00:40:51.200 --> 00:40:53.200
So it's just undoing the line above it.

00:40:53.200 --> 00:40:53.200
Oh, I see.

00:40:53.200 --> 00:40:56.200
Well, that, that does, that is a bit of a cheat, isn't it?

00:40:56.200 --> 00:40:57.200
Yeah.

00:40:57.200 --> 00:41:01.200
But yeah, I mean that that's, yeah, you don't, that it, the integration is nice.

00:41:01.200 --> 00:41:05.200
Cause you don't have to remember all the, these, how to do all this integration by parts

00:41:05.200 --> 00:41:06.200
or whatever you would do.

00:41:06.200 --> 00:41:07.200
Yeah, exactly.

00:41:07.200 --> 00:41:10.200
So another thing it can do is, like concrete.

00:41:10.200 --> 00:41:11.200
I forgot.

00:41:11.200 --> 00:41:16.200
There's like a better term for that, but definitely integration over a range or, or so.

00:41:16.200 --> 00:41:22.200
So you could say integrate from like negative 10 to 20 of sine of X squared, or here's the

00:41:22.200 --> 00:41:25.200
example of negative infinity to positive infinity.

00:41:25.200 --> 00:41:31.200
And it says that square root of two, you know, radical two, radical pi over two as the answer,

00:41:31.200 --> 00:41:32.200
not like point.

00:41:32.200 --> 00:41:37.200
What is that point to something, something, something, something, something, I don't know,

00:41:37.200 --> 00:41:38.200
something like that.

00:41:38.200 --> 00:41:39.200
right.

00:41:39.200 --> 00:41:44.200
It gives you the actual theoretical answer, the exact mathematical answer in symbols, which

00:41:44.200 --> 00:41:45.200
is amazing.

00:41:45.200 --> 00:41:46.200
It is, it's amazing.

00:41:46.200 --> 00:41:48.200
And it's also not easy to.

00:41:48.200 --> 00:41:51.200
So when I started in SIFI, I knew this is not easy to program.

00:41:51.200 --> 00:41:53.200
Like how, how do you program such an integrator?

00:41:53.200 --> 00:41:54.200
It's not easy.

00:41:54.200 --> 00:41:58.200
But I figured, you know, if I can at least figure, at least get the basics, you know, like

00:41:58.200 --> 00:42:02.200
be able to represent these equations at least, that would still be a huge help.

00:42:02.200 --> 00:42:05.200
Cause sometimes the expression can be long and be able to manipulate it.

00:42:05.200 --> 00:42:10.200
And then as we were joined with, you know, so many, excellent people, they, they contributed

00:42:10.200 --> 00:42:14.200
all the, all the features students, mostly actually it was developed by Google summer of

00:42:14.200 --> 00:42:15.200
cold students.

00:42:15.200 --> 00:42:16.200
And okay.

00:42:16.200 --> 00:42:17.200
Yeah.

00:42:17.200 --> 00:42:18.200
Cool.

00:42:18.200 --> 00:42:21.200
It's, it, it, it, I would not be able to do that.

00:42:21.200 --> 00:42:22.200
Let's just put it that way.

00:42:22.200 --> 00:42:24.200
It's a, it's a lot of work that's behind it.

00:42:24.200 --> 00:42:25.200
Yeah.

00:42:25.200 --> 00:42:27.200
I'm looking at this.

00:42:27.200 --> 00:42:32.200
I know these concepts just on pure math are hard and then to automate it in general, it's

00:42:32.200 --> 00:42:33.200
got to be next level.

00:42:33.200 --> 00:42:36.200
so other things you can do is like, you can define a function.

00:42:36.200 --> 00:42:41.200
So here you say, here's a function called Y, and then you can say, well, what if you had

00:42:41.200 --> 00:42:46.200
the differential equation that was, you know, the second derivative of Y minus Y equals E

00:42:46.200 --> 00:42:48.200
to the T, right?

00:42:48.200 --> 00:42:49.200
Solve that.

00:42:49.200 --> 00:42:53.200
And then sure enough, outcomes, the solution.

00:42:53.200 --> 00:42:55.200
So that's a function for that.

00:42:55.200 --> 00:42:58.200
what the function is, which is pretty amazing.

00:42:58.200 --> 00:42:59.200
Yeah.

00:42:59.200 --> 00:43:06.200
So does things like, eigen values from, linear algebra and all kinds of stuff.

00:43:06.200 --> 00:43:07.200
yeah.

00:43:07.200 --> 00:43:08.200
Great.

00:43:08.200 --> 00:43:12.200
And then we have in Python, we have stir and repper.

00:43:12.200 --> 00:43:16.200
You guys also have late tech, which is pretty cool.

00:43:16.200 --> 00:43:17.200
Right.

00:43:17.200 --> 00:43:22.200
I just call latex, latex on a function and out it comes with like the crazy escape code.

00:43:22.200 --> 00:43:25.200
Latex that you would need for a paper or something.

00:43:25.200 --> 00:43:26.200
Right.

00:43:26.200 --> 00:43:27.200
Yep.

00:43:27.200 --> 00:43:28.200
Yeah.

00:43:28.200 --> 00:43:32.200
And this, this actually, I mean, this is only even scratching the surface of, of the, what

00:43:32.200 --> 00:43:33.200
Simpa can do.

00:43:33.200 --> 00:43:37.200
So it's actually quite a large library.

00:43:37.200 --> 00:43:38.200
Yeah.

00:43:38.200 --> 00:43:42.200
I don't want to focus too much on just the pure math, but maybe give us a sense of like some

00:43:42.200 --> 00:43:43.200
of the things that amaze you.

00:43:43.200 --> 00:43:45.200
What do you have in mind when you're saying that kind of stuff?

00:43:45.200 --> 00:43:46.200
that amaze me.

00:43:46.200 --> 00:43:47.200
Yeah.

00:43:47.200 --> 00:43:53.200
I mean, I'm, I think the whole thing's amazing still, even though I know how it works

00:43:53.200 --> 00:43:57.200
and I've been working on it for awhile, but yeah, just the fact that the computer can do,

00:43:57.200 --> 00:44:03.200
uh, the same sort of mathematics that you would do, on a piece of paper is, is incredible.

00:44:03.200 --> 00:44:09.200
some of the algorithms that to do like integration and stuff are also, pretty interesting

00:44:09.200 --> 00:44:14.200
because, they, they sort of, they go beyond what you would learn in a calculus class.

00:44:14.200 --> 00:44:18.200
there, there are algorithms that, that can compute integrals that you would, you would

00:44:18.200 --> 00:44:23.200
never be able to know how to compute them just using what you'd learn in a, in a calc one

00:44:23.200 --> 00:44:24.200
or calc two.

00:44:24.200 --> 00:44:25.200
Sure.

00:44:25.200 --> 00:44:29.200
but those, those are something that you can actually implement in something like Simpi

00:44:29.200 --> 00:44:33.200
and then, Simpi will be able to do those integrals for you.

00:44:33.200 --> 00:44:39.200
some of the features that, I mean, if you go on the website, there's a, there's a

00:44:39.200 --> 00:44:40.200
huge list of features.

00:44:40.200 --> 00:44:46.200
I think, one feature that we didn't mention that's, that's maybe worth mentioning,

00:44:46.200 --> 00:44:49.200
um, is, code generation.

00:44:49.200 --> 00:44:56.200
So, code generation, means that you take one of these expressions and you turn it

00:44:56.200 --> 00:45:05.200
into basically code for another language, whether that's C or Fortran or, pretty much any,

00:45:05.200 --> 00:45:09.200
any language that you would want to, translate it into.

00:45:09.200 --> 00:45:15.200
And then you can then take that expression and, and, basically convert it into, something

00:45:15.200 --> 00:45:19.200
that you could numerically evaluate, very fast in, in whatever language you prefer

00:45:19.200 --> 00:45:20.200
to use.

00:45:20.200 --> 00:45:21.200
Wow.

00:45:21.200 --> 00:45:22.200
Okay.

00:45:22.200 --> 00:45:25.200
So you've got your notebook written in Python or something and you've come up with some expressions

00:45:25.200 --> 00:45:31.200
and you're like, I would like to just do that in Fortran or C and I, and I don't trust myself

00:45:31.200 --> 00:45:32.200
to get it right.

00:45:32.200 --> 00:45:33.200
myself to get it right.

00:45:33.200 --> 00:45:36.200
So just print out the syntax basically.

00:45:36.200 --> 00:45:37.200
Yeah.

00:45:37.200 --> 00:45:38.200
Yeah.

00:45:38.200 --> 00:45:39.200
Oh, go ahead, Andre.

00:45:39.200 --> 00:45:40.200
Yeah.

00:45:40.200 --> 00:45:43.200
Well, let's say you want to approximate some function, you know, with a polynomial.

00:45:43.200 --> 00:45:45.200
So you, you can use him by to do that.

00:45:45.200 --> 00:45:49.200
And then at the end, you just want the polynomial in the form that you can put in your production

00:45:49.200 --> 00:45:50.200
code, whether for Tron or C.

00:45:50.200 --> 00:45:52.200
So it's still simple to do it.

00:45:52.200 --> 00:45:53.200
Then you can copy and paste it.

00:45:53.200 --> 00:45:54.200
You know, it's correct.

00:45:54.200 --> 00:45:55.200
Assuming there is no back in simple.

00:45:55.200 --> 00:45:56.200
Yeah, sure.

00:45:56.200 --> 00:45:57.200
Yeah.

00:45:57.200 --> 00:46:01.200
But I suspect it's probably pretty straightforward.

00:46:01.200 --> 00:46:06.200
Once you've got the expression to break it down into, you know, this is a multiply.

00:46:06.200 --> 00:46:09.200
Here's where the parentheses that group it in the expression tree.

00:46:09.200 --> 00:46:14.200
But yeah, there's, I mean, there's, there's a few places where it's like, okay, we need

00:46:14.200 --> 00:46:16.200
to make sure we get the semantics.

00:46:16.200 --> 00:46:22.200
The semantics might be a little different between like C and, and Python or something like that.

00:46:22.200 --> 00:46:23.200
Yeah.

00:46:23.200 --> 00:46:25.200
So we need to make sure we sort of translate that correctly.

00:46:25.200 --> 00:46:30.200
But yeah, it's, I mean, in principle, it's not that hard, but I mean, it's not that hard.

00:46:30.200 --> 00:46:34.200
I mean, it's also not something you want to do by hand either because.

00:46:34.200 --> 00:46:35.200
Yeah.

00:46:35.200 --> 00:46:37.200
It's super error prone if you were to try to do it by hand.

00:46:37.200 --> 00:46:38.200
Yeah.

00:46:38.200 --> 00:46:39.200
Yeah.

00:46:39.200 --> 00:46:40.200
It sounds like a great feature.

00:46:40.200 --> 00:46:42.200
That's, that's quite neat.

00:46:42.200 --> 00:46:48.200
Maybe we could talk just a little bit internally, Andre, about how you accomplish this.

00:46:48.200 --> 00:46:49.200
Yeah.

00:46:49.200 --> 00:46:50.200
Like how I started it.

00:46:50.200 --> 00:46:51.200
Well, just like, how does it work?

00:46:51.200 --> 00:46:59.200
If I give it a, if I give it a, an expression of, you know, e to the x cosine x, and I say integrate

00:46:59.200 --> 00:47:01.200
that, like, where do you even start?

00:47:01.200 --> 00:47:02.200
Yeah, exactly.

00:47:02.200 --> 00:47:06.200
Well, the integration, I guess, I don't know, those more details, there's like a couple different

00:47:06.200 --> 00:47:09.200
algorithms, but I'll tell you kind of the basic idea.

00:47:09.200 --> 00:47:14.200
When I did, you know, the first thing you do in your search, how do you do symbolic integration?

00:47:14.200 --> 00:47:18.200
And then there is this famous algorithm called the RISH algorithm.

00:47:18.200 --> 00:47:22.200
So you kind of start studying and then you realize, oh, that's like multiple years of

00:47:22.200 --> 00:47:24.200
worth of work to implement this.

00:47:24.200 --> 00:47:27.200
And it's kind of fragile and doesn't always work.

00:47:27.200 --> 00:47:33.200
And Mathematica, they, as the company, and Perkis Wolfram, they, they managed to do that.

00:47:33.200 --> 00:47:35.200
That's a lot of effort, a lot of work.

00:47:35.200 --> 00:47:38.200
And they had to invest in a large teams of people, test it carefully and so on.

00:47:38.200 --> 00:47:43.200
But in practice, there are other approaches.

00:47:43.200 --> 00:47:49.200
And it turns out that you can integrate a lot, you know, wide classes of functions just

00:47:49.200 --> 00:47:51.200
by implementing an algorithm that works.

00:47:51.200 --> 00:47:53.200
For example, for a polynomial, it's easy.

00:47:53.200 --> 00:47:55.200
Anybody, anybody can do it, right?

00:47:55.200 --> 00:47:57.200
And then you can add some trigonometric functions.

00:47:57.200 --> 00:47:59.200
So you kind of implement algorithm for that.

00:47:59.200 --> 00:48:01.200
Then you kind of built your way up.

00:48:01.200 --> 00:48:05.200
It turns out when you do that, you can make it very useful in practice.

00:48:05.200 --> 00:48:10.200
Maybe it's not as powerful as Mathematica is, but it's very helpful.

00:48:10.200 --> 00:48:11.200
So that's how we started.

00:48:11.200 --> 00:48:19.200
And then once you have the rules, I mean, first, second, third year of calculus, there's

00:48:19.200 --> 00:48:23.200
in math, I, there is a ton of creativity in the calculus classes.

00:48:23.200 --> 00:48:27.200
It's a lot of like, I just today we're doing integration by parts today.

00:48:27.200 --> 00:48:31.200
We're doing like integration of stuff that's divided or what, you know, like there's a,

00:48:31.200 --> 00:48:33.200
there's set algorithms that they tell you to follow.

00:48:33.200 --> 00:48:36.200
And once you get the basics, it seems like, I guess you could compose them.

00:48:36.200 --> 00:48:37.200
Yeah.

00:48:37.200 --> 00:48:38.200
So that was kind of my initial idea.

00:48:38.200 --> 00:48:41.200
Let's just kind of do stuff that we know how to do.

00:48:41.200 --> 00:48:43.200
And it's kind of straightforward.

00:48:43.200 --> 00:48:49.200
But, but then kind of the engineering part comes to it as well, because you don't want,

00:48:49.200 --> 00:48:51.200
you want things to always work quickly.

00:48:51.200 --> 00:48:53.200
And if it cannot be done, you would like to know the answer.

00:48:53.200 --> 00:48:56.200
This cannot be done quickly, not to wait a couple hours.

00:48:56.200 --> 00:48:58.200
until it tries all the functions.

00:48:58.200 --> 00:48:59.200
Yeah.

00:48:59.200 --> 00:49:04.200
And so then it just becomes a lot of, I would say engineering decisions, how to make this

00:49:04.200 --> 00:49:05.200
all work.

00:49:05.200 --> 00:49:07.200
And I think we are still not done yet.

00:49:07.200 --> 00:49:11.200
I think there are a couple of, I would say promising approaches.

00:49:11.200 --> 00:49:20.200
one approach is a certain professor, I think, or a professor, I think in Canada, he has,

00:49:20.200 --> 00:49:23.200
he figured out how to take all these rules, how to integrate functions and compose them into

00:49:23.200 --> 00:49:24.200
just a decision tree.

00:49:24.200 --> 00:49:29.200
So you give it an expression and then it just figures out exactly as you said, is it the polynomial?

00:49:29.200 --> 00:49:30.200
Is it like dividing?

00:49:30.200 --> 00:49:31.200
Is it like dividing?

00:49:31.200 --> 00:49:32.200
And so on.

00:49:32.200 --> 00:49:37.200
And then the decision tree tells it exactly how to go about it to give you the final formula,

00:49:37.200 --> 00:49:38.200
the integral.

00:49:38.200 --> 00:49:39.200
Okay.

00:49:39.200 --> 00:49:41.200
And here's the small formula you apply to it or whatever.

00:49:41.200 --> 00:49:47.200
So you take out these 5,000 formulas and then he takes them and actually he uses Mathematica

00:49:47.200 --> 00:49:51.200
and he composes those into a decision tree and then it prints the decision tree as for example,

00:49:51.200 --> 00:49:52.200
Python code and so on.

00:49:52.200 --> 00:49:56.200
And we still haven't, well actually, so we have a module for that.

00:49:56.200 --> 00:49:59.200
And it's something that, what I like about this approach is that it's quick.

00:49:59.200 --> 00:50:00.200
In principle, it's quick.

00:50:00.200 --> 00:50:04.200
You just go through the decision tree and it gives you a formula or it says it cannot be there.

00:50:04.200 --> 00:50:09.200
And I would like, but you know, there are all kinds of practical issues.

00:50:09.200 --> 00:50:10.200
The tree is pretty quick.

00:50:10.200 --> 00:50:14.200
And so when you encode it in Python, it takes forever to import and so on.

00:50:14.200 --> 00:50:18.200
So we are still kind of struggling with these issues, but it just gives you an idea what kind of issues are,

00:50:18.200 --> 00:50:20.200
engineering, I would say issues are involved in.

00:50:20.200 --> 00:50:22.200
Yeah, that's pretty wild.

00:50:22.200 --> 00:50:29.200
I mean, have you thought of or are you using things like Cython or these other types of speed up type things?

00:50:29.200 --> 00:50:30.200
Yes.

00:50:30.200 --> 00:50:35.200
Yeah, I spent, so maybe 10 years ago, I spent a lot of time investigating how to make Simpy faster.

00:50:35.200 --> 00:50:42.200
Simpy is great, it's pure Python, it's easy to contribute to, and for many things it's amazing, just works and that's all you need.

00:50:42.200 --> 00:50:48.200
But sometimes you need either larger calculation or a lot of calculations and it's not fast enough.

00:50:48.200 --> 00:50:49.200
So how to speed it up?

00:50:49.200 --> 00:50:56.200
So we investigated just pure C, Cython, all kinds of tricks in Python itself to speed it up.

00:50:56.200 --> 00:50:59.200
Eventually, that kind of led to the SimEngine project.

00:50:59.200 --> 00:51:01.200
I decided, let's just use C++.

00:51:01.200 --> 00:51:08.200
It's the only tool that I know that actually can deliver the performance and kind of maintaining a bigger project.

00:51:08.200 --> 00:51:14.200
So that's SimEngine and then we have Python wrappers and then Simpy can use it.

00:51:14.200 --> 00:51:20.200
So there are modules in Simpy such as the dynamic, kind of dynamic, what do I say?

00:51:20.200 --> 00:51:26.200
The classical, mechanical, I guess, module that allows you to simulate a solid body, you know, physics.

00:51:26.200 --> 00:51:31.200
It's able to use SimEngine out of the hood so it gets much, much faster.

00:51:31.200 --> 00:51:32.200
Okay, interesting.

00:51:32.200 --> 00:51:40.200
Yeah, so this is a C++ project, but it has Python wrappers for easy Python integration with Simpy and other things.

00:51:40.200 --> 00:51:41.200
Yeah, that's cool.

00:51:41.200 --> 00:51:49.200
You know, I think that kind of summarizes a lot of scientific Python is there's a really great API.

00:51:49.200 --> 00:51:56.200
And when you ask it to do things, it takes the data and hands it off to some C layer that actually does it for Rust or something like that, right?

00:51:56.200 --> 00:51:57.200
Yes.

00:51:57.200 --> 00:52:00.200
And it's not just writing it in C++.

00:52:00.200 --> 00:52:09.200
There are other libraries that also in C++, but to make it really fast, one has to spend the time and figure out how to represent the expression in memory,

00:52:09.200 --> 00:52:16.200
how to allocate the memory, how to, so we have to make, you know, reference content pointers, for example.

00:52:16.200 --> 00:52:18.200
So that's what, that's the design I chose.

00:52:18.200 --> 00:52:23.200
How to make the reference content pointer as fast as possible, things like that.

00:52:23.200 --> 00:52:32.200
How to make sure that you can actually maintain it so that it gives you, if you make a mistake, it doesn't give you a segfold, but some kind of a, in debug mode, some kind of ways to debug it, right?

00:52:32.200 --> 00:52:37.200
So there's all kinds of engineering, you know, decision behind the scenes.

00:52:37.200 --> 00:52:39.200
I asked it to solve this and it went poof and went away.

00:52:39.200 --> 00:52:40.200
I guess that means something.

00:52:40.200 --> 00:52:41.200
I don't know.

00:52:41.200 --> 00:52:42.200
Yep.

00:52:42.200 --> 00:52:43.200
So we don't want that.

00:52:43.200 --> 00:52:45.200
But anyway, but yes, so the symmetry works.

00:52:45.200 --> 00:52:50.200
It's, it, it contains kind of like the core level of the core of Simpy.

00:52:50.200 --> 00:52:59.200
Is this what I would, if I go pip install Simpy, do I get this or do I have to do something special to like swap out the computation engine with this?

00:52:59.200 --> 00:53:01.200
You have to install it as a separate library.

00:53:01.200 --> 00:53:08.200
So if you do just pip install Simpy by default, it only installs Simpy, but, but you can do pip, I think you can do pip install Sim engine.

00:53:08.200 --> 00:53:09.200
I use Coda.

00:53:09.200 --> 00:53:13.200
So you can do Coda install Sim engine, that install Sim engine as a, as a library.

00:53:13.200 --> 00:53:17.200
And in Python, you do import Sim engine, and then you use it kind of like Simpy.

00:53:17.200 --> 00:53:20.200
And Simpy can also optionally use it.

00:53:20.200 --> 00:53:21.200
Got one to build.

00:53:21.200 --> 00:53:22.200
Okay.

00:53:22.200 --> 00:53:24.200
Yeah, this looks really neat.

00:53:24.200 --> 00:53:34.200
one of the things I wanted to touch on here, and at the top right of the page, if I go just to the Simpy page, it says try it with Simpy gamma.

00:53:34.200 --> 00:53:42.200
And so maybe we could sort of close out the conversation a bit with just poking around with this and then maybe highlighting some projects that use it.

00:53:42.200 --> 00:53:45.200
So for example, it says, oh, you could just try some random example.

00:53:45.200 --> 00:53:49.200
And it's got like algebra, algebraic things I could do.

00:53:49.200 --> 00:53:53.200
So it says, you know, polynomial divisor, I'm coming in and copy this.

00:53:53.200 --> 00:54:01.200
And if I go, there's a little calculator like thing at the top where I go hit equals, and it will go and run that in,

00:54:01.200 --> 00:54:03.200
The polynomial division in this case, it looks like.

00:54:03.200 --> 00:54:04.200
Yeah, yeah.

00:54:04.200 --> 00:54:06.200
Like what are the divisors of, of this thing, right?

00:54:06.200 --> 00:54:07.200
Something like that.

00:54:07.200 --> 00:54:08.200
Yeah.

00:54:08.200 --> 00:54:13.200
So this is sort of our, our little version of, of Wolfram alpha, but using Simpy under the hood.

00:54:13.200 --> 00:54:16.200
it's not quite as powerful as Wolfram alpha.

00:54:16.200 --> 00:54:20.200
We don't support like, natural language input.

00:54:20.200 --> 00:54:21.200
that sort of thing.

00:54:21.200 --> 00:54:27.200
But, yeah, you can, you can kind of get an idea of sorts of things Simpy can do here.

00:54:27.200 --> 00:54:28.200
maybe one of the interesting ones.

00:54:28.200 --> 00:54:35.200
If you scroll down a little bit, and click on one of the, integral, the one that says get steps for integrals.

00:54:35.200 --> 00:54:36.200
Yeah.

00:54:36.200 --> 00:54:37.200
How about this?

00:54:37.200 --> 00:54:39.200
I, I'm a big fan of, E.

00:54:39.200 --> 00:54:41.200
There's a whole book called E the story of a number.

00:54:41.200 --> 00:54:42.200
I have you guys read it.

00:54:42.200 --> 00:54:43.200
no, I haven't heard of it.

00:54:43.200 --> 00:54:45.200
You haven't E, E the story of a number is a great book.

00:54:45.200 --> 00:54:47.200
It's about like Euler and all that stuff.

00:54:47.200 --> 00:54:48.200
Okay.

00:54:48.200 --> 00:54:49.200
Yeah.

00:54:49.200 --> 00:54:54.200
So if this was just integrate E to the X over one plus E to the two X, right?

00:54:54.200 --> 00:54:55.200
Yeah.

00:54:55.200 --> 00:55:03.200
So if you scroll down here, hopefully, should see something that says, see steps.

00:55:03.200 --> 00:55:04.200
yeah.

00:55:04.200 --> 00:55:06.200
I see under the derivative, for example.

00:55:06.200 --> 00:55:07.200
Yeah.

00:55:07.200 --> 00:55:08.200
That was pretty interesting.

00:55:08.200 --> 00:55:11.200
I don't know if this is the one that has steps, but I saw it in other places.

00:55:11.200 --> 00:55:15.200
yeah, maybe that's, maybe this example is not working right now.

00:55:15.200 --> 00:55:16.200
Yeah.

00:55:16.200 --> 00:55:17.200
Yeah.

00:55:17.200 --> 00:55:23.200
There's some, here, let's do, probably the differentiation of something might be, I bet it's got some steps for that, but that was part of what I was talking about.

00:55:23.200 --> 00:55:36.200
I don't know what I was talking about with the cheat and not, and I don't mean that in a negative way, but like, it will show you the steps as if it was written out in a textbook, of how like this one right here, like, look at this.

00:55:36.200 --> 00:55:41.200
You're going to apply the quotient rule, which is the X of F of X over G of X equals this.

00:55:41.200 --> 00:55:42.200
And then you're going to apply this.

00:55:42.200 --> 00:55:45.200
And I mean, this is amazing.

00:55:45.200 --> 00:55:46.200
Yeah.

00:55:46.200 --> 00:55:50.200
Well, I mean, I think, I think it's, you know, it's instructive.

00:55:50.200 --> 00:55:52.200
It's not, it's not just cheating.

00:55:52.200 --> 00:55:53.200
It's not just cheating.

00:55:53.200 --> 00:55:54.200
No, of course it's not.

00:55:54.200 --> 00:56:03.200
And I do think it's really instructive because it's one thing to just go take a function or an expression and say, take the derivative of this.

00:56:03.200 --> 00:56:04.200
And it says, great.

00:56:04.200 --> 00:56:06.200
It's this crazy thing.

00:56:06.200 --> 00:56:07.200
Like, how was I supposed to know?

00:56:07.200 --> 00:56:11.200
It was like the tan of the cotangent of X or like something like that.

00:56:11.200 --> 00:56:12.200
Right.

00:56:12.200 --> 00:56:15.200
but if it says, you know, like, look, here's how we got there.

00:56:15.200 --> 00:56:16.200
That's yeah.

00:56:16.200 --> 00:56:17.200
That's very educational.

00:56:17.200 --> 00:56:18.200
Yeah.

00:56:18.200 --> 00:56:29.200
So it's not, this, this, but many parts of Senpai don't work like this because, sort of the underlying algorithms don't, don't really work the same way that you would do it by hand.

00:56:29.200 --> 00:56:35.200
But there are some that basically work the same way you would do it by hand, like differentiation as an example.

00:56:35.200 --> 00:56:39.200
So we can, we can sort of extract the steps and show them to you.

00:56:39.200 --> 00:56:40.200
Yeah, this is great.

00:56:40.200 --> 00:56:46.200
I'll put this, this explanation example into the show notes so people can, come back and check it out.

00:56:46.200 --> 00:56:50.200
But gamma.senpai.org and then just choose some of the examples is really how to do it.

00:56:50.200 --> 00:56:51.200
And it's how it gets there.

00:56:51.200 --> 00:56:53.200
So very nice.

00:56:53.200 --> 00:56:59.200
So let's, let's wrap this up by going to senpai.org.

00:56:59.200 --> 00:57:08.200
And then on senpai.org, if you go just down a little bit, there's projects using Senpai that are, they all sound super interesting to me.

00:57:08.200 --> 00:57:16.200
You've got like chempy, a package for chemistry in Python, Einstein pi for symbolic numeric, for general relativity.

00:57:16.200 --> 00:57:19.200
Are there any of these that you think are particularly neat or stand out to you?

00:57:19.200 --> 00:57:21.200
You want to give a shout out to either of you?

00:57:21.200 --> 00:57:22.200
Oh yeah.

00:57:22.200 --> 00:57:27.200
I, all of them, but I like the pi guy, for example, it's a, it's a very nice package for, you can, can.

00:57:27.200 --> 00:57:29.200
Pi dies and dynamics.

00:57:29.200 --> 00:57:30.200
Yeah.

00:57:30.200 --> 00:57:37.200
So you can, it allows you to simulate, you get kind of like a robot or multiple, you know,

00:57:37.200 --> 00:57:38.200
a pendulum, like double pendulum.

00:57:38.200 --> 00:57:43.200
You just kind of tell it exactly the relations of the body and then it allows you to write.

00:57:43.200 --> 00:57:45.200
And then pi die can derive equations of motion.

00:57:45.200 --> 00:57:49.200
And those equations get extremely complicated, real quick.

00:57:49.200 --> 00:57:52.200
for triple pendulum, which just gets very complicated.

00:57:52.200 --> 00:57:56.200
Pi die can derive the equations for you, correctly.

00:57:56.200 --> 00:57:59.200
And so, it's, it's a, it's a certainly not neat project.

00:57:59.200 --> 00:58:00.200
Yeah.

00:58:00.200 --> 00:58:01.200
That one's really cool.

00:58:01.200 --> 00:58:03.200
So you can see the chem pie kind of stands out for me.

00:58:03.200 --> 00:58:05.200
Cause I've, I've always loved chemistry.

00:58:05.200 --> 00:58:06.200
Yeah.

00:58:06.200 --> 00:58:08.200
Any others that you want to give a shout out to?

00:58:08.200 --> 00:58:13.200
well, I guess one, one that I'll mention here, actually it's listed as a sage.

00:58:13.200 --> 00:58:20.200
So sage, sage is something that a lot of people might know as sort of an alternative, computer algebra system.

00:58:20.200 --> 00:58:21.200
Yeah.

00:58:21.200 --> 00:58:27.200
I've actually had a William Stein on the show to talk about it as well from a sage math and,

00:58:27.200 --> 00:58:28.200
yeah.

00:58:28.200 --> 00:58:31.200
So sage, sage sort of integrates a lot of libraries, including Senpai itself.

00:58:31.200 --> 00:58:34.200
You can see Senpai is listed there on the, on the front page of their website.

00:58:34.200 --> 00:58:35.200
Yep.

00:58:35.200 --> 00:58:42.200
so, if you use sage, there's, there's a chance that you're actually just using Senpai under the hood.

00:58:42.200 --> 00:58:48.200
so that, yeah, it's, that's, that's one that I like.

00:58:48.200 --> 00:59:00.200
a lot of these are, are, are making use of that, the code generation, concept that I talked about where they're, they're basically sort of modeling whatever chemistry or dynamics and in Senpai.

00:59:00.200 --> 00:59:07.200
And then, then taking that expression and turning it into something that they can numerically evaluate.

00:59:07.200 --> 00:59:08.200
Yeah.

00:59:08.200 --> 00:59:11.200
It looks like maybe some quantum computing stuff here.

00:59:11.200 --> 00:59:12.200
All right, great.

00:59:12.200 --> 00:59:13.200
Now these are all cool.

00:59:13.200 --> 00:59:19.200
And I think probably seeing some uses of it, like give people ideas for their own projects.

00:59:19.200 --> 00:59:34.200
Let's wrap this up, this, conversation up just, to talk about maybe bridging the gap or bridging the world of computational stuff, symbolic stuff, and then, this numerical side, right?

00:59:34.200 --> 00:59:39.200
So I've gone through and I've said, here's some complex function and maybe here's another one.

00:59:39.200 --> 00:59:48.200
And I'm going to combine them through whatever in some, some way, and then now generate me a second derivative or whatever it is I need or integrate it.

00:59:48.200 --> 00:59:50.200
I've now got a new expression.

00:59:50.200 --> 00:59:56.200
Can I somehow take that and turn it into something I can call as a Python function?

00:59:56.200 --> 01:00:00.200
Like here's a number of what's the answer effectively, or here's a numpy array.

01:00:00.200 --> 01:00:02.200
Give me the evaluation across the numpy array.

01:00:02.200 --> 01:00:03.200
Yeah.

01:00:03.200 --> 01:00:05.200
So there's, there's a function called lambda phi.

01:00:05.200 --> 01:00:12.200
it's a L A M B D A F Y, which basically does exactly what you said.

01:00:12.200 --> 01:00:19.200
It takes an expression and it turns it into a function that you can evaluate with numpy.

01:00:19.200 --> 01:00:24.200
so, yeah, that, that workflow is basically exactly what you describe.

01:00:24.200 --> 01:00:30.200
You, you, you, you simply derive whatever it is you're doing using the mathematics of,

01:00:30.200 --> 01:00:31.200
of your problem.

01:00:31.200 --> 01:00:35.200
And then you, you put that inside of lambda phi, and now you have something that you can actually

01:00:35.200 --> 01:00:42.200
pass, your data to with numpy, and, evaluate it numerically.

01:00:42.200 --> 01:00:43.200
Nice.

01:00:43.200 --> 01:00:44.200
That's awesome.

01:00:44.200 --> 01:00:48.200
Does it effectively use that, that code generation thing you were talking about?

01:00:48.200 --> 01:00:49.200
Yeah.

01:00:49.200 --> 01:00:55.200
So under the hood, it's, it's using, it's basically generating code for a language equals.

01:00:55.200 --> 01:00:56.200
Okay.

01:00:56.200 --> 01:00:57.200
Yeah.

01:00:57.200 --> 01:00:58.200
Yeah.

01:00:58.200 --> 01:01:00.200
Numpy itself is sort of a language.

01:01:00.200 --> 01:01:02.200
It's got its own set of functions.

01:01:02.200 --> 01:01:03.200
and right, right.

01:01:03.200 --> 01:01:09.200
Instead of looping, you'll, you do sort of vector operations and things like that, which you'd

01:01:09.200 --> 01:01:10.200
want it to do that.

01:01:10.200 --> 01:01:11.200
Yeah.

01:01:11.200 --> 01:01:12.200
Yeah.

01:01:12.200 --> 01:01:16.200
there are other functions, which you can do to, to, instead of calling numpy, if

01:01:16.200 --> 01:01:20.200
you want to like call it through C as well, there, there's options for that as well.

01:01:20.200 --> 01:01:25.200
but yeah, that, that lambda phi is sort of the big one that, that you need to know

01:01:25.200 --> 01:01:26.200
if you want to do that.

01:01:26.200 --> 01:01:27.200
Okay.

01:01:27.200 --> 01:01:30.200
Cause to me, that seems like a really important bridge.

01:01:30.200 --> 01:01:32.200
You know, I've got this idea.

01:01:32.200 --> 01:01:38.200
I here's my theoretical equations, but at some point I want to evaluate it and make, make the

01:01:38.200 --> 01:01:43.200
computer, you know, generate a graph based on these numbers or something.

01:01:43.200 --> 01:01:44.200
Right.

01:01:44.200 --> 01:01:45.200
Yeah, definitely.

01:01:45.200 --> 01:01:46.200
Cool.

01:01:46.200 --> 01:01:47.200
Good work on this project.

01:01:47.200 --> 01:01:49.200
You guys, it, it's pretty amazing.

01:01:49.200 --> 01:01:55.200
And, and the explanation, thing, Aaron, you had me pull out.

01:01:55.200 --> 01:01:57.200
That's really cool.

01:01:57.200 --> 01:02:01.200
How much it will say, these are the algorithms we applied and, and here's the little lesson

01:02:01.200 --> 01:02:05.200
to take from, like why this makes sense here and so on that.

01:02:05.200 --> 01:02:09.200
That's a way better than just some sort of numerical integral.

01:02:09.200 --> 01:02:13.200
Like you gave me this function and it's 7.2 is the answer.

01:02:13.200 --> 01:02:14.200
Like, well, great.

01:02:14.200 --> 01:02:15.200
But what do I do with that?

01:02:15.200 --> 01:02:16.200
Right.

01:02:16.200 --> 01:02:17.200
Yeah.

01:02:17.200 --> 01:02:18.200
Yeah.

01:02:18.200 --> 01:02:20.200
So maybe people, people could use it as a teaching tool.

01:02:20.200 --> 01:02:21.200
Assuming.

01:02:21.200 --> 01:02:22.200
Yeah.

01:02:22.200 --> 01:02:23.200
There are people who use it in the classroom.

01:02:23.200 --> 01:02:24.200
Definitely.

01:02:24.200 --> 01:02:25.200
Sure.

01:02:25.200 --> 01:02:26.200
Yeah.

01:02:26.200 --> 01:02:27.200
Yeah.

01:02:27.200 --> 01:02:31.200
Well, before we're done, let me ask you both the final two questions briefly.

01:02:31.200 --> 01:02:37.200
If you've got some kind of notable package, maybe it's not the most popular thing, but you,

01:02:37.200 --> 01:02:39.200
you know, some Python package that's awesome.

01:02:39.200 --> 01:02:40.200
That needs a shout out.

01:02:40.200 --> 01:02:45.200
There probably are a lot on this page already and you've already given some, but anything you

01:02:45.200 --> 01:02:47.200
want to just, call out real quick.

01:02:47.200 --> 01:02:54.200
well, so perhaps unrelated to Senpai, a little bit, but,

01:02:54.200 --> 01:02:55.200
It can be unrelated, anything.

01:02:55.200 --> 01:02:56.200
Yeah.

01:02:56.200 --> 01:03:04.200
well, I, I, I'd have to say one of my favorite packages that I use, is this

01:03:04.200 --> 01:03:05.200
testing library called hypothesis.

01:03:05.200 --> 01:03:06.200
Yeah.

01:03:06.200 --> 01:03:09.200
I'd actually like to, to make use of it in Senpai.

01:03:09.200 --> 01:03:15.200
We aren't using it right now, but, I'd like to, but, if you haven't used it before

01:03:15.200 --> 01:03:20.200
the, the idea, it's sort of, it sort of flips the idea of, of how you do tests on its

01:03:20.200 --> 01:03:21.200
head a little bit.

01:03:21.200 --> 01:03:25.200
instead of, instead of sort of coming up with a bunch of examples and sort of testing

01:03:25.200 --> 01:03:30.200
that they, your function, you know, does the right thing on, on the, on different inputs,

01:03:30.200 --> 01:03:32.200
you just sort of tell it what your function should do.

01:03:32.200 --> 01:03:36.200
And then it takes care of the job of, of generating examples.

01:03:36.200 --> 01:03:41.200
And the end result is that you, you end up testing a lot more of your code than you would

01:03:41.200 --> 01:03:43.200
with a normal test.

01:03:43.200 --> 01:03:47.200
And you get, you end up with much more robust code as a result.

01:03:47.200 --> 01:03:48.200
So I recommend checking it out.

01:03:48.200 --> 01:03:49.200
It's called hypothesis.

01:03:49.200 --> 01:03:51.200
I don't know if you've had hypothesis on this.

01:03:51.200 --> 01:03:54.200
I have, it's been quite a while.

01:03:54.200 --> 01:03:58.200
It's been three or four years at least, but yeah, it's, it's a very neat project.

01:03:58.200 --> 01:04:00.200
And I'm glad to see it's still going strong.

01:04:00.200 --> 01:04:01.200
I hear a lot about it.

01:04:01.200 --> 01:04:02.200
Andre.

01:04:02.200 --> 01:04:06.200
Oh, I was going to say, do you want a Python package or any package?

01:04:06.200 --> 01:04:07.200
Python.

01:04:07.200 --> 01:04:09.200
If you got one, if not, we can fall back to any.

01:04:09.200 --> 01:04:12.200
yeah, I was going to actually have both of these also.

01:04:12.200 --> 01:04:15.200
I also discovered it kind of actually relatively recently.

01:04:15.200 --> 01:04:17.200
yeah.

01:04:17.200 --> 01:04:18.200
Yeah.

01:04:18.200 --> 01:04:19.200
I recommend people to check it out.

01:04:19.200 --> 01:04:20.200
Which one?

01:04:20.200 --> 01:04:21.200
Sorry.

01:04:21.200 --> 01:04:22.200
Oh, the hypothesis.

01:04:22.200 --> 01:04:23.200
Oh yeah.

01:04:23.200 --> 01:04:24.200
Uh huh.

01:04:24.200 --> 01:04:25.200
Sure.

01:04:25.200 --> 01:04:27.200
And I did talk about it way back in the day.

01:04:27.200 --> 01:04:32.200
This is 2016 had a David McIver on to talk about it.

01:04:32.200 --> 01:04:33.200
So that was cool.

01:04:33.200 --> 01:04:34.200
All right.

01:04:34.200 --> 01:04:35.200
And then final question.

01:04:35.200 --> 01:04:40.200
If you're going to write some code, some Python code, what editor do you use?

01:04:40.200 --> 01:04:42.200
I use Emacs.

01:04:42.200 --> 01:04:43.200
Emacs right on.

01:04:43.200 --> 01:04:44.200
And I use Wim.

01:04:44.200 --> 01:04:46.200
Oh, and you guys still get along.

01:04:46.200 --> 01:04:47.200
Yeah.

01:04:47.200 --> 01:04:48.200
Of course.

01:04:48.200 --> 01:04:49.200
No, just teasing.

01:04:49.200 --> 01:04:50.200
That's awesome.

01:04:50.200 --> 01:04:51.200
All right.

01:04:51.200 --> 01:04:53.200
Well, thanks so much for being here.

01:04:53.200 --> 01:04:54.200
You know, final call to action.

01:04:54.200 --> 01:04:56.200
People are excited to get started with Senpai.

01:04:56.200 --> 01:04:57.200
Like what do they do?

01:04:57.200 --> 01:04:58.200
How do they get started?

01:04:58.200 --> 01:04:59.200
Where do they go?

01:04:59.200 --> 01:05:06.200
well, so the easiest way is, if you go to Senpai.org, like you said, like,

01:05:06.200 --> 01:05:08.200
uh, you said, you can try it online.

01:05:08.200 --> 01:05:12.200
there's also a link there to, to download it.

01:05:12.200 --> 01:05:13.200
yeah.

01:05:13.200 --> 01:05:15.200
Otherwise, you know, I would say, if you're going to go to Senpai.

01:05:15.200 --> 01:05:20.200
you know, you can, if you really want to get dive in, you can join our mailing list,

01:05:20.200 --> 01:05:23.200
uh, or, you can follow us on Twitter.

01:05:23.200 --> 01:05:29.200
We're at Senpai and, yeah, it, the, basically the easiest way to get it.

01:05:29.200 --> 01:05:33.200
Is it just pip install Senpai or condo install Senpai and you'll have it.

01:05:33.200 --> 01:05:34.200
Nice.

01:05:34.200 --> 01:05:35.200
Andre.

01:05:35.200 --> 01:05:36.200
Yeah.

01:05:36.200 --> 01:05:37.200
That's a,

01:05:37.200 --> 01:05:38.200
or simengine.org.

01:05:38.200 --> 01:05:40.200
You can like, you like the plus plus version.

01:05:40.200 --> 01:05:41.200
Nice.

01:05:41.200 --> 01:05:42.200
And you have the tutorials that I highlighted.

01:05:42.200 --> 01:05:46.200
I'll link in the show notes so that you can go through on Senpai.org as well.

01:05:46.200 --> 01:05:47.200
Fantastic.

01:05:47.200 --> 01:05:48.200
Really nice work.

01:05:48.200 --> 01:05:53.200
I love to see you bringing this to all the developers and data scientists and stuff.

01:05:53.200 --> 01:05:56.200
So thanks for being here and sharing Senpai.

01:05:56.200 --> 01:05:57.200
No, thank you for having us.

01:05:57.200 --> 01:05:58.200
You bet.

01:05:58.200 --> 01:05:58.200
Yeah.

01:05:58.200 --> 01:05:59.200
Thank you so much.

01:05:59.200 --> 01:06:00.200
Thank you.

01:06:00.200 --> 01:06:03.200
This has been another episode of Talk Python To Me.

01:06:03.200 --> 01:06:05.200
Thank you to our sponsors.

01:06:05.200 --> 01:06:06.200
Be sure to check out what they're offering.

01:06:06.200 --> 01:06:08.200
It really helps support the show.

01:06:08.200 --> 01:06:10.200
Starting a business is hard.

01:06:10.200 --> 01:06:16.200
Microsoft for startups founders hub provides all founders at any stage with free resources

01:06:16.200 --> 01:06:19.200
and connections to solve startup challenges.

01:06:19.200 --> 01:06:23.200
Apply for free today at talk python.fm/foundershub.

01:06:23.200 --> 01:06:26.200
Take some stress out of your life.

01:06:26.200 --> 01:06:31.200
Get notified immediately about errors and performance issues in your web or mobile applications with

01:06:31.200 --> 01:06:32.200
Sentry.

01:06:32.200 --> 01:06:37.200
Just visit talkpython.fm/sentry and get started for free.

01:06:37.200 --> 01:06:40.200
And be sure to use the promo code talkpython, all one word.

01:06:40.200 --> 01:06:42.200
Want to level up your Python?

01:06:42.200 --> 01:06:46.200
We have one of the largest catalogs of Python video courses over at Talk Python.

01:06:46.200 --> 01:06:51.200
Our content ranges from true beginners to deeply advanced topics like memory and async.

01:06:51.200 --> 01:06:54.200
And best of all, there's not a subscription in sight.

01:06:54.200 --> 01:06:57.200
Check it out for yourself at training.talkpython.fm.

01:06:57.200 --> 01:06:59.200
Be sure to subscribe to the show.

01:06:59.200 --> 01:07:02.200
Open your favorite podcast app and search for Python.

01:07:02.200 --> 01:07:03.200
We should be right at the top.

01:07:03.200 --> 01:07:09.200
You can also find the iTunes feed at /itunes, the Google Play feed at /play, and the direct

01:07:09.200 --> 01:07:13.200
RSS feed at /rss on talkpython.fm.

01:07:13.200 --> 01:07:16.200
We're live streaming most of our recordings these days.

01:07:16.200 --> 01:07:19.200
If you want to be part of the show and have your comments featured on the air, be sure

01:07:19.200 --> 01:07:23.200
to subscribe to our YouTube channel at talkpython.fm/youtube.

01:07:23.200 --> 01:07:26.200
This is your host, Michael Kennedy.

01:07:26.200 --> 01:07:27.200
Thanks so much for listening.

01:07:27.200 --> 01:07:28.200
I really appreciate it.

01:07:28.200 --> 01:07:30.200
Now get out there and write some Python code.

01:07:30.200 --> 01:07:31.200
We'll see you next time.

01:07:31.200 --> 01:07:31.200
Bye.

01:07:31.200 --> 01:07:31.200
Bye.

01:07:31.200 --> 01:07:32.200
Bye.

01:07:32.200 --> 01:07:32.200
Bye.

01:07:32.200 --> 01:07:33.200
Bye.

01:07:33.200 --> 01:07:33.200
Bye.

01:07:33.200 --> 01:07:34.200
Bye.

01:07:34.200 --> 01:07:35.200
Bye.

01:07:35.200 --> 01:07:36.200
Bye.

01:07:36.200 --> 01:07:37.200
Bye.

01:07:37.200 --> 01:07:38.200
Bye.

01:07:38.200 --> 01:07:39.200
Bye.

01:07:39.200 --> 01:07:40.200
Bye.

01:07:40.200 --> 01:07:41.200
Bye.

01:07:41.200 --> 01:07:42.200
Bye.

01:07:42.200 --> 01:07:43.200
Bye.

01:07:43.200 --> 01:07:44.200
Bye.

01:07:44.200 --> 01:07:45.200
Bye.

01:07:45.200 --> 01:07:45.200
Bye.

01:07:45.200 --> 01:07:46.200
Bye.

01:07:46.200 --> 01:07:47.200
Bye.

01:07:47.200 --> 01:07:47.700
you

01:07:47.700 --> 01:07:48.200
you

01:07:48.200 --> 01:07:48.700
you

01:07:48.700 --> 01:07:50.700
Thank you.

01:07:50.700 --> 01:08:20.680
Thank you.

