-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow prefix construction #17
Comments
Interesting. Incidentally, to me, poa_global_meas seems better. We could add prefix versions, but the whole point of this project is to have one common name for each quantity. I'm open to changing variable names, but we should keep just one variable name for each quantity as much as possible. @cwhanse , what do you think? |
Perhaps part of the difference is what one might use for variables and parameters in code vs what one might use in a database or for column names. PV-terms doesn't seem to specify one or the other application. From the RdTools perspective, we never try to assume column names and leave parsing and interfacing to the analyst. Especially in python, I prefer the code to read like a sentence wherever possible, so in this example, we would always write or say "measured global plane of array irradiance" rather than "plane of array irradiance global measured". Ultimately some of these things seem to come down to preference... |
I agree that we should keep one name for each quantity. For the record, I disagree with using suffixes (with few exceptions) to communicate metadata about the quantity. If we don't use suffixes we won't have the issue @mdeceglie raises :) Appending We had a discussion at one point about "sentence style vs. taxonomy style", which I think resulted in no decision other than to adopt what is in popular use. Hence We also discussed the intended use of pv-terms, which we agreed was for python but not programmatic variables or database keys. I think it's optimistic to hope for both uses, and we might want to focus on one or the other. |
Thanks @cwhanse. Can you say more about the intended use? I'm not sure I follow "for python but not programmatic variables". We have a PR in RdTools about aligning function parameters with pv-terms, is this an intended application? In case it is an intended application, I'm not sure I understand how to communicate the metadata in a separate data structure. The docstring seems appropriate, but ultimately we'll still need unique names for the parameters. For example, would you have a recommendation for how to name parameters in a function definition that needs simulated clearsky global POA irradiance and measured global POA irradiance? Our existing parameters are |
By "We also discussed the intended use of pv-terms, which we agreed was for python but not programmatic variables or database keys. " I only meant that we discussed whether PV-terms is intended to provide variable names for programming, keys for databases, or both; but I don't recall a consensus. Style conventions for python variables are somewhat more strict than conventions for database keys, e.g., variables are lower case with only underscores, whereas key values are strings where it's not unusual to include spaces, capital letters, parenthesis, percent signs, etc. Your point about two different POA irradiance values living in the same namespace is well-taken, I hadn't considered that case. I should relent a bit on my objections to suffixes, because that's probably what I would do in a function that e.g. calculates a clearsky index for POA irradiance, using |
That's exactly the reason for the suffixes. We want to make a form that's usable. For some applications, just having the The main motivation for pv-terms is so all the packages can talk to one another as best as possible. So, if Rdtools uses Regarding taxonomy vs. readable style, we went back and forth on this, and decided to use whatever made the most sense for each set of variables. If a variable is often modified (e.g. @mdeceglie if you want to change the standard naming for some variables I'm open to it. We just have to make sure it is somewhat consistent. |
In some cases the suffix construction required by pv-terms reduces code readability. Example
In this case
meas_global_poa
is more readable thanpoa_global_meas
.Allowing for prefix or suffix construction will allow projects seeking to use pv-terms more flexibility to meet their respective needs.
The text was updated successfully, but these errors were encountered: