ItomStubsGenerator

Merged
#55 · Created  · Last updated

Merged pull request

Merged in itomStubsGenerator (pull request #55)

25e1df3·Author: ·Closed by: ·2020-12-04

Description

This pull requests contains the following things:

  • Complete check-up and corrections of all docstrings of the itom module including its classes, methods etc.

  • All docstrings are mostly aligned to max. 88 characters per line (such that help(…) gives a nice output.

  • A styleguide for docstrings is added to the contributing part of the itom documentation

  • All docstrings are layouted with respect to the requirements of numpydoc

  • An old copy of Numpydoc has been removed from the sources of itom. Instead, numpydoc must be installed via pip if the user documentation should be compiled.

  • The python package Jedi, used for auto completion and calltips has difficulties to parse docstrings, contained in C-API modules (like the itom module). Therefore, it is recommended to create stubs (pyi) files for these modules. These stubs files are written in Python syntax and contain all classes and method signatures including type-hints (following the Python typing rules). The content of these methods is not included.

  • An itomStubsGenerator.py module has been added to itom-packages (including a unittest for it). This generator parses the pyi stubs file and stores it to itom-packages/itom-stubs/__init__.py, which is the required location for Jedi to find it.

  • As soon as itomJediLib is used to start an auto completion or calltip, the stubs file for the itom module is searched and - if it exists - checked for the compile date of itom (contained in this file as comment). If the file does not exist or if it is out-of-date, the itomStubsGenerator is started in the background (one time) to generate it.

  • The calltips and auto-completion has been improved. Enable tooltips for auto completion in the itom property dialog to see more improvements.

  • Bugfix: The tooltips for calltips and auto-completion do not dissappear any more if shown at the position of the current cursor.

  • Due to the stubs file, Jedi can now introspect the return types of methods and classes of the itom module. Therefore, the auto completion capabilities are improved.

  • A first, still uncomplete, version of a unittest for itomJediLib has been added.

 

0 attachments

0 comments

Loading commits...