Skip to content

Commit

Permalink
Merge pull request #23 from dnv-opensource/22-create-waypoints-automa…
Browse files Browse the repository at this point in the history
…tically-when-data-in-initial-is-present-and-no-waypoints-are-given

add automatic waypoint generation + tests
  • Loading branch information
minhemdnv authored Mar 18, 2024
2 parents 0e770e8 + 92f9b8a commit 3faaaa7
Show file tree
Hide file tree
Showing 9 changed files with 294 additions and 186 deletions.
79 changes: 42 additions & 37 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,89 +6,94 @@ The changelog format is based on [Keep a Changelog](https://keepachangelog.com/e
## [Unreleased]

### Changed
* replaced black formatter with ruff formatter
* src/maritime_schema/types/caga.py: class ShipStatic(): set the length, width, and shipType fields as Optional.
* src/maritime_schema/types/caga.py: class TrafficSituation(): set the title field as Optional.

- replaced black formatter with ruff formatter
- src/maritime_schema/types/caga.py: class ShipStatic(): set the length, width, and shipType fields as Optional.
- src/maritime_schema/types/caga.py: class TrafficSituation(): set the title field as Optional.
- src/maritime_schema/types/caga.py: class Ship(): updated the waypoint field, so that if the class has initial data without waypoints, they will automatically be created.

### Dependencies
* updated to ruff==0.3.0 (from ruff==0.2.1)
* updated to pyright==1.1.352 (from pyright==1.1.350)
* removed black

* -/-
- added pyproj==3.6.1 (used for geodesic calculations)
- updated to ruff==0.3.0 (from ruff==0.2.1)
- updated to pyright==1.1.352 (from pyright==1.1.350)
- removed black

- -/-

## [0.0.4] - 2024-02-28

### Changed
* src/maritime_schema/types/caga.py: class Initial(): Marked several fields as optional.

- src/maritime_schema/types/caga.py: class Initial(): Marked several fields as optional.

## [0.0.3] - 2024-02-27

### Added
* Created a CLI script `publish-schema`, which re-generates the schema files.
* README.md:
* Added some introductory guidance.
* Under `Development Setup`, added a step to install current package in "editable" mode, using the pip install -e option.
This removes the need to manually add /src to the PythonPath environment variable in order for debugging and tests to work.
* Created an icon for the documentation
* Added authors to README.md, pyproject.toml and to the Sphinx documentation

- Created a CLI script `publish-schema`, which re-generates the schema files.
- README.md:
- Added some introductory guidance.
- Under `Development Setup`, added a step to install current package in "editable" mode, using the pip install -e option.
This removes the need to manually add /src to the PythonPath environment variable in order for debugging and tests to work.
- Created an icon for the documentation
- Added authors to README.md, pyproject.toml and to the Sphinx documentation

### Removed
* VS Code settings: Removed the setting which added the /src folder to PythonPath. This is no longer necessary. Installing the project itself as a package in "editable" mode, using the pip install -e option, solves the issue and removes the need to manually add /src to the PythonPath environment variable.

- VS Code settings: Removed the setting which added the /src folder to PythonPath. This is no longer necessary. Installing the project itself as a package in "editable" mode, using the pip install -e option, solves the issue and removes the need to manually add /src to the PythonPath environment variable.

### Changed
* Moved all project configuration from setup.cfg to pyproject.toml
* Moved all tox configuration from setup.cfg to tox.ini.
* Moved pytest configuration from pyproject.toml to pytest.ini
* Deleted setup.cfg

- Moved all project configuration from setup.cfg to pyproject.toml
- Moved all tox configuration from setup.cfg to tox.ini.
- Moved pytest configuration from pyproject.toml to pytest.ini
- Deleted setup.cfg

### Dependencies
* updated to black[jupyter]==24.1 (from black[jupyter]==23.12)
* updated to version: '==24.1' (from version: '==23.12')
* updated to ruff==0.2.1 (from ruff==0.1.8)
* updated to pyright==1.1.350 (from pyright==1.1.338)
* updated to sourcery==1.15 (from sourcery==1.14)

- updated to black[jupyter]==24.1 (from black[jupyter]==23.12)
- updated to version: '==24.1' (from version: '==23.12')
- updated to ruff==0.2.1 (from ruff==0.1.8)
- updated to pyright==1.1.350 (from pyright==1.1.338)
- updated to sourcery==1.15 (from sourcery==1.14)

## [0.0.2] - 2024-01-11

* Test release

- Test release

## [0.0.1] - 2024-01-11

* Initial release
- Initial release

### Added

* added this
- added this

### Changed

* changed that
- changed that

### Dependencies

* updated to some_package_on_pypi>=0.1.0
- updated to some_package_on_pypi>=0.1.0

### Fixed

* fixed issue #12345
- fixed issue #12345

### Deprecated

* following features will soon be removed and have been marked as deprecated:
* function x in module z
- following features will soon be removed and have been marked as deprecated:
- function x in module z

### Removed

* following features have been removed:
* function y in module z

- following features have been removed:
- function y in module z

<!-- Markdown link & img dfn's -->

[unreleased]: https://github.com/dnv-opensource/maritime-schema/compare/v0.0.4...HEAD
[0.0.4]: https://github.com/dnv-opensource/maritime-schema/releases/tag/v0.0.3...v0.0.4
[0.0.3]: https://github.com/dnv-opensource/maritime-schema/releases/tag/v0.0.2...v0.0.3
Expand Down
48 changes: 24 additions & 24 deletions docs/schema/caga/input_schema.html

Large diffs are not rendered by default.

126 changes: 63 additions & 63 deletions docs/schema/caga/output_schema.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dependencies = [
"pydantic>=2.6",
"json-schema-for-humans>=0.4.7",
"dictIO>=0.3.3",
"pyproj>=3.6.1",
]

[project.urls]
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pydantic>=2.6
json-schema-for-humans>=0.4.7
dictIO>=0.3.3
pyproj>=3.6.1
62 changes: 45 additions & 17 deletions schema/caga/input_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@
},
"properties": {
"sog": {
"allOf": [
"anyOf": [
{
"$ref": "#/$defs/DataPoint"
},
{
"type": "null"
}
],
"default": null,
Expand All @@ -66,9 +69,12 @@
]
},
"heading": {
"allOf": [
"anyOf": [
{
"$ref": "#/$defs/DataPoint"
},
{
"type": "null"
}
],
"default": null,
Expand All @@ -89,14 +95,23 @@
"DataPoint": {
"properties": {
"value": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "the value of the data at the current timestep",
"examples": [
12.3
],
"title": "Value",
"type": "number"
"title": "Value"
},
"m_before_leg_change": {
"default": null,
"description": "meters before the waypoint to start interpolating to the new value",
"examples": [
10
Expand All @@ -105,12 +120,20 @@
"type": "number"
},
"m_after_leg_change": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "meters after the waypoint to finish interpolating to the new value",
"examples": [
10
],
"title": "M After Leg Change",
"type": "number"
"title": "M After Leg Change"
},
"interp_method": {
"anyOf": [
Expand All @@ -119,18 +142,16 @@
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": "linear",
"default": null,
"description": "Method used for interpolation",
"title": "Interp Method"
}
},
"required": [
"value",
"m_before_leg_change",
"m_after_leg_change"
],
"title": "DataPoint",
"type": "object"
},
Expand Down Expand Up @@ -549,7 +570,7 @@
"id": {
"description": "Unique Identifier",
"examples": [
"4a0bcf66-3832-4b3a-b20b-0a351bca5364"
"59352249-4387-4aaa-bb4c-ab767950b373"
],
"format": "uuid",
"title": "Id",
Expand Down Expand Up @@ -796,13 +817,20 @@
]
},
"turn_radius": {
"default": 0,
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "Orthodrome turn radius as defined in RTZ format",
"examples": [
200
],
"title": "Turn Radius",
"type": "number"
"title": "Turn Radius"
},
"data": {
"allOf": [
Expand Down Expand Up @@ -880,7 +908,7 @@
"default": null,
"description": "Starting time of the situation in `ISO 8601` format `YYYY-MM-DDThh:mm:ssZ`",
"examples": [
"2024-03-11T16:01:17.503937"
"2024-03-14T15:29:40.119791"
],
"title": "Situation starting time"
},
Expand Down
Loading

0 comments on commit 3faaaa7

Please sign in to comment.