Skip to content

Commit

Permalink
Merge pull request #11 from jaspersiebring/sphinx_docs
Browse files Browse the repository at this point in the history
Replaced MkDocs with Sphinx
  • Loading branch information
jaspersiebring authored Sep 26, 2023
2 parents 088115c + 9a14bbf commit 91c7826
Show file tree
Hide file tree
Showing 11 changed files with 711 additions and 82 deletions.
24 changes: 24 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: 2

build:
os: "ubuntu-22.04"
tools:
python: "3.10"
jobs:
post_create_environment:
# Install poetry
# https://python-poetry.org/docs/#installing-manually
- pip install poetry
# Tell poetry to not use a virtual environment
- poetry config virtualenvs.create false
post_install:
# Install dependencies with 'docs' dependency group
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
- poetry install --with dev

pre_build:
# Generating full API spec for geococo
- sphinx-apidoc -o docs/ geococo/

sphinx:
configuration: docs/conf.py
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
![geococo logo](https://github.com/jaspersiebring/GeoCOCO/assets/25051531/b2a2db16-1400-4c43-b044-a924a378ef84)
---

[![PyPI](https://img.shields.io/pypi/v/geococo)](https://pypi.org/project/geococo/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/geococo)
[![Build passing](https://github.com/jaspersiebring/GeoCOCO/actions/workflows/main.yml/badge.svg)](https://github.com/jaspersiebring/GeoCOCO/actions/workflows/main.yml)
[![Documentation Status](https://readthedocs.org/projects/geococo/badge/?version=latest)](https://geococo.readthedocs.io/en/latest/?badge=latest)

Easily transform your GIS annotations into [Microsoft's Common Objects In Context (COCO)](https://cocodataset.org/#format-data) datasets with GeoCOCO. This tool allows users to leverage the advanced digitizing solutions of modern GIS software for the annotations of image objects in geographic imagery.

Built with `Pydantic` and `pycocotools`, it features a complete implementation of the COCO standard for object detection with out-of-the-box support for JSON-encoding and RLE compression. The resulting datasets are versioned, easily extendable with new annotations and fully compatible with other data applications that accept the COCO format.

# Key features
## Key features
- User-friendly: GeoCOCO is designed for ease of use, requiring minimal configuration and domain knowledge
- Version Control: Datasets created with GeoCOCO are versioned and designed for expansion with future annotations
- Command-line Tool: Use GeoCOCO from your terminal to create, append and copy COCO datasets
Expand All @@ -17,7 +18,7 @@ Built with `Pydantic` and `pycocotools`, it features a complete implementation o
- COCO Standard: Output datasets are fully compatible with other COCO-accepting applications
- Compact File Size: JSON-encoding and RLE compression are employed to ensure compact file sizes

# Installation
## Installation
Installing from the Python Package Index (PyPI):
````
# Install from PYPI with Python's package installer (pip)
Expand Down
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
37 changes: 37 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

import os
import sys
sys.path.insert(0, os.path.abspath('..'))

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'geococo'
copyright = '2023, Jasper Siebring'
author = 'Jasper Siebring'
release = '0.5.2'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary',
'myst_parser'
]

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']



# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
61 changes: 61 additions & 0 deletions docs/geococo.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
geococo package
===============

Submodules
----------

geococo.cli module
------------------

.. automodule:: geococo.cli
:members:
:undoc-members:
:show-inheritance:

geococo.coco\_manager module
----------------------------

.. automodule:: geococo.coco_manager
:members:
:undoc-members:
:show-inheritance:

geococo.coco\_models module
---------------------------

.. automodule:: geococo.coco_models
:members:
:undoc-members:
:show-inheritance:

geococo.coco\_processing module
-------------------------------

.. automodule:: geococo.coco_processing
:members:
:undoc-members:
:show-inheritance:

geococo.utils module
--------------------

.. automodule:: geococo.utils
:members:
:undoc-members:
:show-inheritance:

geococo.window\_schema module
-----------------------------

.. automodule:: geococo.window_schema
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: geococo
:members:
:undoc-members:
:show-inheritance:
20 changes: 20 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
GeoCOCO: Transform your GIS annotations into COCO datasets
============================================================

Easily transform your GIS annotations into `Microsoft's Common Objects In Context (COCO) <https://cocodataset.org/#format-data>`_ datasets with GeoCOCO. This tool allows users to leverage the advanced digitizing solutions of modern GIS software for the annotations of image objects in geographic imagery.

Built with `Pydantic` and `pycocotools`, it features a complete implementation of the COCO standard for object detection with out-of-the-box support for JSON-encoding and RLE compression. The resulting datasets are versioned, easily extendable with new annotations and fully compatible with other data applications that accept the COCO format.

.. toctree::
:maxdepth: 2
:caption: Table of contents

Quickstart <quickstart>
GeoCOCO API Reference <geococo>

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
7 changes: 7 additions & 0 deletions docs/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
geococo
=======

.. toctree::
:maxdepth: 4

geococo
4 changes: 4 additions & 0 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
GeoCOCO: Transform your GIS annotations into COCO datasets
============================================================
.. include:: ../README.md
:parser: myst_parser.sphinx_
Loading

0 comments on commit 91c7826

Please sign in to comment.