idaes-pse icon indicating copy to clipboard operation
idaes-pse copied to clipboard

Provide support for dynamically generated classes and __init__ options for IDE autocompletion, etc

Open lbianchi-lbl opened this issue 10 months ago • 2 comments

  • The way ProcessBlock subclasses are dynamically created through the @declare_process_block_class decorator is not compatible with tools that rely on static analysis of the code
  • This includes pylint, which prompted my initial analysis of the problem (see FIXME for details), and ultimately required the creation of a (fairly complex) pylint plugin
  • This also includes code IDEs, which severely limits the hints that can be provided to the user, in turn limiting the usability of IDAES as a platform
  • Changing the current API to one that's more friendly to static analysis is not a viable option because of backward compatibility concerns and the amount of effort it would require
  • To address this, I'm currently investigating a solutions based on type stub files (.pyi), which are companion files distributed alongside the code that allow providing type annotation information without modifying the actual code

lbianchi-lbl avatar Dec 12 '24 19:12 lbianchi-lbl