diff --git a/docs/source/_templates/autoapi/python/module.rst b/docs/source/_templates/autoapi/python/module.rst new file mode 100644 index 000000000..28579a976 --- /dev/null +++ b/docs/source/_templates/autoapi/python/module.rst @@ -0,0 +1,98 @@ +{% if not obj.display %} +:orphan: + +{% endif %} +:py:mod:`{{ obj.name }}` +=========={{ "=" * obj.name|length }} + +.. py:module:: {{ obj.name }} + +{% if obj.docstring %} +.. autoapi-nested-parse:: + + {{ obj.docstring|indent(3) }} + +{% endif %} + +{% block submodules %} +{% set visible_submodules = obj.submodules|selectattr("display")|list %} +{% if visible_submodules %} +Submodules +---------- +.. toctree:: + :titlesonly: + :maxdepth: 1 + +{% for submodule in visible_submodules %} + {{ submodule.short_name }}/index.rst +{% endfor %} + + +{% endif %} +{% endblock %} +{% block content %} +{% if obj.all is not none %} +{% set visible_children = obj.children|selectattr("short_name", "in", obj.all)|list %} +{% elif obj.type is equalto("package") %} +{% set visible_children = obj.children|selectattr("display")|list %} +{% else %} +{% set visible_children = obj.children|selectattr("display")|rejectattr("imported")|list %} +{% endif %} +{% if visible_children %} +{{ obj.type|title }} Contents +{{ "-" * obj.type|length }}--------- + +{% set visible_classes = visible_children|selectattr("type", "equalto", "class")|list %} +{% set visible_functions = visible_children|selectattr("type", "equalto", "function")|list %} +{% set visible_attributes = visible_children|selectattr("type", "equalto", "data")|list %} +{% if "show-module-summary" in autoapi_options and (visible_classes or visible_functions) %} +{% block classes scoped %} +{% if visible_classes %} +Classes +~~~~~~~ + +.. autoapisummary:: + +{% for klass in visible_classes %} + {{ klass.id }} +{% endfor %} + + +{% endif %} +{% endblock %} + +{% block functions scoped %} +{% if visible_functions %} +Functions +~~~~~~~~~ + +.. autoapisummary:: + +{% for function in visible_functions %} + {{ function.id }} +{% endfor %} + + +{% endif %} +{% endblock %} + +{% block attributes scoped %} +{% if visible_attributes %} +Attributes +~~~~~~~~~~ + +.. autoapisummary:: + +{% for attribute in visible_attributes %} + {{ attribute.id }} +{% endfor %} + + +{% endif %} +{% endblock %} +{% endif %} +{% for obj_item in visible_children %} +{{ obj_item.render()|indent(0) }} +{% endfor %} +{% endif %} +{% endblock %} diff --git a/docs/source/conf.py b/docs/source/conf.py index 0ac93f461..5146cece5 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -54,25 +54,23 @@ "members", "undoc-members", "show-inheritance", + "show-module-summary", "imported-members", ] autoapi_ignore = [ "**/tests/**", "**/native/**", "**/internal/**", - "**/\\w.*.py", ] - -# autoapi_member_order = "groupwise" -autodoc_typehints = "both" -autoapi_python_class_content = "both" - -add_module_names = False - autoapi_add_toctree_entry = False +autoapi_python_class_content = "class" +autoapi_template_dir = "_templates/autoapi" +autoapi_member_order = "groupwise" +autoapi_python_use_implicit_namespaces = True +add_module_names = False -def skip_submodules(app, what, name, obj, skip, options): +def skip_rules(app, what, name, obj, skip, options): if what == "module": skip = True if what == "method": @@ -86,8 +84,7 @@ def skip_submodules(app, what, name, obj, skip, options): def setup(sphinx): - sphinx.connect("autoapi-skip-member", skip_submodules) - + sphinx.connect("autoapi-skip-member", skip_rules) # -- Automatic execution of jupyter notebooks -------------------------------- nb_execution_excludepatterns = [] diff --git a/python_modules/jupedsim/jupedsim/__init__.py b/python_modules/jupedsim/jupedsim/__init__.py index d0cdc9367..b923adefe 100644 --- a/python_modules/jupedsim/jupedsim/__init__.py +++ b/python_modules/jupedsim/jupedsim/__init__.py @@ -15,11 +15,6 @@ distribute_until_filled, ) from jupedsim.geometry import Geometry -from jupedsim.geometry_utils import ( - _geometry_from_coordinates, - _geometry_from_shapely, - _geometry_from_wkt, -) from jupedsim.internal.tracing import Trace from jupedsim.journey import JourneyDescription, Transition from jupedsim.library import ( @@ -64,10 +59,22 @@ ) __version__ = get_build_info().library_version +""" +The version of this module. +""" + __commit__ = get_build_info().git_commit_hash +""" +Commit id that was used to build this module. +""" + __compiler__ = ( f"{get_build_info().compiler} ({get_build_info().compiler_version})" ) +""" +Id of the compiler used to build the native portion of this module. +""" + __all__ = [ "Agent", @@ -113,9 +120,6 @@ "distribute_in_circles_by_density", "distribute_in_circles_by_number", "distribute_until_filled", - "_geometry_from_coordinates", - "_geometry_from_shapely", - "_geometry_from_wkt", "get_build_info", "set_debug_callback", "set_error_callback", diff --git a/python_modules/jupedsim/jupedsim/models/__init__.py b/python_modules/jupedsim/jupedsim/models/__init__.py new file mode 100644 index 000000000..e69de29bb