Skip to content

Commit

Permalink
Merge pull request #36 from octue/release/0.0.12
Browse files Browse the repository at this point in the history
Release/0.0.12a1
  • Loading branch information
thclark committed Sep 18, 2020
2 parents f912c89 + 0ca199a commit 7895bd0
Show file tree
Hide file tree
Showing 38 changed files with 777 additions and 274 deletions.
3 changes: 0 additions & 3 deletions .flake8

This file was deleted.

7 changes: 0 additions & 7 deletions .isort.cfg

This file was deleted.

16 changes: 11 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ default_language_version:
python: python3 # force all unspecified python hooks to run python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: master
rev: v3.1.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
language_version: python3
- id: check-added-large-files
args: ['--maxkb=10240']

- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
Expand All @@ -28,14 +29,20 @@ repos:
rev: 3.8.1
hooks:
- id: flake8
additional_dependencies: [flake8-isort]
language_version: python3

- repo: https://github.com/thclark/pre-commit-sphinx
rev: master
rev: 0.0.1
hooks:
- id: build-docs
language_version: python3
additional_dependencies:
- 'Sphinx>=2,<3'
- 'sphinx-rtd-theme==0.5.0'
- 'sphinx-tabs==1.2.1'
- 'sphinx-charts==0.0.4'
- 'scipy~=1.5.2'
- 'jsonschema~=3.2.0'

- repo: https://github.com/windpioneers/pre-commit-hooks
rev: 0.0.5
Expand All @@ -46,7 +53,6 @@ repos:
- '^development$'
- '^devops/([a-z][a-z0-9]*)(-[a-z0-9]+)*$'
- '^doc/([a-z][a-z0-9]*)(-[a-z0-9]+)*$'
- '^experiment/([a-z][a-z0-9]*)(-[a-z0-9]+)*$'
- '^feature/([a-z][a-z0-9]*)(-[a-z0-9]+)*$'
- '^fix/([a-z][a-z0-9]*)(-[a-z0-9]+)*$'
- '^hotfix/([a-z][a-z0-9]*)(-[a-z0-9]+)*$'
Expand Down
11 changes: 6 additions & 5 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

# Required by the python script for building documentation
Sphinx==1.8.3
sphinx-rtd-theme==0.4.2
sphinx-tabs==1.1.10
breathe==4.11.1
exhale==0.2.1
Sphinx>=2,<3
sphinx-rtd-theme==0.5.0
sphinx-tabs==1.2.1
sphinx-charts==0.0.4
scipy~=1.5.2
jsonschema~=3.2.0
8 changes: 4 additions & 4 deletions docs/source/anatomy_manifest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ for examples.

.. group-tab:: Configuration Manifest Strand

Here we construct an extremely tight filter, which connects this digital twin to a specific
system.
Here we construct an extremely tight filter, which connects this digital twin to
datasets from a specific system.

.. accordion::

Expand Down Expand Up @@ -113,8 +113,8 @@ for examples.

.. group-tab:: Output Manifest Strand

Here we specify that two datasets (and all or some of the files associated with them) are
required, for a service that cross-checks meteorological mast data and power output data for a wind farm.
Output figure files (with *.fig extension) containing figures enabling a visual check
of correlation between met mast and scada data.
.. accordion::

Expand Down
44 changes: 9 additions & 35 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@ def str2bool(value):
# Breate and exhale are added as recommended by:
# https://exhale.readthedocs.io/en/latest/usage.html#usage-quickstart-guide
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
'sphinx_tabs.tabs',
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'breathe',
'exhale',
'sphinx_charts.charts',
'googleanalytics',
'sphinx_accordion.accordion'
]
Expand Down Expand Up @@ -102,40 +105,11 @@ def str2bool(value):
# show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = None

# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []

# -- Breathe and Exhale Configuration ------------------------------------------

# Setup the breathe extension
breathe_projects = {
"My Project": "./doxyoutput/xml"
}
breathe_default_project = "My Project"

# Setup the exhale extension
exhale_args = {
# These arguments are required
"containmentFolder": "./library_api",
"rootFileName": "library_root.rst",
"rootFileTitle": "Library API",
"doxygenStripFromPath": "../../",
# Suggested optional arguments
"createTreeView": True,
# TIP: if using the sphinx-bootstrap-theme, you need
# "treeViewIsBootstrap": True,
"exhaleExecutesDoxygen": True,
"exhaleDoxygenStdin": "INPUT = ../../source"
}

# Tell sphinx what the primary language being documented is
primary_domain = 'python'

# Tell sphinx what the pygments highlight language should be
highlight_language = 'python'

# -- Google Analytics Configuration --------------------------------------------

# Only add google analytics when building on ReadTheDocs,
Expand Down Expand Up @@ -240,7 +214,7 @@ def str2bool(value):
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'twined.tex', u'Twined',
u'Tom Clark', 'manual'),
u'Octue Ltd', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -270,7 +244,7 @@ def str2bool(value):
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'twined', u'Twined',
[u'Tom Clark'], 1)
[u'Octue Ltd'], 1)
]

# If true, show URL addresses after external links.
Expand All @@ -284,7 +258,7 @@ def str2bool(value):
# dir menu entry, description, category)
texinfo_documents = [
('index', 'twined', u'Twined',
u'Tom Clark', 'Twined', 'Twined is a library to help digital twins talk to one another.',
u'Octue Ltd', 'Twined', 'Twined is a library to help digital twins talk to one another.',
'Miscellaneous'),
]

Expand Down
88 changes: 88 additions & 0 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,91 @@ copied straight from the unit test cases, so you can always check there to see h
}
}
.. _example_site_weather_conditions:

[Simple] Site weather conditions
================================

.. tabs::

.. group-tab:: Scenario

You need to be able to get characteristic weather conditions at a specific location, for a range of reasons
including assessing extreme design loads. The values you need are computed in a script, which calls a Weather
API (provided by a third party), but also needs a dataset of "Wind Resource" files.

.. group-tab:: Twine

.. code-block:: javascript
{
"title": "Weather Service Digital Twin",
"description": "Provides a model for design extreme weather conditions given a location",
"notes": "Easily extendable with children to add forecast and historical data of different types.",
"credentials": [
{
"name": "WEATHER_API_SECRET_KEY",
"purpose": "Token for accessing a 3rd party weather API service"
}
],
"input_manifest": [
{
"key": "wind_resource_data",
"purpose": "A dataset containing Wind Resource Grid files",
"filters": "tags:(wind AND resource) files:(extension:wrg)"
}
],
"input_values_schema": {
"$schema": "http://json-schema.org/2019-09/schema#",
"title": "Input Values for the weather service twin",
"description": "This is a simple example for getting metocean conditions at a single location",
"type": "object",
"properties": {
"location": {
"description": "Location",
"type": "object",
"properties": {
"latitude": {
"type": "number",
"minimum": -90,
"maximum": 90
},
"longitude": {
"type": "number",
"minimum": -180,
"maximum": 180
},
"srid": {
"description": "The Spatial Reference System ID for the coordinate. Default is 4326 (WGS84)",
"type": "integer",
"default": 4326
}
}
}
}
},
"output_manifest": [
{
"key": "production_data",
"purpose": "A dataset containing production data",
"tags": "production, wind"
}
],
"output_values_schema": {
"$schema": "http://json-schema.org/2019-09/schema#",
"title": "Output Values for the metocean service twin",
"description": "The output values strand of an example twine",
"type": "object",
"properties": {
"water_depth": {
"description": "Design water depth for use in concept calculations",
"type": "number"
},
"extreme_wind_speed": {
"description": "Extreme wind speed value for use in concept calculations",
"type": "number"
}
}
}
}
48 changes: 48 additions & 0 deletions docs/source/license.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,51 @@ Third Party Libraries

**twined** includes or is linked against the following third party libraries:


Plotly.js
---------
The MIT License (MIT)

Copyright (c) 2020 Plotly, Inc

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


jsonschema
----------

Copyright (c) 2013 Julian Berman

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
1 change: 0 additions & 1 deletion docs/source/version_history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@ Backward Incompatible API Changes
Bug Fixes & Minor Changes
-------------------------
#. n/a (Initial Release)

4 changes: 2 additions & 2 deletions examples/damage_classifier_service/twine.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
// classifiers for blade damage on system abc123
"filters": "organisation: megacorp AND tags:(classifier AND damage AND system:abc123) AND files:(extension:mdl)"
}
],
}
]
}

0 comments on commit 7895bd0

Please sign in to comment.