gemseo / utils

Hide inherited members

source_parsing module

Parse source code to extract information.

gemseo.utils.source_parsing.get_callable_argument_defaults(callable_)[source]

Return the default values of the kwargs of a callable.

Parameters:
  • callable – The callable.

  • callable_ (Callable) –

Returns:

The defaults if any, an empty dictionary otherwise.

Return type:

dict[str, Any]

gemseo.utils.source_parsing.get_default_option_values(cls)[source]

Return the default values of the kwargs of a class constructor.

Parameters:

cls (type) – The class.

Returns:

The defaults.

Return type:

dict[str, str]

gemseo.utils.source_parsing.get_options_doc(method)[source]

Get the documentation of a method.

Parameters:

method (Callable) – The method to retrieve the doc from.

Returns:

The descriptions of the options.

Return type:

dict[str, str]

gemseo.utils.source_parsing.parse_google(docstring)[source]

Parse a Google docstring.

Parameters:

docstring (str) – The docstring to be parsed.

Returns:

The parsed docstring with the function arguments names bound to their descriptions.

Return type:

dict[str, str]

gemseo.utils.source_parsing.parse_rest(docstring)[source]

Parse a reST docstring.

Parameters:

docstring (str) – The docstring to be parsed.

Returns:

The parsed docstring.

Return type:

dict[str, str]