SunPower / pvfactors

:sunny: Open-source view-factor model for diffuse shading and bifacial PV modeling. Documentation:
http://sunpower.github.io/pvfactors/
BSD 3-Clause "New" or "Revised" License
81 stars 22 forks source link

`ax` parameter of BasePVArray.plot_at_idx should be optional #142

Open kandersolar opened 2 years ago

kandersolar commented 2 years ago

It would be a minor convenience if BasePVArray.plot_at_idx could generate its own pyplot Axes object instead of forcing the user to pass one in. I don't mind keeping it as a required parameter in the plot_at_idx methods of other classes, but since BasePVArray is at the top of the tree and likely the one that people will be calling, it makes sense to me for it to be a special case.

It's also convenient that ax is currently the last required parameter, so there's no need to reorder parameters, just tack =None onto the parameter and do a quick check in the method body. However, since the method currently doesn't return anything, the user would have to use plt.gca() or similar to access the plot object, so it might make sense to start returning ax at the end of the method too.