Syntax error in PySAM stubs?

  • Matan
  • Topic Author
More
08 Jul 2020 16:56 - 08 Jul 2020 22:49 #8407 by Matan
Syntax error in PySAM stubs? was created by Matan
Hello,

I am trying to use mypy for static type checking my code, which implements PvwattsV7. mypy should be able to infer the typing on the Pvwatts api from the PVwatts7.pyi stub file. When I run mypy, I get this error.
python3.7/site-packages/PySAM-stubs/Pvwattsv7.pyi:5: error: invalid syntax
Taking a look at the Pvwattsv7.pyi file, I came across what I think is a syntax error pretty quickly. Any function that has a type hint for an output is missing an end of line colon. ie.



Is this a syntax error?

Best,

Matan Guttmann
Last edit: 08 Jul 2020 22:49 by Paul Gilman.

Please Log in or Create an account to join the conversation.

  • dguittet
More
10 Jul 2020 22:59 #8418 by dguittet
Replied by dguittet on topic Syntax error in PySAM stubs?
Hi Matan,

Yes it looks like a syntax error with the missing colon, thanks for reporting! I've fixed the issue as reported here:  github.com/NREL/pysam/issues/47

I'll be releasing a new package version within a few weeks, so will not have fixed stub files available until then.

However, if you would like to have those fixes now, you can copy the updated files in the folder here into 
python3.7/site-packages/PySAM-stubs
Best,

Darice

Please Log in or Create an account to join the conversation.

  • Matan
  • Topic Author
More
13 Jul 2020 16:49 #8423 by Matan
Replied by Matan on topic Syntax error in PySAM stubs?
Hello Darice,

Thank you so much for the quick reply! I will just wait for the next release, and do a 
type-ignore
until then.

Best,

Matan

Please Log in or Create an account to join the conversation.

Moderators: Paul Gilman
Powered by Kunena Forum