Syntax error in PySAM stubs?

  • matan
  • Topic Author
More
08 Jul 2020 10:56 - 08 Jul 2020 16: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.
Code:
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 16:49 by pgilman.

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

  • dguittet
More
10 Jul 2020 16: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 
Code:
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 10: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 
Code:
type-ignore
until then.

Best,

Matan

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

Moderators: pgilman
Powered by Kunena Forum