Do you have a scientific system that needs optimization or solving?
Our guest on this episode, Clark Petrie, is here to tell us all about Pyomo.
This is a library that can solve all sorts of cool problems,
linear programming, nonlinear equations, and many other things that you can throw at it.
We're going to solve a really fun diet problem.
What is the most nutritious meal that you can eat for the least amount of money?
The answer might surprise you a little bit. It's going to be a lot of fun.
So listen in to hear about how Clark has used Pyomo to do his work
and how you might use it in yours.
This is Talk Python to Me, episode 291, recorded October 1st, 2020.
Welcome to Talk Python to Me, a weekly podcast on Python,
the language, the libraries, the ecosystem, and the personalities.
This is your host, Michael Kennedy.
Follow me on Twitter where I'm @mkennedy,
and keep up with the show and listen to past episodes at talkpython.fm
and follow the show on Twitter via at Talk Python.
This episode is brought to you by Linode and Talk Python Training.
Please check out the offers during their segments.
It really helps support the show.
Hey everyone, two quick announcements before we jump into the show.
Number one, I really appreciate everything that many of you are doing to support us here at Talk Python
and make it possible for this to be my full-time job.
Our primary means of support is through the courses over at Talk Python Training,
and I've been thinking about how I can offer you something special in return.
What I've come up with is something I'm calling Talk Python to Me Pro Edition.
It's like regular Talk Python, but it comes with two perks.
It is ad-free so you can listen without any interruptions,
and you'll have the entire history going back five years to episode zero in your podcast player.
Talk Python To Me Pro is available exclusively to listeners who have an everything bundle over at Talk Python Training.
If this sounds like something you want, learn more at talkpython.fm/pro.
And if you already have a course bundle, just visit that link for details on how to add the Pro Edition to your podcast player.
Announcement number two, somewhat related to Talk Python Pro,
Black Friday is just around the corner if you're listening to this episode right when it comes out.
We'll be offering major discounts on our brand new FastAPI course
and on our everything course bundle over at Talk Python Training for just four days.
So visit talkpython.fm/Black Friday to get notified when the deals go live.
Thanks so much for your support.
Even if you're just listening, it really means a lot.
Thank you.
Now, let's optimize some things with Python.
Clark, welcome to Talk Python to Me.
All right.
Thank you, Michael.
I'm happy to be here.
Yeah, I'm happy to have you here.
And we're going to talk about operational resilience and using a package called Pyomo,
which is about solving all these constraint problems,
which brings me back to my math roots, right?
Like I didn't do that much applied math,
but I definitely studied a ton of math before I got deep into programming.
So it'll be a fun journey, I think.
Happy to have you.
Yeah, this is a lot of fun for me.
I've been a fan of the show for a while,
and it's kind of surreal to be sitting here talking to you right now.
So this is exciting and fun,
and I'm happy to spread the joy of Pyomo to the audience.
Yeah, and honestly, I had not heard of Pyomo.
I obviously know about some of these like solver type systems and the general concept,
but I've never used Pyomo and it looks really cool.
We have a really fun and slightly comedic,
but honestly serious example to go through as well to give people a sense of like the kinds of problems we're solving.
But, you know, that's not where we start the show, right?
We start with your story.
So let's start there.
How did you get into programming and Python?
I mean, I took a really roundabout way to get there.
Just for, I guess, audience context, I was born in 81 and grew up in rural Northern California,
kind of one of the few tech nerds in a one-stop-light town.
I mean, there was literally a girl that rode a horse to school.
I'm not even joking about that.
No way.
That's crazy.
Yeah.
We had these like ag fields out back,
and she would sometimes ride her horse to school and just put the horse out to pasture during the day.
That's actually really cool.
It was neat for her.
I was not into that, but like, especially looking back now, I can go, that's pretty legit.
Yeah.
But, you know, like I said, I was one of the few tech nerd kids, and I remember the early days of AOL,
and I was actually making money as like a sophomore making web pages for local businesses.
Okay.
Yeah.
I guess the HTML that I did all by hand back then,
you could say it was my first experience programming, so to speak.
I did a little bit of IRC bot coding.
I loved trying to make what we now think of as like a chat bot,
but I'd had some foresight.
I could tell there was a future in that, but it was just for me, it was a toy, and I love that stuff.
But it was just me and a single mom predominantly who, despite her best efforts,
didn't really know how to guide me to college.
So I kind of stumbled into joining the military, specifically the Navy, right after high school in 99.
Fast forward to actually get to answering your question.
They cultivated my potential.
I eventually got commissioned as an officer, and in 2015, I got sent to the Naval Postgraduate School
for the Operations Research Curriculum, which...
That sounds really cool.
I often will colloquially...
Yeah, it was a great opportunity.
I mean, I got paid to go to grad school, so I can't...
I'm like the luckiest guy around, which for someone that hasn't heard of OR,
a lot of us will just kind of cheat and just call it applied mathematics,
compared to...
I hope I'm not offending any actual math masters out there.
But from looking at the curriculum, you know, we just kind of drop a few math classes,
add in a few programming classes, which, to answer your question, in the first quarter,
we took a Python course.
And I just...
I kind of fell in love and quickly realized that was the main technical tool I wanted to
cultivate for my time in school, and also what I wanted to really use in whatever thesis
I ultimately ended up doing.
And here we are now.
Yeah, here you are.
You've done your thesis with Pyomo and Python, and we're going to talk about it.
That'd be great.
Yeah.
So it's never too late to learn to code.
I mean, heck, I was...
Yeah.
...35.
Yeah.
And when I started that, so...
Well, I wasn't quite that far along, but I hear a lot of stories from people like,
oh, I started that when I was four.
Like, as soon as I could sort of kind of read, I was on the computer and whatnot.
And for me, it wasn't that way at all.
It was basically grad school, almost grad school, senior year of college, doing research projects,
going to actually need some programming skills to start answering these questions.
But once I got into it, it was like, why have I been studying this other stuff?
This is way more fun.
How do I do more of this?
And less of what, I'm actually getting my degree in.
That was a bit of a problem, but it worked out in the end, I suppose.
Yeah.
I did similar stuff where I kind of juggled around electives to take more programming classes
while I was there because I was enjoying it so much.
I kind of put off other pain until later, I guess you could say.
Exactly.
So what is operations research?
Like, what kind of problems are being solved there?
Give people a sense of what that means.
So from the military perspective in particular, a lot of it is logistics and optimization.
So in that curriculum, there's kind of three main tracks people tend to fall down.
One is the optimization track.
You could say that's where I went.
Another is more of a just data analysis track, a lot of regression analysis.
And the third would be simulations.
And I guess you could say just trying to drive answers through some kind of simulation theory.
So within operations research, we're looking to find the best way to go about doing something.
So some of those classic computer science problems exist in that domain, I'd say.
You know, the traveling salesman problem is an early one.
Right.
And it's about doing that at scale for...
The Euler Bridge problem.
Yep.
That one.
That seven bridges.
City.
I forgot the name of the city.
Yeah.
You know, we go through some of the classic use cases during World War II with like...
God, like...
I don't know.
It might have been post-World War II, I want to say.
But like looking at the Soviet railway system and how...
What's the minimum cut, right?
To essentially disable their railway system if they were to invade Europe.
Right.
And it's a lot of work in that domain.
Yeah.
Okay.
Pretty interesting.
And I'm still looking forward to the example we're going to get to.
Yeah, I'm so goofy.
And contrast it with the seriousness of these things.
But how about day-to-day?
Like, what are you doing now?
So right now, I'm a senior officer working in the Pentagon as a data analyst.
Let me just really quick.
I got to get the obligatory.
The views and opinions expressed here are mine and mine alone.
They do not represent the U.S. government, the Department of Defense, or the U.S. Navy.
So there we go.
I said it.
We're safe.
This is the world of Piomo, according to Clark, not the U.S.
Okay, got it.
Yeah, got it.
So basically, I work for a three-star admiral, which is pretty darn senior.
And he is in charge of the entire Navy Reserve.
So for kind of civilian context, you could think of that as a multi-billion dollar company with 60,000 people.
Yeah.
Wow, okay.
And he's the CEO, if you will.
And at the Pentagon level, and we have, you know, it's the military, so everything's tiered.
It's very vertical.
And I'm one of his two data guys, basically.
And we have one never-ending project, which is we're always analyzing and forecasting our personnel strength, which is a multivariate problem in and of itself.
We got to look at, as the Navy Reserve, we receive people that leave the active duty Navy, but we also can recruit off the street.
So we get folk that are coming straight into the Navy Reserve, those that are leaving active duty, and we have to try to plan out how many people we're going to have, and do we have the right types of people for all of our different missions across the future years defense program, which is sort of the budgetary outlook.
That's our main job.
But honestly, we probably spend more of our time just digging into random data for whatever the Admiral needs to be educated on, the other senior decision makers in the Pentagon, so they can go forth and move out.
COVID was a big example of that.
It's funny.
You have the world shut down with COVID, and literally the Joint Chiefs of Staff are coming to us wanting answers now, like right now, right?
Yeah.
You got to tell us this.
So, yeah.
So it was me and my counterpart who got really smart on a pretty thorough analysis and built a unified data project to answer anything about Navy Reserve medicine, because we have doctors and nurses and critical care and all that in the Navy Reserve.
So how many do we have, and if we pull them to go to New York, are we pulling them from a hospital in another hot spot in their civilian life because they're a reservist?
And so that's answering questions like that as a recent example, you could say, is what I do.
Okay.
Yeah.
Two things I want to talk about.
One is we saw the nightmare that was the cruise ship industry, right?
Yes.
And I think there's still people around the world who are still stuck on these cruise ships, right?
Like not cruisers, right?
They were taken and put somewhere.
I remember, like, I guess it varied where you were, but people who worked on the cruise ships.
I think there's still a ton of them stuck there.
And that's just insane.
And yet, I used to live in Coronado, California, a little island outside of San Diego for a little bit.
And there was two of the main aircraft carrier station there.
I know that pier very, very well.
It's a beautiful place.
But the reason I bring that up is literally the traffic would change.
The traffic patterns would change how much traffic there was and whether or not the aircraft carriers were home or they were gone.
Because there are so many, there's like 5,000 people on an aircraft carrier, something like that.
Yeah.
If the, so this is, you're getting really into my wheelhouse.
My first 10 years as an officer, I was one of the nuclear engineers for aircraft carrier reactor plants.
Oh, wow.
Okay.
Which is why I had the technical aptitude to do the ops research program for like eligibility.
And yeah, if the carrier has the air wing embarked, you're looking at 5,000 or 6,000 people.
Yeah.
And when the air wing, all the planes and everything associated there is not there, you're talking about 3,000.
Either way, whether a carrier is important or not changes the quality of life for a commuter for sure.
Yeah.
I mean, it would change.
It would dramatically change.
So why do I bring that up?
Well, you guys got these, I mean, that's the same size as a cruise ship or bigger and you've got all these people on there.
And that's a huge challenge.
I mean, how did you all deal with that?
What was even the outcome?
I know that there was a commander of one of those carriers that was lost his job basically.
Because he spoke out about like, this is a serious problem.
He was very upset and kind of went above rank or pulled rank or something like that, right?
Yeah.
I mean, I can't really like, I wasn't there, right?
But I can only report what I kind of saw in the news.
I don't have much insider information, if you will.
But we take rank and reporting at the chain very seriously.
And I feel for that gentleman.
My job before this was as a commanding officer.
And he was facing incredibly tough decisions.
And it's just, the whole thing's unfortunate.
But as far as what you're getting at with like the cruise ships that are dealing with such rampant COVID problems,
yeah, that's really tough.
Because on a ship, where are you going to go, right?
Yeah.
But one way that I think we haven't been as decimated is the wrong word,
but maybe negatively impacted with our ships,
partially because generally, most of the sailors on ships,
and the average age of a Navy sailor is like 21 years old.
We're talking pretty healthy people.
Which is probably not the same age as the average cruiser.
I do love a good time on a cruise ship.
But if I need to feel young, I can also do that, right?
Yeah, right.
So I think there's probably some degree of extra resilience, I would think,
amongst our personnel on ships that has probably helped mitigate the problem.
And I'll tell you this.
We have also had, we're the military, right?
And we need to be ready.
The restrictions in place on us for doing things that would possibly increase your risk profile are pretty strict.
Yeah.
Like, even though I'm in Northern Virginia, you know, my wife can, she could go out and go eat and hug everyone she wants to hug.
But like, if I were to go, I'll give you an example.
One of my big personal hobbies outside of nerd stuff is I'm a big Brazilian jujitsu guy, which is really mean wrestling, if you will.
Yeah.
It's cool, but it's also kind of up close with other people.
Yeah.
There's no way to socially distance when you're rolling around with people, right?
And if I were to go do that and get COVID, technically speaking, I would have disobeyed like a direct order.
Right.
You know, and I'm senior enough that I probably wouldn't get like in real trouble, if you will.
But I know, like, I'm a good boy.
So.
Yeah.
The restrictions in place like that are probably protecting our people more.
Sure.
Well, and also just like what you do on a cruise ship, like you go from port to port and you go out and experience those places.
Whereas you can say, you know what?
We're not going to go into port and you guys don't go anywhere.
You stay here.
Which is a different kind of experience, I guess.
Yeah.
No more pulling into Hong Kong and going wild, I suppose.
It's probably restricted liberty when the ships do pull in.
Yeah, exactly.
But I'm a desk jockey now.
My ship going days are way behind me.
This portion of Talk Python to me is sponsored by Linode.
Simplify your infrastructure and cut your cloud bills in half with Linode's Linux virtual machines.
Develop, deploy, and scale your modern applications faster and easier.
Whether you're developing a personal project or managing large workloads,
you deserve simple, affordable, and accessible cloud computing solutions.
As listeners of Talk Python to me, you'll get a $100 free credit.
You can find all the details at talkpython.fm/Linode.
Linode has data centers around the world with the same simple and consistent pricing, regardless of location.
Just choose the data center that's nearest to your users.
You'll also receive 24-7, 365 human support with no tiers or handoffs, regardless of your plan size.
You can choose shared and dedicated compute instances, or you can use your $100 in credit on S3 compatible object storage,
managed Kubernetes clusters, and more.
If it runs on Linux, it runs on Linode.
Visit talkpython.fm/Linode or click the link in your show notes,
then click that create free account button to get started.
Got your land legs back.
Okay, so let's talk a little bit about, let me just ask you about Python and the government,
our programming and the government.
I did 10 years of in-person training, and much of that was at places that were like HP or JP Morgan or something like that.
But periodically, we teach classes at military places.
And they were a little bit different, right?
Like I did a class for the people that ran the launch control for NASA.
I think they were technically Air Force, but still, that was pretty cool.
And someone at Edwards Air Force Base.
And I talked about like, oh, yeah, you just pip install this thing.
And you get like, look at this amazing package that are like, that's really awesome.
We're never, ever going to be able to do that.
You can't just install stuff off the internet.
So tell us what programming in this world feels like.
So that's the tough part, right?
Is anyone listening to this show probably knows what Python's capable of.
And we're all here because we love it, right?
It's a great language.
And then there's the government limitations that you just got to.
So there's a group in the Pentagon called N81 that doesn't really mean anything.
But they're kind of some of our researchers on the Navy side.
And a lot of ops research guys and a lot of coders.
We do in some cases have standalone machines that are able to touch the outside world.
But they're just not plugged into like our broader, just unclassified internet,
which is called NMCI for Navy Marine Corps internet.
Now, some of those N81 folk allegedly treading a little bit of dangerous water, maybe,
maybe found a way to kind of get Python working on their machines, but to try to do work.
But again, what you got to a truth, which is, oh, you go, you need some package.
You can't just pip install it.
Again, allegedly, it might be the case that you have to download the wheel.whl files.
Whl, yeah.
Yeah, yeah.
You have to download the wheel files.
I call them wheel files.
I don't actually know what the...
Yeah, yeah.
Yeah.
Yeah, you have to download those manually and install them.
But of course, if one package needs like subservient packages, you have to like backtrack, right?
Until you have what you need to then get Python running.
But even if you go through that heartache, you now are facing another conundrum, which is you have Python running, yay, on your government computer, which because we're so big and we try to standardize everything.
And for good reason, there's a lot of background processes running to keep machines up to date and to monitor activity and such.
A core i5 with 8 gigs of RAM that is, you know, permanently got 80% of that used isn't exactly the like analytical monster you might want.
Right, right.
And so...
And it's trying to decrypt the drive and run the three different virus scanners and then the network monitor.
It's like at a permanent 60% CV usage before you touch it, right?
Yeah, exactly.
You know too well.
So that's the hard part is someone like me, I'm always beating the drum.
My last boss when I was a commanding officer probably got tired of me beating the drum about, you know, if we can improve the technology that our sailors have, we'll be so much more efficient.
Yeah.
And that's one of our limitations.
And I understand and get the complexities of that problem.
It's not easy.
It's not, oh, you just got hired with insert tech company here.
Here's your new MacBook.
You can't do that with us.
Yeah, exactly.
But that's sort of the challenge.
Now, what's sort of interesting is COVID has changed a lot of that.
It's changed it for, I think, for banks and for all sorts of industries that were like, we can't work from home.
You can't access this from your home.
But you guys are kind of the far end of that spectrum.
Well, yes, comma.
I've actually been working from home for six months, which has allowed me to, with data that is not sensitive, obviously, the main thing that I would be dealing with would be personally identifiable information.
Now, that's on my machine.
I keep a good delineation.
But a lot, the main data sources I tend to work with don't have that anyway.
So I've been able to move a lot of my analytical work to my personal computer, which I'm a nerd.
It's a good machine, right?
So that has sort of supercharged me with what I've been able to do as an analyst in this work from home environment, which has, at least in my case, but I can just kind of sense that across the broader structure of the military, the higher ups are realizing, oh, wow.
Our people are more effective in a lot of cases, and they're happier?
What?
You know?
Yeah, exactly.
Wait a minute.
And we have this big fancy building we can go to, but they don't want to go to it anymore.
Like, it's, yeah, it's a really interesting paradox.
And what's silly about that is, for anyone listening out there that's doing data work, I work in a secure space.
So I can't have my cell phone.
And I'm not missing it because I want to play a game.
I can't have a podcast going.
Yeah.
I can't have music going, right?
And just that change alone, just to put on something when I got to really focus on a data problem and just get some kind of good techno trance going, if you will, in the classic coder.
Yeah, just have the distractions, right?
Yeah, it helps.
So COVID's changed a lot of that for us.
And I can just tell, I think, like the whole world at large, we're just a microcosm of it.
We're never going to go back to normal, whatever that was.
Yeah.
We're permanently going to be.
So what about, like, things that allow whitelisted packages?
To be vetted and then like local PyPI server type of things.
Is that something you guys have looked at or maybe you will be looking at?
Yeah, there is some of that happening.
So government is headed in that direction.
The senior people, they get it.
I mean, it isn't like they don't know, right?
Yeah.
And they can recognize that we, from my point of view anyway, maybe a little bit behind, just a little bit behind our civilian peers and know they need to bring that stuff online.
And we're starting to develop some of that.
I know some of my counterparts in my office, you know, working for the Admiral of the Navy Reserve, they're helping.
They're involved with the process to develop what we're calling the authoritative data environment, which is going to be sort of a, what's the name for when you have like a kind of a machine and a machine?
I'm blanking right now.
Like a virtual machine?
Yeah, yeah, a virtual machine.
I was just blanking.
It's basically a virtual environment that you can like remote into.
And then you're going to have the full suite of packages.
And presumably someone would have white listed all the Python packages you could want, right?
So we're trying to get there.
It's just, we got to get there while navigating the limitations of our government requirements, which, you know, many of which are in congressional law, right?
So it's not like that's an easy thing to change and update.
It's not like there's just a picky manager.
No, no, no, no, no, no.
So that's where we're headed.
So another thing, I don't want to go too far down the strad hole, but it is interesting to me.
So let me ask another question.
So have you guys looked at things like VS Code has the ability to just like run in the browser and execute code and say like a Docker environment in Azure or other places where if you just have access to the internet, you basically have unbounded compute.
Have you looked at those types of setups or even creating like isolated something like that internally, but then setting up those kinds of servers?
There is something like that.
And it actually shows you how much in demand it would be.
When that initially got set up, I'm blanking on the name.
I haven't tried to use it for almost a year.
The demand.
It was overwhelmed and just killed it.
Yeah.
Demand from people like me was so significant.
It just vomited and died.
And it was really hard to use.
And then the other problem is we don't exactly have the fastest pipe up and down to do work like that.
So you're going to be working in a high latency environment oftentimes, which can make the experience more challenging.
But there are setups.
I know the Air Force has one that's pretty robust.
Okay.
I think that's kind of ironic given that our ARPANET and DARPA and all that stuff sort of created the internet.
Yeah, right.
And I know people hear I'm in the Pentagon.
They picture some kind of like Jason Bourne control room.
Right.
And those places exist in the Pentagon.
I'm not in it.
Yeah.
But.
Exactly.
Yeah.
Cool.
All right.
So another thing I want to kind of touch on is you wrote an interesting article that actually touched on an episode with Jacqueline and Emily about the different branches or pot.
Like when you say I'm a data scientist or I have a career in data science or data engineering, like that actually can mean a whole bunch of different stuff and really interesting ways to kind of map out that world.
You want to talk about that just a little bit?
Sure.
Yeah.
I mean, I have a blog that's for me.
I don't.
I haven't even done like good SEO on it for that matter.
But that episode was 262 with Jacqueline and Emily.
You know, they described different kind of fictitious companies.
And one of them, when they got to this is a large company, probably a lot of government contracting.
Maybe it is government.
You know, my ears perk up.
Right.
Maybe it's Boeing.
Maybe it's even the Pentagon.
Okay.
Right.
And then they perfectly describe some of these challenges we just discussed, which is, wow, you don't have access to the tools you want.
But then they really go down the analyst role, which is certainly what I consider myself.
I'm technically trained.
I have technical skills.
But especially at my level, they were so eloquent in how they described it.
I'm the one who, almost by virtue of my education, when I speak to numbers, it's gospel, if you will.
And then that's an important trust, right?
My admiral trusts me that I'm right.
And I can never betray that.
So I'm the one that's kind of in the boardroom, if you will, showing the CEO the charts and breaking down what's what for them, as opposed to the real data engineer in the trenches.
Right.
Like deploying a machine learning model to production over like a FastAPI implementation, right?
Not so much that.
No, no, no, not at all.
I have done some technical stuff with Python in my current role.
And we can talk about that.
But I am more of the, and Jacqueline and Emily talk a lot about, I think they say Excel and PowerPoint.
I'm like, haha, yeah, that's my life.
My PowerPoint skills have become much stronger in the last year of this job than my coding skills.
That is the lingua franca of that whole environment, isn't it?
Yep, absolutely.
I legitimately was joking with my other data buddy, just about what a PowerPoint savant I've become, almost to the point that, like, it's like, oh, you want your slides touched up?
Contact Clark.
So that's a feather.
I remember doing a training course with this group out of the Air Force Academy in Colorado Springs.
And, like, one of the pinnacle moments was when we found a way to dynamically generate one of the slides in PowerPoint.
It was like, it would pull in data from where all the planes were flying.
And it would dynamically, like, in real time or, like, near real time update what would be shown in the PowerPoint.
It wasn't, like, enough to have that on a web page.
It was like, it needs to generate a slide on live data.
Like, why would you do that?
Like, it doesn't matter why.
It has to do this because this is the world we're in, right?
Yep.
We are beholding the PowerPoint for sure.
You know, it's funny we talk about PowerPoint because Tableau is starting to gain traction.
People are realizing the power of a good Tableau dashboard.
And that has, if nothing else, the name Tableau, like, is spoken in whispers in the halls of the Pentagon.
So, you know, maybe we'll get there eventually.
Yeah, that's a bit of a step up.
That's a bit of a step up.
Yep.
But, yeah, anyone who has not listened to episode 262, and I'll link to it, Jacqueline and Emily wrote a,
really good book.
Like, I'm not even that interested in a data science career for myself.
And I'm like, this is like a page turner.
This is really, I think they really broke it down well.
And it, because people ask me, like, oh, I want to get into data science.
What should I do?
What should I study?
I'm like, that's not enough.
I don't know enough to answer your question necessarily, because that means kind of different things.
So, I recommend people check that out.
It's a good one.
Yeah, definitely.
I mean, for me, that episode gave me, like, validity.
I'm kind of the king of imposter syndrome.
And I heard that.
I was like, oh, like, they describe a legitimate, valuable role that I'm kind of well-suited to.
Sweet.
You know?
That's awesome.
That's all right.
Well, because you might compare yourself against, like, the machine learning people deploying
machine learning models at Google.
You're like, well, I can't do any of that.
Like, all of that is foreign to me, right?
But that doesn't mean you're not doing valid data science.
Like, you're just doing, like, a different slice of it.
Yeah, absolutely.
And it's important to have someone that can speak to it and translate it into the common
vernacular, if you will.
And I think that's kind of where I've found myself.
Yeah.
And hearing them talk about that gave me hope, because whenever I retire from the service in
a couple of years, potentially, like, okay, cool.
There are roles in the outside world.
Some kind of weird military Stockholm syndrome.
I know that there are.
Yeah.
I suspect that a lot of the stuff that you work on, you can't really share or talk about
a bunch.
And so it doesn't give you that chance to kind of put it side by side with other people.
Let's talk about your thesis and this optimization stuff for the Python library, Pyomo.
Sure.
So you said you did your work at Los Alamos National Labs.
Is that right?
Yeah.
So I can back that up a little bit.
Professor David Alderson, who's one of my thesis advisors, he's the head of the postgraduate
schools, Center for Infrastructure Defense.
I want to make sure.
Yeah.
Center for Infrastructure Defense.
Making sure that the power grid doesn't go down and that the internet stays on and things
like that.
Yeah, absolutely.
It's a power, water.
And then that goes two ways, right?
From a military context, it's about protecting our stuff in a potential theater of war, whether
we're setting up a forward operating base in theater, as we would say, or domestically.
But at the same time, if we know how to protect our stuff and are smart on that, we also know
how to take out the enemy stuff better.
Yeah.
And so it works both ways from a military context.
So he's the head of that center.
And I got hooked up with him mainly because he taught one of the more advanced coding courses
I took while I was there.
And again, loving the language, coming back to how we started.
And he was working in conjunction with researchers at Los Alamos National Labs, which is how I got
hooked up with them.
Okay.
So which was a good opportunity.
I got sent out there for several weeks to just be in that environment, learn, and kind
of get hands-on with some other data, which I was able to bring back for my thesis, which
then Paloma became kind of the cornerstone of it.
Yeah.
What was your thesis about?
Yeah.
So it was assessing the operational resilience of electrical distribution systems.
Yeah.
Okay.
At the time, anyway, transmission, you know, think the big power towers that you see when you're
in the middle of a highway somewhere that's the transmission lines.
Those are really well understood.
The white and orange ones that are really high.
Yeah.
Those ones, right?
Okay.
Yeah.
Those are really well understood and modeled as we understood.
But distribution, like what's in your neighborhood, what's in your town, wasn't.
And obviously, distribution works great.
Right.
But from our awareness, no one had really built a model using real world data, taking
into account all of the mathematics for three phase AC transmission.
That's kind of where some of my nuclear engineering background helped because I was cursorily familiar
with that stuff.
Yeah.
I mean, that's basically a power plant as well, right?
Yeah.
Power plant and all the distribution, right?
So I was familiar with concepts like real and reactive power.
No one had built a model that took in real world data.
And what we could basically do is say, hey, if we take out this electrical pole or that transformer,
what will unequivocally happen?
Most analysis had been based.
It was essentially data analysis and regressions where you look at a disaster that happened,
maybe a tornado touchdown in Oklahoma, right?
Okay.
We know that the tornado did damage here, here, and here.
Okay.
We understand the results of that.
Now we can apply those results and think we'll know what will happen somewhere else.
But we built a model that will allow us to unequivocally state what would happen.
Yeah.
Okay.
And so the optimization part of that was working with the distribution system.
We kind of made an assumption, if you will, that we want to minimize how much load, real
and reactive power load, is lost if you take out a telephone pole or something, right?
So in the end, the grid wants to keep power going everywhere the power is being asked for.
So what we're trying to do is minimize the amount of power lost when you essentially mess with
the network.
Right.
Okay.
I grew up in Kansas City.
Tornado Alley is sometime called.
We ran experiments like that all the time of what happens if we take out this block of
thing or whatever.
But yeah, not in that clear sense, right?
Like stuff would just get blown over and see the little capacitors, whatever, it's explode,
whatever those gray cylindrical things that are on the towers.
Yeah.
Or the poles.
Yeah.
All right.
So use this library, Pyomo.
Tell us about that.
Yeah.
So what the library does, like we talked about at the beginning, I can't talk to what's
happening behind the package.
Sure.
But it allows us to set up an optimization framework.
As a consumer of it.
Yeah.
I'm a consumer, right?
So allows us to set up in Python and optimization framework to, I guess, structure these problems.
So we're talking about an objective function.
It can be a multi-objective function.
And then the various constraints to perform linear or nonlinear optimization in whatever
capacity you want to.
So using everything that we love about Python, right?
The relatively straightforward syntax.
And then all the tools beyond that, which made it unique.
We can set up these problems and then throw a solver at it.
Like Cplex is what I used, which to me is a bit of a magic black box, though.
We went into some of the mathematics behind that, obviously, like the simplex method and
all the Danzig's work back in the 40s.
But we throw a simplex at it and then structure in Python how we want our results.
And voila.
In the case of my thesis, we get a detailed printout, if you will, of what loads stayed up, what went
down.
And we can analyze that all within a Python framework.
Yeah.
That's beautiful.
To give people a sense of this, let me maybe go through some of the problems that it solves.
And then like some examples of using it.
Then we'll go through a concrete code example.
And that'll bring it together.
So looking through their docs, some of the things you can do is linear programming.
And I don't know how many people have done linear programming.
It's really simple.
It's not necessarily easy to compute, but it's not like a complicated thing.
But it really, it's incredible the way that that like, this is the exact answer.
Like all these constraints.
Here's the optimization.
I love it because it's simplicity plus power.
Yeah.
What we always talked about linear programming is guaranteed optimality, right?
It's pretty straightforward.
You don't have a local minimum or a local maximum.
That's not the actual answer, right?
Yeah.
Yeah, exactly.
And in some cases, especially with nonlinear problems, you can get stuck in a local minimum
or maximum depending on where you're going.
But generally speaking, if you write a greedy heuristic, you'll get a good answer.
But is it optimal?
Right.
And that's the real sticking point that the professor's there because maybe this comes
back to kind of that military background, but we often will not settle, especially in a war
context, I suppose, for anything that's suboptimal, right?
And that guaranteed optimality.
And I know an example of FedEx, right?
Right.
They gobble up a lot of the ops research graduates out of the Naval Postgraduate School
because their profit margins hinge on optimality with delivery, right?
There's a traveling salesman problem for you, right?
Yeah.
The whole UPS, FedEx delivery stuff, especially with COVID, it's like insane how many of those
guys are driving around.
So we've got linear programming, quadratic programming, nonlinear programming, what it
gets really interesting.
Let's see, stochastic stuff, just junctive programming, which I don't know anything about,
but differential algebraic equations, equilibriums, all these different types of problems.
It can solve those.
And then some of the projects using it that they've listed on their site that I thought
was interesting is the DISPA set, which is unit commitment and dispatch model focused on
balancing and flexibility problems in European power grades.
It seems like it comes back to power a lot, honestly.
Yeah.
I was actually surprised looking through these, seeing how many power problems there were,
which I don't know.
I would not have expected that, but yay.
Yeah.
I didn't either, but yeah, that's cool.
There's another one, which I don't know how to pronounce.
I-D-A-E-S-P-S-A, P-S-E toolkit, which is a open source optimization-based framework for
chemical processes, which is pretty cool.
MinPower, which is an open source toolkit for students and researchers and power systems.
Open energy modeling framework.
Like I said, it's a lot of energy in here, which is a open framework for developing energy
models that emphasize communication and community involvement.
And then OpenAgua, which is a web-based app for modeling water systems for water resource
planning and management.
So I think that gives people a sense of like some of the types of problems this is being
applied to.
Yeah.
And I know those are kind of, those are obviously complex and real world.
I know in a learning context, many of the classic computer science problems, traveling salesman,
the knapsack problem.
If you're familiar with that or for the audience's essay is basically, I have a bag that can hold
20 units of stuff.
And I have a hundred units worth of things I want.
I would love to try to fit in it.
How do I maximize my value by putting in the knapsack?
We would structure problems like those in Pyamo while we were learning the package.
Right.
So some of those classic problems can be solved here.
Yeah.
Cool.
All right.
So on the Pyamo website, they have this dietary problem.
They have a bunch of examples of, here are some examples you said.
Do you want to talk us through this?
It's a little bit hard to talk about code over the air.
So we'll just keep it kind of vague in general, but maybe talk us through this and people go,
okay, I see what this does and how I might use it.
Yeah.
This is a great example, especially, I don't want to spoil it, but it gets a funny result.
So what this diet problem is trying to do, and this is a classic optimization problem,
is you want to select, you have a group of foods and you want to select foods to meet your
nutritional requirements at minimum cost.
And I think nutritional means caloric.
Yeah.
Not necessarily all your vitamins.
And I'm living on the food pyramid, right?
Yeah.
It's a very simple, it's a toy problem, right?
So it's going to be relatively simple.
And any optimization problem that'll probably go into Piamo is going to have either the word
minimize or maximize, right?
So we're trying to meet certain constraints, these caloric requirements while minimizing cost.
Although I am reading, sorry to cut you off, but it does say, and the amount of vitamins,
minerals, fat, sodium, and cholesterol.
So it's not just calories.
So it's a little more nuanced.
Okay.
All right.
Okay.
Yeah.
So what they do is they set up the mathematical formulation outside of code first, which is how you would do any good linear programming.
And so you have a couple sets, right?
You have a set of foods and a set of nutrients.
And then they have a whole bunch of parameters that need to really read, I guess.
But like the cost per serving of a given food, the amount of nutrient J and food I.
So it's A sub IJ.
And then you got minimum level of nutrients.
Right.
Like how much sodium, how much fat and so on.
Yeah.
Yep.
The amount of the food, I guess, mass or volume.
And then how much you can actually consume.
Let's see here.
What else have they got?
This is great.
The number of servings of food to consume.
So how much are you eating of any given food, I guess.
And then, so here's the meat and potatoes of any good LP.
Either you're going to minimize the cost of the food.
So you're minimizing the sum of 4i of the cost times how much you eat of different foods.
Right.
So i is the different foods and it's how much you eat of it times the cost of it.
Right.
So if you're eating $5 milkshakes and you eat two of them, right, you spent 10 bucks.
Right.
We're trying to minimize that cost.
Yeah.
And you've gotten however much goodness out of that.
Yeah.
But you're trying to minimize the price.
So that would be 10 contribution there.
Uh-huh.
Okay.
Go ahead.
So then, but now to frame this, I don't know if this is a little abstract for the audience,
but you can think of a lot of these problems in like a multidimensional framework.
If you just have X and Y axes and going up and Y and to the right, if you will, and X is
both the direction you want to go.
Well, the optimal spot of those two constraints is the top right corner.
Right.
So I don't know if that made sense, but yeah.
So for the constraints, you're going to limit the nutrient consumption for each one.
So you have like a less than set up.
You got to limit the amount of food consumed.
Like you can't just eat like a hundred cheeseburgers and go, we're good.
Yeah.
We're good.
Right.
And then you have a maximum amount of food that I guess your stomach can hold that they
have in here.
Right.
So you can only eat so much of the various foods less than or equal to the maximum amount you
can eat.
And then there's also, and this is important that you'll see this will get forgotten a lot
because it's so stupid, but you have to have a lower bound with optimization problems.
Right.
So they, the amount of food you eat has to be greater than or equal to zero.
Right.
Cause if you don't have that in there, it'll be like, Oh, eat infinite negative food and
you're great.
Right.
It's free.
You can't eat negative milkshakes.
Right.
So.
Exactly.
You get paid to eat it.
So that's sort of the LP setup that they have on this site.
And then they go into the actual pie on formulation where they were always this, they import it.
And then you'll see if someone were to look at this link in the show notes, they, they
define it as an abstract model.
You can do a concrete model, an abstract model.
I'm actually not a little embarrassing.
My, my thesis was concrete.
I'm not super informed on what the difference is between those, but we can move along, I suppose.
And then they just, in their code, they, we define those things.
We had the set of food, right?
That was F.
And so they're going to have, there's an object in Pyamo called model, right?
So model.f is a set.
They set it equal to a set and model.n is the nutrient set.
So model.n equals a set, right?
And those are just, now those are objects in Pyamo's framework in Python that now just
exist for the purpose of these optimization problems.
I've been talking a lot.
You want to run with this?
I don't know.
No, no, go ahead.
Like, you know this better than I do.
So we're getting close to the end.
That's actually not a whole lot more to it.
Yeah.
And then we're going to get to the fun part at the end.
So then they have to define the cost of each food, right?
And this is, as a small aside, this was great about doing this in Python is that you can,
we all know how well Python works with data, right?
So half of my thesis code was just taking the real world electrical grid data that we had
and getting it shaped for use, right?
So they do something similar here where they are looking at the data they have and feeding it in for each food, right?
And then you got to keep track of how much of the stuff you're eating and they have some more code in there.
Yeah.
So you like, you've got this param object.
You say the parameters come out of this, the food set or the nutrition set, the nutrient set.
And then here's, these are positive reels or these are non-negative reels or these are integers.
They can go up to infinity or whatever, right?
Yep.
Yeah.
Thanks for bringing that up.
So yeah.
So you kind of just lay that out really.
I think it's pretty straightforward.
It's good.
These are the constraints.
Yep.
And you have these, bam.
And now, now the model from a mathematical perspective understands what those are, right?
And then the exciting part is they get to where they define the objective function, which as we described is how much does the food cost times how much of that food you eat for a given food.
And then minimizing that.
So they set that up.
And then the same constraints that we discussed a couple minutes ago about, again, the lower bound, not going below zero, the nutrient consumption for each food.
They set up those constraints again in this, their functions that they set up and then pass these.
You will usually in Pyamo, you'll write the function just as you would essentially any other Python function, passing it some of the elements of your model.
And then you'll, once you have that function written, you will then pass that to a model dot, whatever you want to name it.
And the function contains the constraint.
And now passing that to the model dot, whatever your name is, will give that Pyamo object the inherent mathematical rules of said constraint.
Yeah.
It's pretty neat.
And I guess the last bit is there's also a data file, which looks a little bit like YAML.
I don't think it's YAML at all, but it looks like that's kind of the visualization.
It says, okay, we have cheeseburgers, ham sandwiches, fish sandwiches, chicken sandwiches, sausage biscuits.
You're going to get some serious caloric intake from that.
And then, you know, like how much you're allowed to eat, how much protein you need, how much carbohydrates.
And then it lays out like the ingredients for each one of those.
So you just define this data file that says the parameter F has this options, the parameter N has these options and so on.
Right.
So.
Yep.
Put those two things together at the end.
You say Pyamo solve, give it a solver, give it the Python code and the data file that has all these parameters.
Yes.
And it comes up with a beautiful solution in a, actually, I think an actual YAML file for the output.
Yep.
And then, so here's the funny part.
So how should we eat?
Like I'm looking to get a little healthier, but also save some money.
So what do I do?
Yeah.
So, well, I got some great news for you, my friend.
For only $15 a day.
If you eat four cheeseburgers, only five French fries, one fish sandwich.
Oh, five servings.
Oh yeah.
Five servings of French fries.
Five servings of French fries, I believe.
One fish sandwich and four milks.
You're good.
Boom.
Yes.
The only thing that would make me happier is if there was like an ice cream shake or two in there.
What you got to do is you got to be sitting there eating that and just let people that walk by, just tell them that you're optimal.
Exactly.
I've solved it.
I've solved the nutritional problem.
Yeah.
So I'll include this problem in the show notes.
It's pretty interesting.
It went really quick.
It took 9.7 milliseconds to run this.
So that's pretty quick.
The best.
And I mean, I can tell you, we had time parameters in my thesis and we're talking a pretty robust
electrical system and some pretty high, high level mathematics to account for all of the three phase AC power flow constraints and everything there in for a lot from the electrical engineering perspective.
Yeah.
And I did all of it on a fairly middle of the road, like 2015 MacBook Pro.
And it would knock it out in 20 seconds, maybe.
Yeah.
That's incredible.
I thought, well, maybe I'll come back to this tomorrow.
You know, I didn't know.
Yeah.
Tell people it's going to take really long.
I'll take the rest of the day off.
Well, darn it.
It's done already.
Yeah.
But that's the nice thing about it is when you structure, it's so abstract, it's hard to talk about like a podcast, I suppose.
But when you structure the mathematics right, letting the solver work, that the solution is computationally, I suppose, not that intensive, I guess I would say.
Yeah.
As opposed to trying to enumerate the best solution.
Right.
Yeah.
But that's the computational savings.
Exactly.
You're taking an intelligent way to get to optimality as opposed to trying to do something and the sun would burn out before you'd finish, right?
Right.
Well, and it's a solver, right?
It doesn't just like try every possible thing.
It has algorithms and stuff and it's beautiful.
Yeah.
And the individuals that write these solvers, I mean, they're the mad scientists, right?
That are able to.
Yeah.
You know, the solvers that actually blow my mind are the stochastic ones.
I took some Stokes classes and it was just one of those like, okay.
I don't really understand.
I barely touched on it.
I wasn't very much on the statistical side, but I did work with some people in my math experience around those.
And it's like, here's a problem that'll take seven days to solve, or we can do this little magic and get basically the same answer in about half a second.
Like, wait a minute, how did that even, how is this even possible?
Like, what are these things doing?
Well, I mean, that kind of comes back to what I said.
I get a little naive with some of my education at times, but I want to say that in one of our first coding classes, we set up something like a traveling salesman problem.
And I'm sitting there going, I got a Core i7 in here.
This will knock this out.
I start letting it go.
And just to prove the point, the professor is like, literally, because we're doing it like brute force, basically.
He's like, the sun will die before your computer will finish this problem.
Yeah.
You know, and then we structure it smartly in Piomo, and it takes a couple milliseconds.
Yeah.
It's insane.
That's so insane.
You also start to appreciate, like, factorial and stuff.
Oh, yeah, right.
What do you mean, the heat death of the universe before this time?
This is no good.
All right.
Well, I think that gives people a sense.
I mean, honestly, I don't recommend the diet.
But it gives people a sense of the type of problems and the way you set them up.
And it's a pretty clear, understandable problem.
And then a simple bit of code, like the Python code that actually does the smarts, right?
The cost and the limits or the constraints.
But it's probably like six or seven lines of code.
It's not a lot.
No, it's very straightforward.
The actual, again, coming back to, you know, my thesis, heck, I haven't pulled up, but something
like 600 lines of code.
And I want to say two thirds of that was just prepping the data, right?
And then the actual Piomo work was.
Yeah, exactly.
Yeah.
Maybe of that remaining third half of it.
And then the last part of that third was like shaping the output to be intelligible,
right?
The Piomo itself is pretty clean.
Right.
Wow.
Okay.
Yeah.
It definitely looks interesting.
And it looks very like it solves many different types of classes of problems, right?
Like linear programming versus nonlinear programming versus stochastic programming.
And then those solve each many interesting real world problems, right?
So this is broadly applicable, I think.
Yeah.
And I'm one of those guys that's like every problem is a network problem, right?
And you can feed those to this.
And then I view the world as either network problems or assignment problems.
And assignment kind of ties back into some of my work for the government, which is, do we
have the right people where they need to be?
And you can throw that at this.
Yeah.
Are you a fan of graph theory?
Yes.
Yeah, I am too.
I love that part.
All right.
Let me add, I think this is probably a good place to sort of wrap up our general conversation.
I'll ask you the two questions.
Anything else we should add to the general conversation before we wrap it up?
I got to just thank professors Alderson and Carlisle.
I mean, again, kid from the country didn't know what was going on in life and kind of stumbled
into this curriculum that has completely changed my life.
And I've always joked, I'm the dumb, smart kid that's smart enough to get into the advanced
stuff and then struggle the whole time.
And yeah.
Exactly.
I don't belong here, but somehow they let me in.
But yeah, that's cool.
Yeah.
That happened to me at the nuclear power curriculum.
It happened to me here.
I'm forever indebted to those two gentlemen.
So just thanks to them is something I would love the chance to throw out here.
Yeah, absolutely.
All right.
So before I let you out of here, this has been really interesting, but let me ask you
the final two questions.
And I have a twist on the second one because I want to throw out something in addition.
And while we're talking, because I want to hear your thoughts on it.
Okay.
If you're going to write some code, what editor would you use?
Either Jupyter Notebooks or Sublime Text.
Jupyter or JupyterLab?
Ooh, now you're getting beyond my head.
Have you made the transition over to JupyterLab or are you sticking with the traditional?
I don't think I have.
I'm probably stuck in the past.
Yeah.
They're pretty similar.
All right.
Good ones.
And then notable PyPI package.
Pyama, probably the reason I'm here.
Right?
So, yeah.
Awesome.
That's really cool.
All right.
So I put, I want to give a shout out to one because I think this is actually going to
be pretty interesting.
I haven't talked about it on Talk Python.
I have on Python Bytes.
Do you see that link?
Yeah.
Click, open that link.
And then let me describe this to the people.
And then you give me your thoughts.
There's a cool graphic.
So you don't have to like, there's like an animated GIF.
So you don't have to like feed.
So a lot of times what we do is we do math and optimization problems like we're talking
about here in code.
And the code looks a little bit like theoretical math, but not really like theoretical math.
But it would be really nice if you could have like the LaTeX fancy published like math book
representation of the steps that you're doing.
So there's a really cool project called Hand Calcs.
Have you heard of this?
No, I've not.
But so I wrote my thesis in LaTeX because there was so much of that fancy math, the actual written
math, right?
For all my constraints.
Yeah.
And learning LaTeX was a challenge, especially when I'm trying to wrap my mind around my
actual thesis work.
So seeing what I'm seeing here and the fact that it's in Python, I'm jealous.
I'm jealous right now.
Yeah.
Just scroll through some of the pictures here and I'll put it in the show notes as well.
So what you can do is you can write out like statements and equations in Python.
And then you can say, render with this Hand Calc, you say, render the, what I would have
done like step-by-step sequence I would have had to do to work out that calculation, right?
So you could say like X equals negative B plus square root B squared minus 4AC divided by
two, like quadratic.
And it'll actually, if it knows what the values of those are, it'll write out the steps of solving
that equation like bit by bit by bit as you would in like math class, but in Jupyter notebooks.
Yeah.
This is super cool.
Isn't this neat?
I thought like given what you're talking about, like this, this is a good thing to pair it with.
Oh yeah.
I mean, this would have, this would have saved a lot of time.
What have I done with my life?
This is pretty new.
I believe this is from Connor Fester and I'm really impressed with this project.
This is cool.
Yeah.
That's super, super cool.
Cause I mean, for me, it was either try to use the, in my opinion, atrocious math type
plugin in word, which not happening or write in LaTeX.
And this would have been more fun because I would have been able to stick with one.
Yeah.
LaTeX is fine, right?
Like all the math books and all the math papers and physics, I suppose as well.
Like almost all of them are done in that.
Right.
But the thing is now you've got the data in two places and if you change one, but you
forget to change the other.
Oh no.
It's all like, this just takes your Python code and like turns it into symbolic math.
It's awesome.
Yeah.
This is super cool.
Nice.
All right.
Well, let's leave it with hand calcs and a final call to action.
People want to get started with these types of problems and like using libraries like this.
What do you say?
Well, if you want to use Pyamo, if you're listening to this podcast, you're probably
familiar with some of those classic computer science problems.
I'd say pip install Pyamo and try to structure one of those problems in that system.
Then my other, I guess I'm going to have two calls to actions.
I'm cheating.
Go for it.
The other one I'll say is from that analyst perspective, kind of bringing it full circle
to Jacqueline and Emily, I get looked at at work like I'm a sorcerer because of some
of my Python skills and listening to some of your guests, like I'm not right.
But your calls to action often reach out saying, Hey, you know, maybe you're that person in
a job and you have this one Excel task that you do all the time, right?
You could automate that.
Well, I'm kind of that guy in a way where the calls to action that you've sent out, again,
I'm that person who has been automating things.
There was one example where we literally had people going through surveys by hand.
So this is surveys where like we ask our sailors, how do you feel about A, B, C, and
D?
And they used to go through them by hand.
And I was like, that can be better, right?
And so just...
This can't be the best way.
No, right?
And so we had the data digitally and I'm not even an NLP, not to be confused with nonlinear
programming, but I'm not a natural language processing guy.
But I installed some packages and was able to try to get sentiment out of surveys, right?
And so...
Oh, that's cool.
I just say that the power of this language can help at all levels.
And I'm at a fairly high level of government.
It's incredible what it does for us.
So the call to action, I suppose I'm rambling a little bit, is if you are that guy out there,
take it from another one of that guy that it really does work.
Yeah.
I think it's great.
And you're in one of these positions where you're a little bit on the boundary of a lot
of people who need answers.
They have a lot of data, but they can't answer the question themselves through code or programming
or anything along those lines.
And so it's like right there for you to just take that little step and come across as a
magician.
Like I do like to say that developers, data scientists, people who can write code, we really are in some
sense, the wizards or magicians of the modern era, right?
You think about an idea, you sort of do the incantation.
And then out of just energy in your thought comes a thing that can have huge impact.
And those don't have to be, oh, I created some huge, like I created Airbnb or whatever.
It could be there are people that can now focus on stuff that humans are good at and not just
typing in, moving stuff around from one Excel sheet to the other, to copy it over to PowerPoint,
to show it to the general.
Yep, absolutely.
I have so many examples.
I can give you one more.
Like we have this huge database of what civilian skills people have in the Navy Reserve, which
is a unique thing of us because we have our reservists have their military life, but they
have their civilian life.
And facets of their civilian life might be applicable skill sets that we could employ in a military
context.
And whoever designed the system to capture this only set up free text entry.
So imagine if you have 20,000 people do free text entry of what they're capable of, right?
You're like, couldn't I have just gotten a combo box?
Exactly.
But...
Or a radio button list or something.
Some kind of dropdown, maybe some cascading dropdown menus, right?
But so I inherited that database and it was sort of one of those, can you make anything of
this?
And right at the same time, a pretty high level individual was coming to us saying,
hey, do you have anyone with civilian skills to do this?
And I just wrote the world's most basic query and was like, yeah, we got seven.
Here they are.
Right?
Yeah, that's awesome.
And you would have thought I'd like conjured a spell, right?
And...
Yeah.
So this is why I made that source for a common beginning of this.
It really is incredible what you can do.
It absolutely is.
And it's within everyone's reach, I think.
Yeah.
It just takes a little bit of practice and a little bit of trying it out.
Yeah.
All right, Clark.
Thank you so much for being here.
It's been a lot of fun to talk about all these problems and cool work.
And thanks for helping us all live a little healthier lives, getting our diet figured out.
Four cheeseburgers, five servings of fries, a fish sandwich, and four milks.
You're set.
You're going to live forever.
Optimally.
All right.
Great to chat with you.
All right.
Thanks, Michael.
Yeah.
Bye-bye.
This has been another episode of Talk Python to Me.
Our guest on this episode was Clark Petrie.
And it's been brought to you by us over at Talk Python Training and our friends at Linode.
Simplify your infrastructure and cut your cloud bills in half with Linode's Linux virtual machines.
Develop, deploy, and scale your modern applications faster and easier.
Visit talkpython.fm/Linode and click the Create Free Account button to get started.
Want to level up your Python?
If you're just getting started, try my Python Jumpstart by Building 10 Apps course.
Or if you're looking for something more advanced, check out our new async course that digs into
all the different types of async programming you can do in Python.
And of course, if you're interested in more than one of these, be sure to check out our
Everything Bundle.
It's like a subscription that never expires.
Be sure to subscribe to the show.
Open your favorite podcatcher and search for Python.
We should be right at the top.
You can also find the iTunes feed at /itunes, the Google Play feed at /play,
and the direct RSS feed at /rss on talkpython.fm.
This is your host, Michael Kennedy.
Thanks so much for listening.
I really appreciate it.
Now get out there and write some Python code.
I'll see you next time.
Thank you.