-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Create pvlib.iotools.read_panond
for reading .pan and .ond files
#1749
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
Conversation
Thanks @ckrening! A few initial high-level comments:
|
Other energy modeling software also accepts pan/ond, so I'm not so sure that we should tie the pvsyst name to the format. PV*SOL documentation contains this interesting tidbit
In the long run I'd like to see a set of DataClasses, but I'm good with nested dictionaries in this PR. |
Panond to ckrening main
addressing stickler comments
stickler comments v3
stickler comment correction
Thanks @kandersolar. I made the stickler corrections and updated testing docs. The only thing on the checklist I am not sure I conform to are the Maintainer: Appropriate GitHub labels. Finally, I decided to stick with the panond name for the reasons outlined by @wholmgren. I am not attached to panond as a name and it can easily be changed. It's more important to me that the functionality is included. |
More bike shedding: I’m -1 on |
What else could go into this module in the future? That could influence the name. |
In About other data sources, I'll note that SAM can write inputs and model configurations to JSON files. |
@ckrening is this ready to run tests? |
@cwhanse the code is ready to run tests. I have included one sample .pan and .ond. |
Updated notes and comments
flake8 formatting
Flake8 formatting
@kandersolar regarding the 'End of...' keys in the dictionary, my goal was to modify the file as little as possible. So, I decided to keep those in the dictionary, in the event someone had a use for them. Though I agree, I cannot think of a great use for them. |
I did a bit of doc cleanup and test improvements. I think this is ready to go but I think another review from someone else is warranted. @AdamRJensen and/or @cwhanse? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks @ckrening and @kandersolar
Co-authored-by: Cliff Hansen <[email protected]>
pvlib/iotools/panond.py
Outdated
def parse_panond(fbuf): | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would vote than we only have a read_panond
function and eliminate the parse_panond
.
We can always create a parse_panond
function in the future, but it's annoying to deprecate it.
I believe the reasoning for having the parse
function is to avoid duplicate code when you have a get
and read
function that need similar data handling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point that no get
makes parse
less relevant. Aside from supporting get
, parse
is also helpful when file contents might be already in-memory (retrieved from a database or cloud storage, e.g.) instead of a file on disk. Is that helpful for PAN/OND files? The use cases I can think of feel rather contrived. I will make the parse function private.
pvlib.iotools.read_panond
for reading .pan and .ond files
Thanks @ckrening ! |
Probably should have added a mention of this new function in the FAQ concerning PAN/OND files. @kandersolar Should I open a new PR or do you want to reopen this PR? |
This PR did edit that FAQ entry :) check |
docs/sphinx/source/whatsnew
for all changes. Includes link to the GitHub Issue with:issue:`num`
or this Pull Request with:pull:`num`
. Includes contributor name and/or GitHub username (link with:ghuser:`user`
).remote-data
) and Milestone are assigned to the Pull Request and linked Issue.First time contributing. So, I may need some extra assistance. I filled out the checklist as best as I could but have left comments where I need some guidance. Please assist with the code documentation, whatsnew comments and setting up appropriate test document.
Proposed change is to add a reader and parser function for .pan and .ond files for the #1747 topic. the reader takes a filepath and creates a nested dictionary from the file contents. I am more than happy to address any concerns in the methods I chose.