Skip to content

Commit

Permalink
fix documentation generation
Browse files Browse the repository at this point in the history
  • Loading branch information
aperrin66 committed Mar 20, 2024
1 parent 8c1a4d6 commit 0d8a0fa
Show file tree
Hide file tree
Showing 16 changed files with 101 additions and 208 deletions.
7 changes: 5 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
import sys
import os

import django
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tests.settings')
django.setup()
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
Expand Down Expand Up @@ -133,7 +136,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# html_static_path = ['_static']

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down Expand Up @@ -265,4 +268,4 @@


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'http://docs.python.org/': None}
intersphinx_mapping = {'python': ('http://docs.python.org/', None)}
23 changes: 13 additions & 10 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,32 @@ Contents:
:maxdepth: 1
:caption: User documentation

#source/installation.rst
#source/tutorials.rst
#source/packages_and_modules.rst
#source/acknowledgments.rst

..
source/installation.rst
source/tutorials.rst
source/packages_and_modules.rst
source/acknowledgments.rst
.. toctree::
:maxdepth: 2
:caption: Feature documentation

#source/features.rst
..
source/features.rst

.. toctree::
:maxdepth: 2
:caption: Developer documentation

source/extending.rst
source/modules.rst

#source/conventions.rst
#source/about_mappers.rst
#source/release_nansat.rst
#source/documenting.rst
..
source/conventions.rst
source/about_mappers.rst
source/release_nansat.rst
source/documenting.rst


Expand Down
46 changes: 46 additions & 0 deletions docs/source/geospaas.base_viewer.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
geospaas.base_viewer package
============================

Submodules
----------

geospaas.base_viewer.forms module
---------------------------------

.. automodule:: geospaas.base_viewer.forms
:members:
:undoc-members:
:show-inheritance:

geospaas.base_viewer.tests module
---------------------------------

.. automodule:: geospaas.base_viewer.tests
:members:
:undoc-members:
:show-inheritance:

geospaas.base_viewer.urls module
--------------------------------

.. automodule:: geospaas.base_viewer.urls
:members:
:undoc-members:
:show-inheritance:

geospaas.base_viewer.views module
---------------------------------

.. automodule:: geospaas.base_viewer.views
:members:
:undoc-members:
:show-inheritance:


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

.. automodule:: geospaas.base_viewer
:members:
:undoc-members:
:show-inheritance:
12 changes: 0 additions & 12 deletions docs/source/geospaas.nansat_ingestor.tests.rst
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
geospaas.nansat\_ingestor.tests package
=======================================

Submodules
----------

geospaas.nansat\_ingestor.tests.tests module
--------------------------------------------

.. automodule:: geospaas.nansat_ingestor.tests.tests
:members:
:undoc-members:
:show-inheritance:


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

Expand Down
2 changes: 1 addition & 1 deletion docs/source/geospaas.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Subpackages
geospaas.export_DIF
geospaas.nansat_ingestor
geospaas.utils
geospaas.viewer
geospaas.base_viewer
geospaas.vocabularies

Submodules
Expand Down
10 changes: 0 additions & 10 deletions docs/source/geospaas.viewer.management.commands.rst

This file was deleted.

17 changes: 0 additions & 17 deletions docs/source/geospaas.viewer.management.rst

This file was deleted.

46 changes: 0 additions & 46 deletions docs/source/geospaas.viewer.migrations.rst

This file was deleted.

78 changes: 0 additions & 78 deletions docs/source/geospaas.viewer.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/source/modules.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
geospaas
Modules documentation
========

.. toctree::
Expand Down
2 changes: 1 addition & 1 deletion geospaas/base_viewer/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def test_post_without_polygon(self, mock_django_settings):

def test_post_without_polygon_public_version(self):
"""shall not reveal the uri of fixtures' datasets (presumably confidential) in the specified
placement of datasets inside the resulted HTML in the case of a POST request without
placement of datasets inside the resulted HTML in the case of a POST request without
any polygon from user """
res = self.client.post('/tests/', {
'time_coverage_start': timezone.datetime(2000, 12, 29),
Expand Down
24 changes: 12 additions & 12 deletions geospaas/catalog/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,24 +106,24 @@ class Dataset(models.Model):
Fields:
-------
entry_id : TextField
:entry_id: TextField.
A unique dataset ID. Only alphanumeric characters are allowed.
entry_title : CharField
parameters: ManyToManyField to Parameter
ISO_topic_category : ForeignKey to ISOTopicCategory
data_center : ForeignKey to DataCenter
summary : TextField
:entry_title: CharField
:parameters: ManyToManyField to Parameter
:ISO_topic_category: ForeignKey to ISOTopicCategory
:data_center: ForeignKey to DataCenter
:summary: TextField.
In addition to some general information, the summary should also
contain information about the project from/for which the data was
collected/created
source : ForeignKey to Source
:source: ForeignKey to Source
Contains information about the instrument and platform by which the
data was collected
time_coverage_start : DateTimeField
time_coverage_end : DateTimeField
geographic_location : ForeignKey to GeographicLocation
gcmd_location : ForeignKey to vocabularies.models.Location
access_constraints : CharField
:time_coverage_start: DateTimeField
:time_coverage_end: DateTimeField
:geographic_location: ForeignKey to GeographicLocation
:gcmd_location: ForeignKey to vocabularies.models.Location
:access_constraints: CharField.
Determines the access level of the Dataset: Limited, In-house, or Public
'''
ACCESS_LEVEL0 = 'accessLevel0'
Expand Down
7 changes: 4 additions & 3 deletions geospaas/nansat_ingestor/management/commands/ingest_hyrax.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import os
import time
import re
import urllib2
import urllib.error
import urllib.request

from django.core.management.base import BaseCommand, CommandError

Expand All @@ -24,7 +25,7 @@ def find_netcdf_uris(uri0, sleep=1.0):
print('Search in ', uri0_base)
# get HTML from the URL
time.sleep(sleep)
response = urllib2.urlopen(uri0)
response = urllib.request.urlopen(uri0)
html = response.read()

# find all links to netDCF
Expand All @@ -38,7 +39,7 @@ def find_netcdf_uris(uri0, sleep=1.0):
try:
for uri in uris:
nc_uris += find_netcdf_uris(uri)
except (urllib2.HTTPError, urllib2.URLError) as e:
except (urllib.error.HTTPError, urllib.error.URLError) as e:
print('Server error %s'%e.message)
# return all links to netCDF
return nc_uris
Expand Down
4 changes: 2 additions & 2 deletions geospaas/nansat_ingestor/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def get_or_create(self,
""" Create dataset and corresponding metadata
Parameters:
----------
-----------
uri : str
URI to file or stream openable by Nansat
n_points : int
Expand All @@ -41,7 +41,7 @@ def get_or_create(self,
type of the service which is used ('OPENDAP', 'local', 'HTTPServer' or 'WMS')
Returns:
-------
--------
dataset and flag
"""
if not uri_filter_args:
Expand Down
Loading

0 comments on commit 0d8a0fa

Please sign in to comment.