pvlib-python icon indicating copy to clipboard operation
pvlib-python copied to clipboard

Binary style PAN file Reader

Open kurt-rhee opened this issue 5 months ago • 6 comments

  • [x] Closes #2504
  • [x] I am familiar with the contributing guidelines
  • [ ] Tests added -- No tests were added
  • [x] Updates entries in docs/sphinx/source/reference for API changes.
  • [x] Adds description and name entries in the appropriate "what's new" file in 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`).
  • [x] New code is fully documented. Includes numpydoc compliant docstrings, examples, and comments where necessary.
  • [x] Pull request is nearly complete and ready for detailed review.
  • [x] Maintainer: Appropriate GitHub Labels (including remote-data) and Milestone are assigned to the Pull Request and linked Issue.

A reader for pan files in the older binary style format

kurt-rhee avatar Jul 29 '25 20:07 kurt-rhee

I am not sure why pytest is failing on windows-latest 3.9

kurt-rhee avatar Jul 30 '25 13:07 kurt-rhee

I am not sure why pytest is failing on windows-latest 3.9

Ignore that one, it's failing on all branches the last day or two.

kandersolar avatar Jul 30 '25 13:07 kandersolar

PVsyst does not object to adding this capability to pvlib. They emphasize that they will not provide technical support for pvlib users.

cwhanse avatar Aug 13 '25 15:08 cwhanse

That is very nice and also reasonable of them.

kurt-rhee avatar Aug 13 '25 15:08 kurt-rhee

I compared the results of reading the two PAN files (one binary, one text) that @williamhobbs provided in #2504 and found the following potential errors:

  • Source may be missing the final character (W Hobb vs W Hobbs)
  • Year's value is 'Si'?
  • Cells_In_Series and Cells_In_Parallel perhaps ought to be converted from str to int
  • CellArea is -9984.00000089407?
  • Isc, muIsc, etc are slightly off, somehow. more than you'd expect even for single-precision floats
  • Rshunt: 300 instead of 500?
  • no gamma, mu_gamma?

Another thing: neither file has an IAM profile, which means a big chunk of code is not being exercised. I wonder if we could lean a bit more on @williamhobbs's goodwill to produce a file with an IAM profile?

One more thing: I bet the struct module offers a succinct replacement for the verbose bit-fiddling parts of this code.

kandersolar avatar Sep 30 '25 14:09 kandersolar

@kandersolar, here are two more sample .pan files in a .zip. One had the option to be compatible with versions < 6.40 selected, the other without. I enabled IAM and added module dimensions, plus a few other changes. Let me know if screenshots to confirm inputs would help, or if you have other feedback/suggestions.

samples3.zip

williamhobbs avatar Oct 02 '25 17:10 williamhobbs