Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 3.9.2 #485

Merged
merged 23 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b90414d
Merge pull request #459 from sentinel-hub/master
zigaLuksic May 5, 2023
c112f0f
Merge pull request #462 from sentinel-hub/master
zigaLuksic May 8, 2023
eb60dac
Improve data_utils (#463)
chorng May 9, 2023
540c46c
fix byoc test to also check for accountId (#464)
zigaLuksic May 15, 2023
43181ef
Add new options for AWS credentials in batch statistical API (#465)
zigaLuksic May 15, 2023
cf46a2d
run scheduled action as a reusable workflow
May 22, 2023
7584a14
Merge pull request #467 from sentinel-hub/fix-failing-builds-issue
May 22, 2023
3cacec9
adjust schedule to reroute emails (#468)
zigaLuksic May 22, 2023
b684ab7
Switch to ruff (#469)
zigaLuksic May 25, 2023
0c4dd22
Add changelog (#471)
zigaLuksic May 26, 2023
6a47a49
disable code coverage calculation unless necessary (#472)
zigaLuksic Jun 12, 2023
bef8a48
generalize sentinelhub feature iterator (#473)
zigaLuksic Jun 26, 2023
b13b1eb
Updated link from OSEO to NoR.
batic Jul 6, 2023
1ccd59e
Merge pull request #475 from sentinel-hub/fix/research_accounts_docs
batic Jul 6, 2023
7971a76
Fix mypy issues (#476)
zigaLuksic Jul 24, 2023
eca6741
Added QUALITY_FLAGS band to S3_OLCI (#477)
jonasViehweger Aug 1, 2023
c008c11
Update pre-commit and apply suggested changes (#478)
zigaLuksic Aug 4, 2023
184adde
Simplify docs (#479)
zigaLuksic Aug 22, 2023
7a36f8f
try fixing the newly found mypy issue (#480)
zigaLuksic Sep 25, 2023
0c68085
add disable comments for pylint (#481)
zigaLuksic Oct 3, 2023
9c8a0e2
add comment to ignore mypy mistake (#482)
zigaLuksic Oct 11, 2023
e4f9a31
Adjust how client credentials are sent to token service (#483)
zigaLuksic Oct 24, 2023
e757999
Prepare for release (#484)
zigaLuksic Oct 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .flake8

This file was deleted.

10 changes: 6 additions & 4 deletions .github/workflows/ci_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ on:
branches:
- "master"
- "develop"
schedule:
# Schedule events are triggered by whoever last changed the cron schedule
- cron: "5 0 * * *"
workflow_call:

concurrency:
# This will cancel outdated runs on the same pull-request, but not runs for other triggers
Expand Down Expand Up @@ -98,7 +96,11 @@ jobs:
--instance_id "${{ secrets.INSTANCE_ID }}" \
--aws_access_key_id "${{ secrets.AWS_ACCESS_KEY_ID }}" \
--aws_secret_access_key "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
pytest --cov --cov-report=term --cov-report=xml
if [ ${{ github.event_name }} == 'push' ]; then
pytest --cov --cov-report=term --cov-report=xml
else
pytest
fi

- name: Run reduced tests
if: ${{ !matrix.full_test_suite }}
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/scheduled_caller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: scheduled build caller

on:
schedule:
# Schedule events are triggered by whoever last changed the cron schedule
- cron: "0 0 * * *"

jobs:
call-workflow:
uses: sentinel-hub/sentinelhub-py/.github/workflows/ci_action.yml@develop
secrets: inherit
37 changes: 7 additions & 30 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: end-of-file-fixer
- id: requirements-txt-fixer
Expand All @@ -13,41 +13,18 @@ repos:
- id: debug-statements

- repo: https://github.com/psf/black
rev: 23.1.0
rev: 23.10.1
hooks:
- id: black
language_version: python3

- repo: https://github.com/pycqa/isort
rev: 5.12.0
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.1.1"
hooks:
- id: isort
name: isort (python)

- repo: https://github.com/PyCQA/autoflake
rev: v2.0.1
hooks:
- id: autoflake
args:
[
--remove-all-unused-imports,
--in-place,
--ignore-init-module-imports,
]

- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear==23.2.13
- flake8-comprehensions==3.10.1
- flake8-simplify==0.19.3
- flake8-typing-imports==1.14.0
- id: ruff

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.6.3
rev: 1.7.0
hooks:
- id: nbqa-black
- id: nbqa-isort
- id: nbqa-flake8
- id: nbqa-ruff
14 changes: 9 additions & 5 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.11"

sphinx:
configuration: docs/source/conf.py

python:
version: 3.8
install:
- method: pip
path: .
extra_requirements:
- docs
- method: pip
path: .
extra_requirements:
- docs
530 changes: 530 additions & 0 deletions CHANGELOG.MD

Large diffs are not rendered by default.

140 changes: 11 additions & 129 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*- # noqa: UP009
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config

# -- Path 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.
#
import contextlib
import os
import shutil
Expand All @@ -20,7 +14,6 @@

# -- Project information -----------------------------------------------------

# General information about the project.
project = "Sentinel Hub"
project_copyright = "2017, Sinergise"
author = "Sinergise EO research team"
Expand All @@ -41,13 +34,6 @@

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
Expand All @@ -66,7 +52,7 @@
# Include typehints in descriptions
autodoc_typehints = "description"

# Both the class and the __init__ methods docstring are concatenated and inserted.
# Both the class' and the __init__ method's docstring are concatenated and inserted.
autoclass_content = "both"

# Content is in the same order as in module
Expand All @@ -77,21 +63,12 @@

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = ".rst"

# The master toctree document.
master_doc = "index"

# General information about the project.


# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
# The language for content autogenerated by Sphinx.
language = "en"

# List of patterns, relative to source directory, that match files and
Expand All @@ -102,123 +79,32 @@
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True

# Mock imports that won't and don't have to be installed in ReadTheDocs environment
autodoc_mock_imports = ["boto3", "botocore", "pytest"]

# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"

html_logo = "./sentinel-hub-by_sinergise-dark_background.png"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {
# "rightsidebar": "true",
# "relbarbgcolor": "black"}

# 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']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
# html_sidebars = {
# '**': [
# 'about.html',
# 'navigation.html',
# 'relations.html', # needs 'show_related': True theme option to display
# 'searchbox.html',
# 'donate.html',
# ]
# }

# analytics
# Analytics
html_js_files = [("https://cdn.usefathom.com/script.js", {"data-site": "BILSIGFB", "defer": "defer"})]


# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = "sentinelhub_doc"
# show/hide links for source
# Show/hide links for source
html_show_sourcelink = False

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, "sentinelhub.tex", doc_title, author, "manual"),
]

# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, "sentinelhub", doc_title, [author], 1)]

# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, "sentinelhub", doc_title, author, "sentinelhub", "One line description of project.", "Miscellaneous"),
]

# -- Options for Epub output ----------------------------------------------

# Bibliographic Dublin Core info.
epub_title = project
epub_author = author
epub_publisher = author
epub_copyright = project_copyright
# -- Automatic generation of docs -----------------------------------------

# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#
# epub_identifier = ''

# A unique identification for the text.
#
# epub_uid = ''

# A list of files that should not be packed into the epub file.
epub_exclude_files = ["search.html"]

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {"https://docs.python.org/3.8/": None}

# copy examples
# Copy examples
with contextlib.suppress(FileExistsError):
shutil.copytree("../../examples", "./examples")

Expand All @@ -228,9 +114,10 @@
os.mkdir(MARKDOWNS_FOLDER)


# Readme
def process_readme():
"""Function which will process README.md file and create INTRO.md"""
with open("../../README.md", "r") as file:
with open("../../README.md") as file:
readme = file.read()

readme = readme.replace("[`", "[").replace("`]", "]")
Expand All @@ -246,13 +133,7 @@ def process_readme():

chapters = ["\n".join(chapter) for chapter in chapters]

intro = "\n".join(
[
chapter
for chapter in chapters
if not (chapter.startswith("## Install") or chapter.startswith("## Documentation"))
]
)
intro = "\n".join([chapter for chapter in chapters if not (chapter.startswith(("## Install", "## Documentation")))])

with open(os.path.join(MARKDOWNS_FOLDER, "INTRO.md"), "w") as file:
file.write(intro)
Expand Down Expand Up @@ -284,6 +165,7 @@ def run_apidoc(_):
main(["-e", "-o", reference_dir, module, *APIDOC_EXCLUDE, *APIDOC_OPTIONS])


# Fix github links for moved files
def configure_github_link(_app: Any, pagename: str, _templatename: Any, context: Dict[str, Any], _doctree: Any) -> None:
"""Because some pages are auto-generated and some are copied from their original location the link "Edit on GitHub"
of a page is wrong. This function computes a custom link for such pages and saves it to a custom meta parameter
Expand Down
4 changes: 2 additions & 2 deletions docs/source/configure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Sentinel Hub Configuration

In order to use Sentinel Hub services you will need a Sentinel Hub account. If you do not have one yet, you can
create a free trial account at `Sentinel Hub`_. If you are a researcher you can even apply for a free non-commercial
account at `ESA OSEO page`_. The following configurations are then linked to your account.
account through `ESA Network of Resources`_. The following configurations are then linked to your account.

Parameter ``instance_id`` is used when using OGC endpoints of the `Sentinel Hub services`_. It is the identifier of a
configuration users can set up in the `Sentinel Hub Dashboard`_ under "Configuration Utility".
Expand Down Expand Up @@ -130,7 +130,7 @@ $ sentinelhub.config --help


.. _`Sentinel Hub`: https://www.sentinel-hub.com/trial
.. _`ESA OSEO page`: https://earth.esa.int/aos/OSEO
.. _`ESA Network of Resources`: https://www.sentinel-hub.com/Network-of-Resources/
.. _`Sentinel Hub Dashboard`: https://apps.sentinel-hub.com/dashboard/
.. _`Sentinel Hub services`: https://www.sentinel-hub.com/develop/documentation/api/ogc_api/
.. _`Sentinel Hub webinar`: https://www.youtube.com/watch?v=CBIlTOl2po4&t=1760s
Expand Down
Loading