Latest / Talk Python To Me / #163: Python in Geoscience
Transcript
- 0:00Learn how Python is being used in research to understand the inner workings of the Earth.
- 0:04This week, you'll meet Lindsay Hagee, a PhD student in geophysics at the University of
- 0:09British Columbia. She shares how she's using Python to solve these computational problems,
- 0:13along with an amazing framework for viewing scientific writing itself
- 0:17through the lens of Python and open source. This is Talk Python To Me,
- 0:21episode 163, recorded May 3rd, 2018.
- 0:25Welcome to Talk Python To Me, a weekly podcast on Python, the language, the libraries, the
- 0:44ecosystem, and the personalities. This is your host, Michael Kennedy. Follow me on Twitter,
- 0:48where I'm @mkennedy. Keep up with the show and listen to past episodes at talkpython.fm,
- 0:53and follow the show on Twitter via at talkpython. This episode is brought to you by MongoDB and
- 0:59Anvil. Please check out what they're offering during their segments. It really helps support
- 1:03the show. Lindsay, welcome to Talk Python.
- 1:06Thanks. Good to be here.
- 1:07It's great to meet you. You're doing some really cool stuff in geophysics intersecting with Python,
- 1:13so I'm super excited to explore that with you today. But before we do, let's get started with
- 1:18your story. How did you get into programming in Python?
- 1:20Most of that actually was undergrad, so I really hadn't touched much computing until I started at
- 1:26university. I did my undergrad in Edmonton at University of Alberta. And it was in my first
- 1:31year that I sort of got introduced a bit to programming ideas, but that was actually in Perl.
- 1:35So did programming look like a good thing you wanted to do, or were you like, whoa, what is this?
- 1:39It was more like, what is this?
- 1:42I mean, it was interesting to just start getting exposed to the types of things you can automate to
- 1:47make your life a bit easier. And so that was all that we had really done in the first year.
- 1:50And then got a bit into C++ in my second year when I was starting in physics. And that was intimidating,
- 1:58for sure. And then finally, actually, once I started getting much more into geophysics,
- 2:03we were all in MATLAB. And that was much closer to what sort of the day-to-day scientific work
- 2:09is readily supported by. And so, yeah, that was really my first foray into computing.
- 2:14Yeah. And there's a pretty easy switch from MATLAB to Python. I mean, they're not the same.
- 2:19Obviously, they have really different philosophies, right? Like MATLAB is like,
- 2:23let's make it all super commercial. And every little function you want, you got to buy that
- 2:27individually and so on. But, you know, the sort of feel of scripting it is kind of the same.
- 2:33So that's pretty cool. So how did you get into Python? Actually, was that in grad school?
- 2:37Yeah, it was grad school. And it was actually, I'll credit Rowan Cockett,
- 2:40who I've done a lot of work with. And he just recently finished his PhD.
- 2:44And so that was, I guess, my first or second year at grad school. He had really suggested that we
- 2:50started working together on a number of projects as like a geophysics group. And so that's how
- 2:54Simpeg started, which I'm sure we'll come back to. But then starting to build software together was
- 3:00when, you know, we looked at Python because there is such a healthy community and so many tools for
- 3:05making that easy. That, yeah, that's how we got into it.
- 3:08Yeah, that's cool. And what year was that?
- 3:09That was only a few years ago. So I guess like my second year of grad school.
- 3:13Yeah. Earlier than that. Maybe 2014. Yeah.
- 3:17I'm just trying. I'm just thinking because if you look at the history of Python, and especially how
- 3:24it's appeared in data science, it looks like around 2012, I don't know what the actual trigger for this
- 3:29was. But something happened that just really drove the adoption of Python, especially in the data science
- 3:34space. I'm pretty sure Jupyter has a lot to do with it. But I'm sure there's other factors as well.
- 3:39So it makes sense. Yeah, yeah.
- 3:41Yeah. So what do you do today? Like, you're still in grad school? Is that right?
- 3:45Yes, I am. My sort of day to day, I am trying to wrap up my PhD. So it's a lot of writing at the
- 3:50moment. Like the thousand little details you didn't know you had to finish up or are attacking you?
- 3:56Exactly. Yeah. So that's where I'm at at this point. But I'm fortunate to be a part of like a really
- 4:01great group of people. And so there's a lot of collaboration that goes on back and forth.
- 4:05So like most of my PhD and grad study journey has really been a lot of collaborative work,
- 4:10which has been a lot of fun.
- 4:11Nice. And so you're studying geophysics. And you're working at this place called the
- 4:16Geophysical Inversion Facility. Is that correct? Is that right?
- 4:19Yes, that's right. Yeah.
- 4:20So first of all, what is geoscience or geophysics? Like, generally?
- 4:25Geophysics would be a subset of geoscience. So geoscience is basically anything concerned with
- 4:31trying to understand the earth. So that is very, very broad.
- 4:33Right. It could be plate tectonics. It could be magnetic field. I guess it could even be climate
- 4:37change, right?
- 4:38Yeah. It could be climate change. It could be atmospheric studies. It could be like economic
- 4:42geology, trying to map out where different rock units are. All of that.
- 4:46Okay. So what's geophysics?
- 4:47So geophysics, we're then understanding the earth through physics. And so what I do specifically in
- 4:54geophysics is we're looking at geophysical imaging. So it's a lot like medical imaging in a lot of ways.
- 5:00So, you know, when you go to the doctor, you're hoping that they don't have to drill into you to
- 5:04get information about what's going on inside of you. So there are sensors, like if you go into an MRI or
- 5:11something like that, there's sources and sensors on one side. And we can take the data that have been
- 5:16collected in that survey of you and work with those to then get an image of what's going on inside your
- 5:22head. And so we basically do the exact same thing, but then on the earth. And so it's a larger scale
- 5:27survey, but it's the same general principles.
- 5:29Okay. That sounds really interesting. I've seen some really amazing graphics and I'll link to a
- 5:34couple of them, of course, in the show notes. What are some of the types of questions that you are
- 5:40trying to answer or people generally in the field are trying to answer?
- 5:43So it totally ranges. Our group, a lot of the history has been really connected with minerals.
- 5:47So trying to map out and locate where mineral deposits are, characterize them, delineate the
- 5:52different units and things like that. One of the big topics that's becoming more and more relevant
- 5:57is characterizing groundwater. And so trying to figure out where do we have pockets of aquifers? You know,
- 6:04how much is in that aquifer? Can we quantify that using geophysics? Because in a lot of places right
- 6:09now, what's done is just wells are drilled and you can get water levels at, you know, single points,
- 6:14but that obviously doesn't characterize the whole aquifer.
- 6:17Right. Of course. And that's going to be an increasingly interesting question. You know,
- 6:21we saw California go through some really serious droughts and they're finally out of it, but that
- 6:26kind of stuff is going to be happening more and more, most likely. So those questions become more
- 6:31critical, right?
- 6:31Yeah, absolutely. So groundwater and seawater intrusion is another big thing in California. So it's not only
- 6:37that you are losing, you know, aquifer water, the seawater is actually also coming in. So there's a whole
- 6:43bunch of different things going on that we really need to get a handle on fairly soon.
- 6:46All right. So what are some other questions or some other areas people are focused on?
- 6:50A lot of the work that I've been doing, I've been looking at trying to monitor subsurface injections,
- 6:55like if carbon dioxide or hydraulic fracturing is done, you know, we're injecting fluids into the
- 7:00earth and trying to track out where those are growing. And so I've been doing a lot of work
- 7:04looking at electromagnetics when we have steel cased wells there, because often, you know,
- 7:09we've got this well that and we're going to inject the fluid through there. But what's
- 7:12interesting about a well is that it is actually very, very conductive. So in a lot of ways,
- 7:16it's like a big electrode. So it can help us get current to depth. But we're then trying to
- 7:21understand, you know, the mechanisms and how does that actually happen? And how does it work?
- 7:25Yeah.
- 7:25So that's been a lot of, yeah, what I've done.
- 7:27That sounds really, really interesting. I guess the first place we should probably start looking at
- 7:33some of the programming side of things is, I guess, let's talk about Simpeg. So Simpeg is this thing
- 7:40for simulation and parameter estimation. What does that mean? Put that in plain English for us.
- 7:46Fair enough. What we need to do if we're trying to collect any sort of data,
- 7:50so we can maybe go out and do a magnetic survey. And so in that case, the source is the Earth's
- 7:55magnetic field. And then basically, whatever kind of rocks that you have that are susceptible,
- 8:00meaning that they have, they act like little dipoles. And so they'll try and line up their
- 8:06dipoles with the Earth's field. And then we can go over with a magnetometer and try and find these.
- 8:11And so that would be a magnetic survey. And what we need to be able to do is we actually need to be
- 8:16able to simulate the physics of that process. So in this case, we'd be simulating like the
- 8:21magnetostatic equations.
- 8:22Yeah, I was gonna say, so different types of minerals maybe react differently to the magnet.
- 8:27So if you're looking for a cobalt or lithium or something else, like you can detect that using
- 8:33magnets?
- 8:34Yeah, some of them. So it depends if they're magnetic or not. So not all minerals are.
- 8:38And then the strength can vary. And so mag is just one survey that you can do. But generally,
- 8:43we'll try and do a few different surveys. So they might be magnetic, they might also be conductive.
- 8:48So if you have something like iron, it's pretty easy to get current through that. And it's magnetic.
- 8:53So if you go and do both of those surveys together, we can start to like pinpoint what these different
- 8:57minerals are.
- 8:58So iron is easy?
- 8:59Iron's easier. Yeah.
- 9:01Nice. Okay, so back to the simpeg. So you want to you want to analyze the magnetic response
- 9:06of the stuff deep underground?
- 9:09Yeah, so we first need to be able to like simulate the set of equations that governs that process.
- 9:14So that's the simulation piece is we're going to solve some sort of partial differential equation
- 9:17that's governing the physics. So we assume that we know what the earth is, like what the earth model
- 9:22is, what the physical properties are, and we can predict what the data should be. So that's a
- 9:26simulation piece. And then the parameter estimation piece is trying to go backwards,
- 9:30is that we have data. And now from those data, we're going to try and estimate.
- 9:35And so we do that through an optimization process, we can basically say, okay, I know what these data
- 9:40are. And I know how to guess or I know how to simulate data. And so now we're going to try and
- 9:45find a model that fits those data. And it's somewhat geologically reasonable.
- 9:48Okay, that's pretty cool. And this is all done in Python. Is there maybe some like underlying
- 9:54C or Fortran code that gets brought in there? Is it all straight Python?
- 9:59It's basically all Python, we interface to lower level solvers, and things like that. And there's
- 10:04a little bit of Cython for some of the meshing stuff. But for the most part, it's pure Python.
- 10:08Okay. Yeah, that's, it's really cool. There's a picture, you mentioned Rowan Cockett, and I happen
- 10:14to just have grabbed something off Twitter from him. So that's kind of a funny tie in. But if people are
- 10:21kind of interested in seeing what the those look like, I'll put in the show notes, this cool,
- 10:26sort of three dimensional graph of what is called the Richard equations. That's pretty cool. So
- 10:32are you familiar with this?
- 10:34Yes, I'm a co author on that paper, actually. So
- 10:36Oh, awesome. Yeah. Well, tell us, tell us a little bit about like what,
- 10:39what the main question was, and what you guys found using Simpeg on it.
- 10:43What this was, this paper actually describes a lot of the fluid flow machinery that we have in Simpeg.
- 10:49So Richard's equation describes fluid flow, like going through soils. So it's a two phase flow where
- 10:55you have air and water in some sort of medium like a soil. And so depending on how hydraulically
- 11:03conductive pieces of that soil are basically how easy water goes through that front propagates down
- 11:08differently. And so in this case, what we developed in this paper is describing like, how do we solve
- 11:15those equations? But then the important piece is when you want to actually go back and estimate things
- 11:20like hydraulic conductivity, we need that inversion piece. And so we need to have gradients that tell
- 11:26you basically, if I change this model parameter this much, it changes my data in this manner.
- 11:31I see. Like how responsive is it to variation in parameters and estimation and stuff?
- 11:36Absolutely. And so that's like such an essential piece to be able to solve that parameter estimation
- 11:41problem. So in this paper, we go through and basically derive all the mathematics for that, and then show a couple
- 11:48examples.
- 11:48Yeah, the pictures are really, really compelling. And it's pretty interesting. So I think it's really nice what you guys have
- 11:55put together here. So are a lot of people using Simpeg for other work? Or is it mostly within your group?
- 12:01It started mostly within our group, but it is starting to branch out a bit. So we've got some collaborators at Colorado
- 12:07School of Mines. There's some people with USGS who are starting to dabble in it. We recently gave a short course that
- 12:14traveled around the world. And so that was a great opportunity to start introducing people to the Python ecosystem.
- 12:20And for some researchers, you know, Simpeg was an appropriate tool. So they're starting to come in and explore that a bit.
- 12:28Hey, everyone, Michael here. Did you know I'll be doing a three-part webcast series about MongoDB and Python from May to June?
- 12:36We'll see why MongoDB is a great choice for Python web apps. In this series, we'll go through the entire process of
- 12:42building a clone of PyPI, Python's packaging website over at pypi.org. Everything from building the front end to
- 12:50deploying the web app and MongoDB to the cloud. You'll learn everything from document modeling basics to special
- 12:56considerations for running MongoDB in production. The webinar is free. So just click on the link in the show notes or go to
- 13:02mongadb.com slash webinar slash Python and sign up. See you in May.
- 13:08It sounds like a lot of what you've learned from Simpeg has sort of fed back into some of the other work that you're doing as well around like more general education, research and science, right?
- 13:19Yeah, absolutely. I think for our group and for me in particular, Simpeg was like really my first entry point to the whole open source ecosystem and like what it's like to operate and run an open source project and be involved in an open source project.
- 13:34And what some of the strategies are things, you know, like peer review and issue tracking and all of that sort of stuff. That was all really learned when we first jumped into Simpeg.
- 13:43I think it's really interesting. I mean, you come from a place like say working with MATLAB as a community in general, right? Like they publish packages you can add on and you kind of wait for them to release new versions and they give you what you, you know, you get what they give you, right?
- 14:00And there's not a whole lot of give and take there. And that's just so, so much the contrast with things like Simpeg or other open source projects, right? Like even on the courses that I do, I have people will come and they'll say, oh, you did this little demo like this, but actually I've refactored it to really take account for this other thing.
- 14:19And it's really, you know, just you get these out of the blue, people are helping you out.
- 14:22Even if you don't ask for it, it's really quite an interesting experience.
- 14:25It really is. And like just the ability to put code out there, share it and get other people's opinions is like such a part of the Python community and like what people follow.
- 14:36Whereas if you look at something like MATLAB that just, there's not easy mechanisms to do that.
- 14:40So even if you write something useful, like you email code then to your friends and that just is not sustainable.
- 14:47Which one do you want me to run? The one that you sent me on May 23rd or the one that you sent in June?
- 14:53Like I can't remember which one we're working from, right? That's not a great version control, is it?
- 14:58No.
- 14:58So maybe let's spend a little time talking about this presentation that you gave at PySci, CyPy?
- 15:042016.
- 15:05And it was called Using Open Source Tools to Refactor Geoscience Education.
- 15:11And I think you kind of put it around the scope of geoscience, but I would say scientific education more generally, right?
- 15:18Yeah. I mean, geoscience is our domain.
- 15:20And so that's where like we've thought through a lot of these things.
- 15:23But, you know, as we've been developing along the way, really trying to take a bit of a big picture perspective and figure out,
- 15:29are there things here that we can learn and perhaps translate to teaching and learning as well as scientific publication?
- 15:35Yeah. So maybe give us the big idea on your talk and then we'll touch on some of the pieces.
- 15:40Geosci.xyz is a collection of like open source.
- 15:44They're basically living textbooks.
- 15:46And so the idea is that we're trying to take a lot of what we've learned from developing open source software
- 15:52and try and apply that to open source educational resources.
- 15:56And so that there are opportunities for collaboration, for peer review, for iterating on things and, you know,
- 16:03to grow and develop resources as a community.
- 16:06One of the things that we've really noticed in geophysics in particular is it's a really small field.
- 16:11And so there really aren't actually many good textbooks, especially for introductory level classes.
- 16:16And so what happens is, is, you know, there are professors scattered around the world teaching this
- 16:22and they're all developing all of their own course notes from scratch.
- 16:25And each of them has, you know, different expertise and different background.
- 16:28And so there's one aspect of that that's going to be really strong.
- 16:31But then the rest of it, they're having to go and learn from A to Z, like a whole bunch of techniques that there may or may not be.
- 16:37They maybe learned it in grad school, but they haven't used it for 15 years.
- 16:40But now they got to write about it, right?
- 16:41Because they got to be comprehensive.
- 16:42Yeah.
- 16:43Yeah.
- 16:43And so we're hoping to eliminate some of that so that, you know, people who are experts in given topics can contribute that
- 16:51and then can leverage what other people know.
- 16:52So, yeah, I think that is really quite an interesting perspective.
- 16:56You talked about some of the problems with the sort of teaching and learning and writing sort of largely focused around like textbooks and stuff, but more generally as well.
- 17:06If there are bugs in the book, you don't know.
- 17:10They're hard to be tracked.
- 17:11I mean, maybe you can find it, right?
- 17:12Like versioning is difficult.
- 17:14Do you have the current version?
- 17:16You don't know, right?
- 17:17How do you diff a book like that is, you know, two textbooks.
- 17:24You just kind of flip through it, right?
- 17:26I don't know.
- 17:26It's not super easy, is it?
- 17:28And sometimes it's really obvious, like, oh, we added a chapter on this or a figure on that.
- 17:32But other times you said, you know, it's much more subtle.
- 17:35Like, oh, there was an error.
- 17:36Should have been a minus sign in this equation right here.
- 17:39And like that's, you probably wouldn't catch that, right?
- 17:42That's really a challenging position to be in when you're first trying to understand a topic, right?
- 17:47It's like you work through the whole question.
- 17:49You create the plot based on your understanding.
- 17:51And it doesn't match what theirs is.
- 17:53And then what do you do?
- 17:54Like they're different.
- 17:55And they could be wrong.
- 17:56You could be wrong.
- 17:57And there's no way to sort that out.
- 17:58And like there's no way to contact the author really in most cases.
- 18:03Yeah, it's quite hard.
- 18:04And a lot of times you're a student.
- 18:06So you're like, well, I'm wrong because I'm new at this.
- 18:10I must be wrong, right?
- 18:11Until, you know, somehow you maybe decide, no, I think I really am right.
- 18:16This is really broken.
- 18:17But yeah, that can be frustrating.
- 18:18So you had a really nice way of breaking down the sort of things involved in that type of creation, that educational content creation, and sort of framing it in terms of concepts from the Python space.
- 18:34And you started with functions.
- 18:36And you asked the question, like, what are functions in the context of science and writing?
- 18:40So what are functions in that context?
- 18:43There's a few different things to think through.
- 18:45But one of the things that we first looked at, maybe I'll give you a little bit of the backstory before diving into this.
- 18:51One of the big motivating factors for this project was that my supervisor had developed a website quite a number of years ago instead of a textbook.
- 19:01So he was really forward-looking in the sense that he wanted to get content out there for students in a very tangible, like easy to interact with way.
- 19:09And so they built this website.
- 19:10It's a great site.
- 19:11But then we found a few typos in it and wanted to try and go in and fix them and realized it was tangled up in this crazy HTML mess.
- 19:18The first, I guess, in the refactor of this was really identifying, like, what actually is the data here?
- 19:25What's the data and what is the packaging?
- 19:26So in this case, really, the data is just the text and the equations and the images.
- 19:31The HTML and CSS, all of that is just packaging.
- 19:34And so in this case, perhaps a function is actually like Sphinx.
- 19:40And so you take your data, which is text and images, and then you compile that into a website.
- 19:45And so what's powerful about that is then as styles and things like that update and as there's better ways to interact or somebody builds a fantastic new search tool, you haven't, like, you've separated out what is data and what is the packaging.
- 19:59And so you can immediately leverage all of those new developments.
- 20:03Yeah, it sounds super obvious.
- 20:04I mean, as people who write software, like, you think, of course, you're going to do these types of things.
- 20:08But then in practice, you go look at, you know, for example, the website you're talking about.
- 20:12And it's all crammed together.
- 20:14A lot of times these are written by people who don't have sort of formal software training either.
- 20:19So they maybe don't even have some of these ideas sort of in the back of their mind when they come to it.
- 20:24And so, yeah, so you're like, all right, well, let's break this out into restructured text.
- 20:29People can edit that super easy.
- 20:31I mean, you probably know LaTeX or something that's like an easier version of that.
- 20:34So that's good.
- 20:35And then, obviously, the styles.
- 20:37So that's one part.
- 20:39Another part you talked about was capturing inputs.
- 20:42So, you know, you probably have some picture, but that picture has, you know, like a view onto it.
- 20:49It has parameters for the equation.
- 20:51It has all kinds of stuff, right?
- 20:52So that's another aspect of sort of the function analogy, right?
- 20:56One of the great things in this Sphinx documentation is the Matplotlib plugin.
- 21:01And so that's what we've been leveraging in order to capture the inputs to your figures.
- 21:05And so because to create a figure, we're running some sort of code with, as you said, some inputs.
- 21:10So maybe we're looking at the electrostatic response of a sphere.
- 21:13And you want to change it from a resistive sphere to a conductive sphere.
- 21:17That should be something that, like, the user of this resource should be able to, like, readily do.
- 21:22And so you can't do that with a textbook, obviously.
- 21:25But in this case, if you've preserved that source code, then that's actually an entry point for people to actually take that single picture and start to be able to explore that.
- 21:34And, I mean, once you, yeah.
- 21:36It sounds like that's touching on one of the whole, like, super significant things in science in general these days is the whole reproducibility thing, right?
- 21:45And this just makes the whole paper or the book or whatever it is more reproducible if you can re-execute it to regenerate the output, right?
- 21:53Well, Rowan and I gave a talk at JupyterCon last year and sort of touching on reproducibility.
- 21:59And I think one of the things that's important to keep in mind, too, is, like, what is the point of reproducibility, I guess?
- 22:07So, I mean, it is obviously good practice to have your content be able to be regenerated.
- 22:11That is a good thing.
- 22:13But the way that you actually build upon somebody's ideas in science is you take what they've done and then extend it.
- 22:20And so, also, by being able to, you know, at least capture all of the instructions to get to point A, then somebody can immediately pick that up and start to play around with it and hopefully get to point B, which is then actually maybe some sort of new discovery that extends on that work.
- 22:37Yeah, that's cool.
- 22:37So, you can actually literally build on the sort of algorithm and steps.
- 22:41So, there's probably a lot of data exploration in Jupyter as well in this.
- 22:46Like, you could, you know, copy little bits into Jupyter, play around, put it back in restructured.
- 22:50Or can you load restructured directly?
- 22:52You know, I don't actually know about that.
- 22:54I'm sure that somebody's written something.
- 22:56It's got to be out there somewhere, right?
- 22:58Yeah.
- 22:59Yeah.
- 22:59Yeah.
- 23:00But we've sort of been developing Jupyter Notebooks in parallel.
- 23:04We've been teaching a lot of courses, actually, where computation is, like, not taught at all.
- 23:08But we want to be able to have people play with figures.
- 23:11So, we've been leveraging Jupyter and IPy widgets to basically wrap functions that compute things and give you plots to make that interactive.
- 23:20And so, that's been really exciting to see that, you know, people can actually get up and running.
- 23:25And they're running code, but they don't necessarily even need to know anything about Python, what is Jupyter, any of these things.
- 23:31Right, right, right.
- 23:32Just inputs and pictures.
- 23:35Another thing you said is once we have this concept of sort of a reusable function, you can test it, like in Travis CI or continuous integration, right?
- 23:42This has been exciting to see.
- 23:44There's a few aspects to the testing.
- 23:46First off is, like, when we have code snippets and things like that in the textbook, we can test them.
- 23:51Same thing with all of the figures.
- 23:53We can test those.
- 23:54And so, I mean, if there's API changes or things like that down the road, we'll catch that so that the code always continues to work.
- 24:00Because I think we've all seen the case, you know, where somebody actually wrote a textbook and there's printed examples of code in there.
- 24:06And there's inevitably a bug.
- 24:08And there's nothing that can be done about that once it's been published.
- 24:11And so, then you just end up with generations of frustrated students who can't even get the code to run at the first stop.
- 24:18So, here, at least, that's something that we can test.
- 24:21Another thing that's actually been kind of interesting, too, is you can go in and test links.
- 24:26And so, make sure that all of the things that you are pointing to and all of the extra resources that you are connected to continue to be there.
- 24:33And if not, then you can go in and find something else relevant to point people to.
- 24:37Yeah, that's a really good point because you don't necessarily control all the external resources that exist, right?
- 24:42And you don't keep checking them.
- 24:43Yeah.
- 24:44Yeah, yeah, really cool.
- 24:44So, the functions, that's a pretty low-level concept in structuring code.
- 24:50So, the next level up would be classes, maybe?
- 24:53So, starting to get to a bit more organization.
- 24:56So, I mean, a function, you've defined a piece that is reusable.
- 24:59And now a class, we're going to try and define something that you can perhaps inherit and build upon.
- 25:05One of the things that we pointed to in this analogy is just looking at, like, a given page structure.
- 25:10So, when you're talking through a concept, I mean, there's a few obvious things that every page has.
- 25:15Like, it has a title.
- 25:16It has contributors to that page.
- 25:18One of the things that we've been trying to promote is a purpose statement on each of the pages.
- 25:24You know, to give just, like, a high-level overview of why should I care about what is on this page.
- 25:28I think that's a really good idea because one of the major benefits of people writing, say, like, unit tests against real proper, you know, software code is you know when you're done.
- 25:41Like, if you put out all the things it's supposed to do in the test and it does them, well, you can stop messing around.
- 25:46Because people can, like, fiddle with the code and think about what it might need in the future forever, right?
- 25:51And so, there's this really clear, this is what I wanted to do.
- 25:54I've done it.
- 25:55Now, what's next, right?
- 25:56And you obviously have the same problem in writing.
- 25:59I really love this idea of, like, we're going to give this a purpose and almost test it.
- 26:04You also said that this leads really well to a collaboration, right?
- 26:08Because people coming to it know what the purpose is.
- 26:10They all agree upon the purpose and it sort of helps communicate that.
- 26:13Yeah, absolutely.
- 26:14And, I mean, because when you have multiple authors contributing content to one resource, everybody's got a bit of a different writing style and all of those sorts of things.
- 26:23And that's totally fine.
- 26:24But it can lead to sort of a hodgepodgey resource.
- 26:27But at the very least, you know what is going to be achieved in each page.
- 26:33It's so much easier to collaborate and give meaningful feedback as well.
- 26:36So, if I am reviewing somebody else's page and I know what they're trying to accomplish and have maybe a couple ideas about some different examples that they could include to help achieve their goal, that's easy to then point them to.
- 26:48But if the purpose isn't clear from the outset and it's not immediately transparent, it's very hard to then give productive feedback.
- 26:55Yeah, for sure.
- 26:56It also helps with peer review.
- 26:57You know, a simple peer review question is, have you achieved, does this thing do what it says it does, right?
- 27:03Rather than, is it good or is it accurate or is it good, you know, whatever.
- 27:07Those are really hard to answer.
- 27:08Another thing is you say it leads to templates, right?
- 27:12So, you could say this page is for, you know, a case study of this type.
- 27:17And then that means it has this structure, right, which can really help with writing.
- 27:21Yeah, and it helps, you know, solicit input from other authors as well.
- 27:26So, what we've done with case histories, a case history and how we've defined it is it's basically like an exploration or geophysics example.
- 27:34So, we walk through, you start with some sort of question.
- 27:37And then we're going to walk through what are the relevant physical properties?
- 27:40So, what are the different rock types or things like that that we're going to look for?
- 27:44How are we going to try and detect those?
- 27:46What do the data look like?
- 27:48Then we go through and, you know, how do we process those data, interpret the results?
- 27:52And then did we actually answer our initial question?
- 27:55So, that's sort of like seven steps that we've broken all of these case histories into.
- 28:00And once you actually start having a few examples of that, we've been able to send these templates out to researchers around the world who have experience in different applications than we do.
- 28:10And just said, hey, do you have a good example that you could put into this framework?
- 28:14And once you lay out the pieces, people are a lot more willing to go in and put their content there.
- 28:19Because you've just removed, like, all of that overhead of figuring out how should I structure this.
- 28:24Right.
- 28:24How long should it be?
- 28:25What should I say?
- 28:26What's important?
- 28:27What's not?
- 28:27Yeah, it's super, super interesting.
- 28:29I had Jesse Davis on the show quite a while ago.
- 28:33And he did something similar for blogging.
- 28:36He talked about how to write a good developer blog.
- 28:39And he had come up with five design patterns for blog posts.
- 28:44Right.
- 28:45What are your goals?
- 28:45Then this pattern applies.
- 28:47And it's just, like, once you know what you're trying to do and you have the pattern, you're like, okay, these three steps.
- 28:51This is what I do.
- 28:51And then all of a sudden, like, it's the writer block can be largely gone.
- 28:56It's much, much quicker.
- 28:58And so, yeah, I really like this idea.
- 29:00This is where we've seen definitely the most contribution coming in is because it's an easy place to jump in once something's structured.
- 29:06Okay.
- 29:06So once you have functions in the classes, you might want to reuse them other places.
- 29:10That might be, like, import.
- 29:12The import saving.
- 29:13Yeah.
- 29:14So this is where things get a little fuzzy.
- 29:16But we've played around with this analogy.
- 29:18And one of the things that has been kind of exciting is we've developed an equation bank.
- 29:23And so one of the resources we've been working on is about electromagnetics.
- 29:27And so Maxwell's equations are going to show up all over the place in multiple places.
- 29:31And so that's something that you don't want to repeat writing.
- 29:36And especially when you have multiple people, we want to try and stick to the same notation conventions and all of that sort of stuff.
- 29:42So ideally, we don't want people rewriting these.
- 29:45So we've actually set up an equation bank.
- 29:47And then that's something that you can just include in your page is just include Maxwell's equations.
- 29:53That's cool.
- 29:53And so if there's a mistake, you fix it in one place, right?
- 29:56And it fixes it everywhere.
- 29:57Exactly.
- 29:57Yeah.
- 29:58Nice.
- 29:58And let's see.
- 29:59You could also maybe think of links as external, as sort of an thing you import, like an external resource that you depend upon.
- 30:07Yeah, in a sense, because in like what you're doing in that way is you've got some word that's linked.
- 30:13So, you know, maybe we've linked the word to some sort of specific geophysical system.
- 30:17And so that is containerized piece of knowledge that you can sort of bring in and expose to the user in a meaningful way that also is in context.
- 30:26So that's one piece that I think fits into that analogy.
- 30:30Yeah, yeah.
- 30:30Another one is once you start importing things, you see structures and dependencies.
- 30:34And then you could almost say like, well, we should refactor this into this other form that's better once you see the large overall structure.
- 30:42That's pretty cool.
- 30:43Because then you get to looking at ideas of like which concepts build upon each other and what concepts you need to understand, you know, this given method or another method, which is kind of cool to be able to actually like introspect the field.
- 30:54Yeah.
- 30:56Yeah, it's pretty amazing.
- 30:57And I'm sure there'll be some good visualizations at some point.
- 31:00And then at the very outer end, someone else wants to use the thing you've created.
- 31:06So you have the pip and packaging analogy as well.
- 31:09This is something that I would love to see this idea evolve a bit more.
- 31:13But I think at the basic level, making it clear how people can use things.
- 31:18So applying a license, showing which concepts build upon others.
- 31:22So if you're importing this more advanced resource, what are the things that you should be familiar with before that?
- 31:28And then as well, versioning and all of that.
- 31:31Make sure that that's clear when you're changing things.
- 31:36This portion of Talk Python To Me is brought to you by Anvil.
- 31:40With Anvil, you can build full stack web apps with nothing but Python.
- 31:44Building for the web is complex.
- 31:46You typically have to write JavaScript, HTML, CSS, some front end framework like React.
- 31:51And then you've only done the front end.
- 31:53You still have the server to write.
- 31:55And then you have to decide where and how to deploy it.
- 31:57With Anvil, all you need to know is Python to build production-ready apps and deploy and scale them with a single click.
- 32:04You have a visual designer for your page.
- 32:06And you've got the entire Python ecosystem to integrate with.
- 32:09It even comes with a built-in database as a service.
- 32:11I've been using Anvil myself.
- 32:13And I'm really excited how accessible it makes the web, even for people who are not excited about writing HTML.
- 32:20And if you happen to take my 100 Days of Code course, you'll see near the end, we actually spend a lot of time building a really cool web app with Anvil.
- 32:27I'll put that app in the show notes.
- 32:29But you can find it at pypoint-100days.anvilapp.net.
- 32:33Get started at talkpython.fm/Anvil.
- 32:37And they'll throw in a 10% discount on an individual plan just for you Talk Python listeners.
- 32:42If you've been afraid of the web, go have a look.
- 32:45This is something special.
- 32:46And they're doing really interesting things with Python.
- 32:48So that's the whole overall conceptual way of thinking about the work that you guys are doing in education and writing in the software Python space.
- 33:00But you actually took a lot of the tooling literally from the software space, right?
- 33:05Things like Git and continuous integration.
- 33:07What all did you use there?
- 33:08Everything's hosted on GitHub.
- 33:10So that's our peer review mechanism.
- 33:12That's all the versioning for us.
- 33:13Issue tracking, all of that.
- 33:15We have used Sphinx to actually build the pages.
- 33:18And then I did mention that the Matplotlib plugin has been one that we're using to generate these reproducible figures.
- 33:25We started out hosting stuff on Read the Docs.
- 33:29But then the site got way too big.
- 33:30So we host it separately now.
- 33:33Yeah, and then Travis CI for all of the testing pieces.
- 33:37It's not just the concept of it.
- 33:38You're actually applying a lot of these tools and techniques to it.
- 33:41That's pretty cool.
- 33:42Oh, yeah.
- 33:42And then Jupyter throughout as well.
- 33:44Yeah, I'm sure Jupyter is in there.
- 33:46Are you guys moving to Jupyter Lab these days?
- 33:49Are you sticking with Jupyter?
- 33:50What's the thought there?
- 33:51I've dabbled in Jupyter Lab.
- 33:53I'm quite excited to start diving into it a bit more.
- 33:56I've just been with writing.
- 33:58I'm trying to wrap up the PhD.
- 34:00I'm hesitating diving into new and exciting tools because it's easy to lose track of time there.
- 34:05Yeah.
- 34:06Yeah, I can imagine that the fence probably has a top priority.
- 34:10Yeah, at this point.
- 34:11Yeah, Jupyter Lab looks really cool.
- 34:13I haven't done anything with it.
- 34:14But I've kind of looked and said, oh, this looks a little nicer than Jupyter.
- 34:17Maybe I should start learning this.
- 34:19I've been excited to see some of the Markdown plugins and things like that that they've been working on and actually being able to execute and test code within Markdown.
- 34:29So that because I think there's a lot of utility there for the writing that we've done to make that process a lot easier for contributors.
- 34:37So that I'm excited to start playing with.
- 34:39Yeah, I really like this idea of testing your work.
- 34:41And one of the things that I've seen as something of a detraction from the whole notebook way of working, and I definitely see the exploration and flow benefits.
- 34:53But one of the things I see is less good is it's harder to say run tests over your Jupyter notebook or do code coverage of the code in your Jupyter notebook as part of those tests and things like that.
- 35:06And you actually tweeted out a really cool project that when I first saw it, I didn't realize it actually had to do.
- 35:12Its origins were in geophysics.
- 35:15But over at github.com/open geophysics slash test I pi in B is a thing that lets you unit test Jupyter notebooks, right?
- 35:26We've just started this.
- 35:27This basically got actually pulled out of the GeoSci ecosystem because as a part of a lot of these courses, we were distributing notebooks.
- 35:35And there were a whole bunch of different people who were contributing to these notebook repositories.
- 35:40And then we were deploying them either on Microsoft Azure or MyBinder and then stepping up in front of a course and using them to teach.
- 35:47And so, you know, when you're in front of a classroom, you really don't want errors popping up, especially if you didn't write the original notebook.
- 35:56Yes, exactly.
- 35:57Yeah.
- 35:57So this was really born out of need to make sure that at least if you are standing in front of the class that the notebook should run.
- 36:04And so what we've been trying to do here is we've extracted a lot of the work that we've done using NB Convert that just runs the notebook and make sure that it completes with no errors.
- 36:15So I think there's a lot that we can think about to, you know, increase the utility of this.
- 36:20But as a first pass, like just making sure that the notebook goes from A to Z without erroring, that makes sure, too, that you've properly defined all your dependencies and all of those pieces that are so easy to forget, especially, you know, to new contributors.
- 36:33It's not always clear that, you know, if it works on my machine, why doesn't it work over here?
- 36:37Yeah, exactly. So it tests things like that your Python environment has the dependencies installed and stuff like that.
- 36:43Yeah.
- 36:43Which that can be challenging in the whole data science, scientific computing space, right?
- 36:48Another one of the reasons I wanted to have something like this out there is that we're sharing notebooks that go along with our publications.
- 36:56And so a lot of them are built on Simpeg.
- 36:59We know that, you know, down the road, we're going to make changes that are not backwards compatible.
- 37:03And if you catch that right away, it's very easy to fix.
- 37:07But if you let the notebook lag by a year, it's really hard to then go in and maintain and upgrade that.
- 37:13And so part of this, too, was just to be able to put like the Travis Cron jobs that run once a month on our research notebooks and make sure that the research still continues to run.
- 37:25Yeah, that's a really good idea.
- 37:26Just run it periodically and just go grab everything new and see if it works.
- 37:31Yeah, that's cool.
- 37:31So do you have any way to do more specific data?
- 37:37Like result validation?
- 37:39So, for example, like if you have a cell, it would be great if it could convert it like to a function that you could call with parameters and get the response out or, you know, things like that, right?
- 37:49Like not only does it still run, but it actually gives me the same results.
- 37:53Yeah, I think that that would be super cool.
- 37:54I mean, the simplest way right now to do that is like include an assert statement that like downloads your archive data set and make sure that you can still reproduce that.
- 38:03But having something like that a little more exposed on the outside, I think, could be quite neat.
- 38:08Same thing with even sort of checking figures.
- 38:11So make sure that your figure looks the same.
- 38:13Right.
- 38:14Just like visually or, you know, pixel by pixel.
- 38:18Just compare that the picture is the same.
- 38:21Of course, when, you know, matplotlib updates to have like slightly faded cool axes, you know, that's going to break.
- 38:29But you could just say, oh, no, no, this new picture is still OK for us.
- 38:33We'll just upgrade that.
- 38:34Right.
- 38:35Or update the baseline.
- 38:36Yeah, that would be nice.
- 38:38But it sounds like a lot of work, right?
- 38:39Yeah, absolutely.
- 38:40Yeah.
- 38:41But I think the biggest thing is just knowing when stuff changes.
- 38:43So even if, you know, you compare these two things and they are different, but you can visually tell that it was just a style update.
- 38:49Like, that's fine.
- 38:49Yeah.
- 38:50A friend of mine, Luan Falco, has this project called Approval Tests.
- 38:54And I don't know.
- 38:55It's integration with Python.
- 38:56I know he was doing some there.
- 38:57And it's all based on that idea.
- 38:59Like, you write a test and you either get a result as a picture or as, say, a JSON document or whatever.
- 39:05And you just go, yeah, that looks good.
- 39:07And then all subsequent tests just go, is it the same?
- 39:09Like, you don't have to do all sorts of testing.
- 39:11You just feed it two pictures and it goes, they're the same, they're different.
- 39:14And you can either reapprove the new one or it's an error.
- 39:17Right.
- 39:17And so, like, that idea, I don't know.
- 39:19Maybe somehow these can be put together.
- 39:20It sounds cool.
- 39:21Yeah, that'd be interesting.
- 39:22Yeah.
- 39:22Nice.
- 39:24So, one thing that sort of comes to mind in this whole space is there's got to be a lot of data that you're collecting to get all these pictures and stuff, right?
- 39:35Like, the Earth is big.
- 39:35So, what are some of the challenges around, like, big data in geophysics?
- 39:41So, in a lot of cases, we're not necessarily encountering sort of the same style of big data problems that you think about when you think of, like, social media.
- 39:49We don't have data sets that are that big, at least in our group.
- 39:51Not like CERN, for example?
- 39:53No, not nearly like that.
- 39:55But a lot of what we're working with is small, disparate data sets.
- 39:59And so, we'll have collected, you know, a whole bunch of different types of geophysical surveys over one setting.
- 40:05And now we want to try and integrate all those different data types and figure out, okay, like, what is this telling us in terms of the rocks?
- 40:11Like, what does that mean in terms of the geology?
- 40:14So, that's one aspect where we're starting to see machine learning coming in in a very powerful way is actually trying to either take data that have been interpreted independently and then try and sort of merge those interpretations to then give you something stronger in terms of, like, I think this is rock A and this is rock B.
- 40:32Rather than this is magnetic and susceptible, this one is conductive.
- 40:36I see.
- 40:36More like trying to draw the proper conclusions from the raw data.
- 40:41Yeah.
- 40:41So, really trying to drive much more so at, like, the geologic interpretation.
- 40:45Yeah.
- 40:46So, another thing I was wondering is how is machine learning being used there?
- 40:50Because with these pictures and a lot of this data, it seems like somebody could come along and make some really interesting uses of TensorFlow or PyTorch or something like that.
- 41:01Yeah.
- 41:01I mean, I haven't seen a ton of neural network work yet, but that's also just my one sample point.
- 41:08Where I have seen a fair bit of work done is on the clustering side of things.
- 41:12So, really trying to either cluster interpretations or one of the things that I think is really kind of cool is when we start to meld together deterministic inversions.
- 41:23So, that's a lot of the work that we've done in the past where you're running some sort of optimization problem to fit your data.
- 41:28But then connecting that with statistical or machine learning approaches where you say, okay, I've got some sort of geologic knowledge about these rocks and how do I now couple that to my physics?
- 41:38So, that's one area where I think there's a lot of potential.
- 41:41Yeah.
- 41:42We're just at the beginning of all this machine learning stuff, right?
- 41:44So, who knows what it'll look like in 20 years.
- 41:47Yeah.
- 41:48Yeah.
- 41:48Yeah.
- 41:48It'll be wild.
- 41:50So, it sounds like you do a fair amount of programming around your research projects and stuff.
- 41:56And I know what the world looks like as a full-on software developer, right?
- 42:00You write a lot of code and things like that.
- 42:03But, you know, how do you think about balancing like programming and working on some of the libraries versus, say, research versus writing?
- 42:11Like, I know right now it's writing because of the time frame and all.
- 42:15But I feel like that's the question of any academic is how do you balance all these things?
- 42:22So, if anybody knows, I would love to know.
- 42:23But I think in a lot of ways what's been powerful with the group that I'm in is that a lot of this is collaborative.
- 42:33So, that there are pieces that you're working on together in each of these aspects.
- 42:36Because, I mean, as an academic, you do need to write about the things that you've been doing.
- 42:40So, you need to do things.
- 42:41And that involves, you know, programming and research.
- 42:43And then you need to share that with the world.
- 42:45And so, that's writing.
- 42:46Yeah.
- 42:46And I think having this open source angle to it, the collaboration really helps, right?
- 42:50Because other people can do some of the programming where they have the specialty, right?
- 42:54Absolutely.
- 42:54And there's less duplication of efforts, especially on a lot of those like more mundane tasks of just like parsing data files and things like that.
- 43:02Because there's no need for everybody to be writing that.
- 43:05But you all need it.
- 43:06Yeah.
- 43:06Somebody gave me this thing in IDL out of this program or generated by IDL.
- 43:11And like, we'll just import this thing and we'll read it.
- 43:14We'll be good, right?
- 43:15Yeah.
- 43:15So, another thing that is a major in that space is getting sort of citations and credits, right?
- 43:21Those are sort of like your upvotes for your career.
- 43:24Yeah.
- 43:25Are you familiar with the Journal of Open Source Software?
- 43:28Yes, I am.
- 43:28I'm actually the geoscience editor.
- 43:30You are?
- 43:31I didn't realize that.
- 43:32Yeah.
- 43:32Yes.
- 43:33Okay.
- 43:33That's awesome.
- 43:34Yeah.
- 43:35So, what are your thoughts?
- 43:37I mean, obviously, you must be a supporter if you're one of the editors, right?
- 43:40But just, you know, maybe tell people really quickly what it is since they if they didn't listen to, you know, my show a while ago with our fun.
- 43:46So, it's really a developer-friendly journal.
- 43:47So, it's really a developer-friendly journal.
- 43:51And so, you know, I think it's a lot of people that I'm going to do.
- 43:52And so, you know, I think it's a lot of people that I'm going to do.
- 43:52And so, you know, I think it's a lot of people that I'm going to do.
- 43:52And so, you know, I think it's a lot of people that I'm going to do.
- 43:52And so, you know, I think it's a lot of people that I'm going to do.
- 43:52In that sense, the biggest thing is you're actually sort of getting peer review much more so on your code development and practices.
- 43:58There's a short paper.
- 44:00It's like one to two pages.
- 44:01So, it's meant to be pretty lightweight.
- 44:03Like, that's supposed to be, you know, a couple hours work.
- 44:05What we're really evaluating is the software.
- 44:08So, I'm obviously very supportive of this.
- 44:10I think it's fantastic to be getting credit tied basically immediately to the software.
- 44:15Because that, I think, is a big piece that is missing in academia.
- 44:20But one of the things that I've been really sort of stunned by, I've been with Joss now for almost a year, is just like how, what a positive process it is.
- 44:29You know, I send out requests for reviewers.
- 44:31And people not only say yes, they're very enthusiastic to jump in and learn about projects.
- 44:39I've seen people, like, do small pull requests to fix typos or fix small things.
- 44:44They're writing very well thought out issues.
- 44:48And then the authors are so grateful to have somebody with a fresh set of eyes coming in and looking at what they've done.
- 44:54And so, it's just been such an amazingly positive process in, like, in peer review, which is not something I've really seen elsewhere.
- 45:01Normally, it's like, oh, I don't want to do this, right?
- 45:03No, it's, I think it's a really cool project.
- 45:06And I definitely wanted to give a shout out to it.
- 45:08Because I think it really ties in well with, you know, the way you're thinking about the writing and structuring it in terms of software and open source.
- 45:16And I think this is just the perfect complement to it.
- 45:19Yeah, and related to that, Jose is the Journal of Open Source Education is starting up very soon.
- 45:25In fact, they might actually even be accepting submissions.
- 45:28It's parallel.
- 45:30And I think there's a lot of interesting things sort of from the geoside perspective where we're now thinking about developing open education resources.
- 45:37And they'll be accepting submissions like that.
- 45:39So, a few avenues.
- 45:40Yeah, that's really, really cool.
- 45:41And I definitely think the work that you are doing, even though it sort of found its roots in geophysics, I think it could equally apply to biology or chemistry or lots of things.
- 45:52Hopefully.
- 45:53Yeah, that's the goal.
- 45:54Hopefully.
- 45:54With a slight adaptation.
- 45:56Yeah.
- 45:56Another thing that I ran across doing some research for the show is EarthPy at earthpy.org.
- 46:03So, over at EarthPy, it's a collection of IPython notebooks with examples of earth science and the related Python code.
- 46:10So, if people are listening and they're into geoscience of some sort, like maybe there's some really interesting things to draw from there.
- 46:18Oh, cool.
- 46:19I had not seen that before.
- 46:20So, I will also be checking that out.
- 46:21Yeah, that's really quite neat.
- 46:24What's the IoT story in all of your research?
- 46:29I mean, I can imagine like a bunch of little sensors planted around, but I don't know if you're involved in any of that.
- 46:35I'm not involved in any of that, but there's definitely things coming.
- 46:39There's a lot of interest in looking at the use of drones for smaller scale surveys.
- 46:45I think actually, too, looking at more of the precision farming and precision viticulture for vineyards.
- 46:52I think there's a lot of potential on those smaller scales for bringing in sensors that are giving you much more real-time feedback.
- 47:00And you can make decisions about which areas need to be irrigated or not based on what you're seeing.
- 47:05And you could get that information like, at 2 p.m., it needs to be irrigated, not at 3, right?
- 47:10Yeah, exactly.
- 47:11Like, that kind of, like, super detailed.
- 47:12With the advent of such cheap connected devices, it just seems like, and the ability to program them so easily with Python, right?
- 47:21Like, things like MicroPython and, like, $5 microchips that you can set up.
- 47:27I don't know how long you've run those on battery, but they've got to last a long time.
- 47:30So, it just seems like you could do such great stuff with that.
- 47:34Yeah, and this is something I'm going to be very curious to watch and see what happens over the next few years.
- 47:39Because I think a lot of these ideas are just starting to be worked out.
- 47:42And people are figuring out how to make geophysical sensors a lot smaller.
- 47:45Because that's been a problem for a long time, as they're, in a lot of cases, they're big.
- 47:49But people are making progress.
- 47:50It totally depends on the survey.
- 47:53So, there's some, if you're trying to go out and do a gravity survey, it's very big, slow.
- 47:58Because you need to go out, you need to level it, you need to stay level.
- 48:01If the wind picks up, that's a problem.
- 48:03That's a challenging one.
- 48:04But looking at magnetometers or things like that, people can now start to make them only a few centimeters.
- 48:09So, that's then something that is readily adapted to an IoT application.
- 48:14Yeah, that sounds quite cool.
- 48:16All right, well, I think maybe we'll leave it here for our geophysics talk.
- 48:22But, of course, I have two more questions for you before you go.
- 48:25So, if you're going to write some Python, yeah, if you're going to write some Python code, what editor do you use?
- 48:30Or editors, if you use Horde 1, I guess.
- 48:31Well, it'll be Jupyter and Sublime is the combination I use.
- 48:34Nice.
- 48:35Yeah, I figured Jupyter must be in there.
- 48:37Although, maybe JupyterLab someday.
- 48:38I don't know.
- 48:39I'll see.
- 48:39Yes, absolutely.
- 48:40Nice.
- 48:40And then, notable PyPI package.
- 48:44I mean, we definitely have Simpeg out there, which people can install Simpeg.
- 48:50And that's really cool that it's that easy, right?
- 48:52Yeah.
- 48:52Yeah.
- 48:52So, what else that's, like, really people maybe haven't heard of that would be great?
- 48:56I guess there's two.
- 48:57So, there's Diskretize, which Simpeg is built on.
- 49:00And that does a lot of finite volume meshing and all of that.
- 49:03We've got Octree and Tensor Meshes and Cylindrical Meshes.
- 49:06So, that's an interesting package if you want to simulate PDEs.
- 49:09But one that I'm very excited about is called Properties.
- 49:12And it's, basically, it does, like, strong typing, validation, serialization, all of that in Python.
- 49:19But it does a really good job of helping you design an API that's meant to be interactive.
- 49:24So, in the sense of Jupyter.
- 49:25Like, you want to design an explorable API.
- 49:28Properties is a great package to help you build that.
- 49:31That sounds really cool.
- 49:32And I've never heard of that.
- 49:33That's great.
- 49:34That's why I asked this question.
- 49:35That's awesome.
- 49:38Okay.
- 49:38So, final call to action.
- 49:39Maybe there's educators or scientists out there who would like to adapt some of the work you've done.
- 49:45What would you say to them?
- 49:46Yeah.
- 49:47I mean, I think that if they have ideas and want to contribute directly to any of these resources,
- 49:51we are always keen to have more contributors.
- 49:54I think, too, that, you know, trying to build in a way that promotes community and build in a way that you can invite others to go in and contribute is such a powerful thing to keep in mind.
- 50:05It's because then you yourself don't have to do all of the work.
- 50:08And the end product that comes out is going to be better than any one person could have done.
- 50:13And sort of the parallels to that, then, too, is if you see something that you have ideas about how to contribute to, get involved and get in touch.
- 50:21People are always looking for contributors, and everybody has something to add, even if you don't know how they are approaching it or where to even start.
- 50:28Yeah.
- 50:29It doesn't have to be a major rewrite of some system, right?
- 50:31Like, first contributions can be much, much smaller, just a little thing you can fix, right?
- 50:36Yeah.
- 50:36Absolutely.
- 50:36Absolutely.
- 50:37All right.
- 50:37Well, Lindsay, thank you so much for being on the show and sharing what you're up to.
- 50:40It's been really fun to chat.
- 50:42Thanks, Michael.
- 50:42It's been good.
- 50:43Yeah.
- 50:43And good luck on the dissertation defense.
- 50:45Thank you very much.
- 50:46Yeah.
- 50:46Bye.
- 50:46Bye.
- 50:47This has been another episode of Talk Python To Me.
- 50:51Our guest for this episode has been Lindsay Hagee, and it's brought to you by MongoDB and Anvil.
- 50:57Interested in seeing how web apps are built with Python and MongoDB?
- 51:02Register for my webinar I'm doing with MongoDB over at mongodb.com slash webinar slash Python.
- 51:08See you there.
- 51:10Anvil lets you build your web apps quickly and easily.
- 51:13With Anvil, you can get your web app in Python up and running in hours, not weeks.
- 51:19Want to level up your Python?
- 51:21If you're just getting started, try my Python jumpstart by building 10 apps or our brand new
- 51:26100 days of code in Python.
- 51:28And if you're interested in more than one course, be sure to check out the Everything Bundle.
- 51:32It's like a subscription that never expires.
- 51:35Be sure to subscribe to the show.
- 51:36Open your favorite podcatcher and search for Python.
- 51:39We should be right at the top.
- 51:40You can also find the iTunes feed at /itunes, Google Play feed at /play, and direct
- 51:46RSS feed at /rss on talkpython.fm.
- 51:49This is your host, Michael Kennedy.
- 51:51Thanks so much for listening.
- 51:52I really appreciate it.
- 51:54Now get out there and write some Python code.
- 51:55Thank you.