openclimatefix / pv-site-datamodel

Datamodel for PV sites
MIT License
2 stars 12 forks source link

Alter Site model's `capacity_kw` column to support null values #46

Closed AndrewLester closed 1 year ago

AndrewLester commented 1 year ago

Alter Site model's capacity_kw column to support null values (by making the field nullable). Other alternatives could be discussed.

Detailed Description

Context: I'm with the Hack4Impact UIUC team working on the https://github.com/openclimatefix/pv-sites-mobile repo, and we'll be giving users the chance to submit their max production capacity for their own sites. After some discussion, we've determined that this should be optional for users who might not know such information, so they can see just percent yield. Thus, we'd think the above change could let us support these users.

If this isn't possible for data generation purposes, there a few alternatives we had thought of: creating a boolean field to store whether their capacity is "real", or just putting in "1". If we store 1 in this field by default, we'd miss out on the context in the section below (though it's not of upmost importance).

Further Context

The goal here is to store whether or not a user's site has a real capacity available, so that in our UI we allow the user to see real power output (and block that if they don't have one, since it doesn't make sense to show it).

Possible Implementation

Not sure how this proposed change (making the attribute nullable) would propagate through the pv-site prediction system you have set up, so I can't say if the suggested implementation is at all feasible or accurate.

peterdudfield commented 1 year ago

Hey @AndrewLester thanks for getting in contact.

Would you be able to explain more why users would not know their site capacity? I would have thought they would at least know a guess for their site.

AndrewLester commented 1 year ago

@peterdudfield, thanks for your response. I think the core reason for this feature is that we want the new site to be accessible to the widest possible audience. People whose panels were set up for them, and who might not have available inverter data, could use the percent yield. @dantravers suggested we go with one of the workarounds I mentioned above: just setting their capacity_kw to 1. This would give us appropriate data (% yield), but would leave our UI with no way to know whether to hide the power units.

Let me know what you think of this additional context, and whether or not you think the workaround makes more sense. We could consider that a capacity_kw of exactly 1 might be rare, and use it as a signal for our UI.

peterdudfield commented 1 year ago

Yea, fair enough. Probably the best think is to allow capacity_kw to be Null, and then the UI decided what there is to do.

I think it would not be too long, until someone uses a site capacity that is actually 1.

@devsjc would you be able to adjust the capacity_kw to be nullable in the datamodel. Ill add an issue in the API

devsjc commented 1 year ago

Done with https://github.com/openclimatefix/pv-site-datamodel/pull/50!