PyDev of the Week: Mark Mikofski

This week we welcome Mark Mikofski (@bwanamarko) as our PyDev of the Week! Mark is a core developer on the pvlib tool, which is used “for simulating the performance of photovoltaic energy systems.” You can check out his page to see Mark’s blog, talks, and more!

pvlib logo

Let’s spend some time getting to know Mark better.

Can you tell us a little about yourself (hobbies, education, etc):

I was raised by a single mother, who herself was raised by a single mother, my grandmother, who was a Cuban immigrant. My mother was a teacher and shared her love of learning with me, especially mathematics. I majored in mechanical engineering, and after 3-years in the US Peace Corps in Tanzania, East Africa, where I taught high school math, I eventually returned to school to complete a master’s and doctorate in mechanical engineering focusing on the formation of harmful emissions from combustion and air quality. My grad school studies were a natural segue into renewables, which is where I’ve been working for the past 15+ years. In my free time, I love to run, climb, read, play guitar, and spend time with my family.

Why did you start using Python?

As an undergraduate, we were taught Pascal, which hasn’t been a particularly useful language, but I had been programming since middle school when I used BASIC on my Atari 600xl, so I loved Pascal anyway. Later I learned MATLAB which became my analysis tool of choice for many years. I had heard rumors about “Python” and even had to install it during grad school to use Cantera a library for studying the thermodynamics of chemical reactions like combustion. However, I thought that Python was a “serious” programming language, in the same league as C/C++ and FORTRAN. I had been exposed to FORTRAN as part of my grad school research, and it was terrifying, so I didn’t want to go anywhere near it. I finally tried Python in 2012, converting an Excel analysis to what eventually became PVMismatch, and I immediately had that a-ha! moment described so well in XKCD’s famous comic. After that I quickly became a Python enthusiast, and started using it for all my analysis.


What other programming languages do you know and which is your favorite?

Other than Python I’m not proficient in any other languages except maybe MATLAB, which I’ve used since undergrad. I’ve dabbled in C# for work, but not because I really wanted to. I also experimented once with Java to make an Android app, but it wasn’t for me. I’ve learned just enough HTML, CSS, and JS so I can make web apps using Django/Flask and Bootstrap, but mainly just for proofs of concepts, and then I let the real developers take over. I can also use SQL but I often have to search the web for help on writing simple queries. I had to write some FORTRAN in grad school, but it was terrifying. I’ve written a few lines of C but I’ve never tried to understand C++. I also sometimes have to wade through some R, but only long enough to rewrite it in Python. I think Julia sounds cool, but I haven’t learned to use it yet. So I guess my favorite language is still just Python.

What projects are you working on now?

pvlib is the main project I contribute to outside of work. It’s a community project for modelling energy from solar-power systems. It’s been really amazing to collaborate with the other maintainers. pvlib started as a MATLAB toolbox developed by Sandia National Laboratories researcher Cliff Hansen and maybe some other folks. Later Rob Andrews, then a PhD student, ported it to Python, and soon after University of Arizona research professor Will Holmgren contributed enough for the v0.1.0 release in 2015. I didn’t make my first contribution until 2016, and it was just a tiny change in the package overview example. Since then, I’ve made more contributions, and I’ve used pvlib more and more in my everyday work. Sometime in 2020 I took a formal role with pvlib, joining the maintainers and focusing mostly on building the pvlib community which has grown to over 600 members from academia, national labs, and industry. Around this time NREL researcher and frequent collaborator, Kevin Anderson also joined the maintainers, we published our JOSS paper, and pvlib became a NumFOCUS-affiliated project. In the last few years, it’s been remarkable to see the enthusiasm of renewable energy analysts when they begin to feel empowered using pvlib and Python in their everyday work to answer questions they didn’t realize were at their fingertips, and to automate processes that previously took hours. We’ve given three pvlib tutorials, including one at PyData Global in 2021 which uses JupyterHub to make it easy and accessible to anyone to get started with pvlib without needing to install anything. I also volunteer with NumFOCUS on the affiliated projects selection committee and Diversity and Inclusion in Scientific Computing (DISC) committee, to make sure these opportunities are available to as many folks as possible and to make sure we are using all of our talents and getting as much cognitive diversity as we can.

Which Python libraries are your favorite (core or 3rd party)?

My favorite 3rd party library is Seaborn for making amazing statistical plots. I’m always so proud of myself when I manage to make what I think is a really amazing Seaborn plot. You might be surprised, but my favorite core library is pathlib. I just love the intuitive reuse of the slash operator to join paths, which is so much more elegant than the older os.path.join(). I also like the calendar core library. No one should ever have to remember how many days are in a particular month or if it’s a leap year. Seriously

What is your elevator pitch for pvlib?

I’ve already said a lot about pvlib, so I’ll use this question to give my elevator pitch for devs, quants, and data scientists in renewables. For folks looking for a new challenge, looking for a way to make a meaningful impact, now is the time to pivot hard to renewables. We don’t have a lot of time before the climate crisis becomes irreversibly much worse than it already is. And the good news is we have solutions, renewable energy, battery storage, green hydrogen, and other clean, carbon-free alternatives are ready today, but we need to deploy them at a massive scale that will require collaboration from industry, government, investors, grid operators, construction, labor, manufacturing, and basically all corners of the US workforce and economy. We will need to deploy over a terawatt of renewable energy into the United States grid by 2035 or basically all of the installed capacity from the last 10 years every year for the next 10 years. That’s over 100 gigawatts per year. We need everyone to get involved, and devs, quants, and data scientists can play a key role. So come join the energy transition.

What are the top 3 things you find most exciting about solar energy or solar technology?

1. The technology is constantly improving so there’s always something new to learn
2. Working in solar energy makes me feel better about the climate crisis, because rather than focusing on our impending doom, I’m working on accelerating the energy transition, and I believe that if enough of us get involved in all sectors of industry and government, that we can make a positive impact.
3. The people in solar are really great. I am constantly overcome with awe by how much people care about each other and about the planet.

Is there anything else you’d like to say?

I just want people to know that they don’t have to know or do anything special to use Python. Anyone can use Python to unlock the potential of digital and computing to supercharge whatever work they’re doing. You don’t have to be a software engineer or developer or computer scientist to use Python. You can replace existing tools in your analysis toolchain with Python, and automate manual processes to analyze many orders of magnitude more data to make statistically significant conclusions. So don’t be afraid, and don’t wait like I did. Just give Python a try today. I really like this zero to hero presentation by Annalise Miller at the PV Performance Modelling Collaborative workshop last month:

Thanks for doing the interview, Mark!