Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
bd83c3d
add option to read in single situation file, instead of folder (keep …
StephanieKemna Oct 29, 2025
3b3bac2
fixes for ruff
StephanieKemna Oct 29, 2025
12f7660
update/add to instructions on how to run/test
StephanieKemna Oct 29, 2025
466d867
fixes for ruff, same style of docstring as in rest of file
StephanieKemna Oct 29, 2025
78e5814
README: add suggestions wrt how to contribute to the repo and how to …
StephanieKemna Oct 29, 2025
7423c7b
Merge remote-tracking branch 'origin/main' into enh/64-cli_improvements
StephanieKemna Oct 31, 2025
a5c3d23
resolve pydantic warning
StephanieKemna Oct 31, 2025
733389c
update README on PR procedure
StephanieKemna Oct 31, 2025
8f70c93
add commandline argument for passing in ownship coordinate, i.e. init…
StephanieKemna Oct 31, 2025
46ea340
update cli main doc/help output, guide to the right help page
StephanieKemna Oct 31, 2025
f7a1c62
add python test for cli addition: ownship-coordinate
StephanieKemna Oct 31, 2025
3d1fcd5
address pyright, mypy and ruff errors
StephanieKemna Oct 31, 2025
f6dcb3b
update authors
StephanieKemna Nov 5, 2025
66b0755
Merge pull request #75 from dnv-opensource/enh/64-cli_improvements
StephanieKemna Nov 5, 2025
9b21a4d
#77, fixed bug, encounter evolvment is using initial position of targ…
tomarnepedersen Nov 12, 2025
866960f
#78 Adding sog to waypoint legs.
tomarnepedersen Nov 12, 2025
e95fe52
fixed mypy error
tomarnepedersen Nov 12, 2025
59ff5a9
Merge pull request #79 from dnv-opensource/77-when-calculating-how-th…
StephanieKemna Nov 13, 2025
7eb033d
Merge branch 'dev' into 78-add-speed-to-vessel-waypoints-in-generated…
StephanieKemna Nov 13, 2025
ced7895
Merge pull request #81 from dnv-opensource/78-add-speed-to-vessel-way…
StephanieKemna Nov 13, 2025
1cc239e
Updated changelog, bumped version number to 0.8.4
tomarnepedersen Nov 26, 2025
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
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@
"envFile": "${workspaceFolder}/.env", // specify where .env file is
},
]
}
}
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,42 @@ The changelog format is based on [Keep a Changelog](https://keepachangelog.com/e

## [Unreleased]

### Changed

## [0.8.4] - 2025-11-26

### Changed

* Added sog to each waypoint leg. Updated documentation. Generated new baseline_situations_generated files. Updated types.
* Fixed bug where future position of target ship was used instead of initial position of target ship to check encounter evolvement. Updated documentation to make this functionality clearer.
* Added option to pass in a single input situation .json file, not only a folder.

## [0.8.3] - 2025-10-31

### Changed

* [bug] Fixed sourcery dependency constraint to avoid platform compatibility issues on Linux by constraining to <1.41.

## [0.8.2] - 2025-10-03

### Changed

* [bug] fixed bug that all target ships had id = 10.
* [bug] fixed duplicate -v parameter warning.
* If own ship ID is not given in own_ship.json file, then ID is set to 1. Target ship IDs will follow from own ship ID.
* Better documentation of output files, added links to maritime schema, and improved navigation between related sections.
* Updated documentaion of target ships in input_files.rst

## [0.8.1] - 2025-05-12

### Changed

* Changed first assert in test_basic_cli() from 0 to 2.

## [0.8.0] - 2025-05-09

### Changed

* vectorTime may now be a single float (exact time) or a list of two floats [from, to]. vectorRange is removed from settings file.
* evolveTime is changed to situationDevelopTime.
* Removed Basemap-package and added pyproj package.
Expand Down
5 changes: 4 additions & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ authors:
family-names: Hemrich
email: Minos.Hemrich@dnv.com
affiliation: DNV
- given-names: Stephanie
family-names: Kemna
affiliation: DNV
testers:
- given-names: Melih
family-names: Akdag
Expand All @@ -36,4 +39,4 @@ keywords:
- Systematic assessment
license: MIT
url: 'https://github.com/dnv-opensource/ship-traffic-generator'
version: 0.8.3
version: 0.8.4
39 changes: 37 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ uv pip install -e .

### Test the install

In your virtual environment, or prepend `uv run`:

```sh
pytest .
```
Expand All @@ -159,6 +161,39 @@ uv run docs/make.bat html

The html documentation will then be available in `docs/build/html/index.html`

### Contributing

1. Any development should be associated to GitHub "issues" and done on new branches, which are tagged with the issue number. Branch off from `dev` (and also create PRs towards `dev`). The `main` branch is used for releases.

* Example branch names: `enh/1-improve-speed`, `bug/43-fix-cli-bug-about-something`, etc.

1. Whenever you make changes to files, please keep formatting the same (e.g. whitespaces etc.), and follow the conventions used in the file (and this project). The Pull Request checks/actions on GitHub will run ruff format/check, pyright and mypy. To prepare, you may wanna run these before committing your changes, to ensure you are adhering to the formatting rules. E.g.:

```sh
uv run ruff format
uv run ruff check
uv run pyright
uv run mypy
```

1. Run the pytest to ensure you did not break any functionality, and ensure you have added new tests for new features:

```sh
uv run pytest .
```

1. When you create a Pull Request in GitHub:

* Make sure your PR is set to merge into the `dev` branch.
* Use [closing keywords](https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) in your PR description, and link the relevant issue.
* In the PR description, add a description of the changes, any tests you've done, and describe how reviewers can test your changes.
* Add your contributions to the `CHANGELOG.md`
* Resolve any issues that are found by the PR checks (ruff, pyright, mypy)
* Assign some folks as Reviewers
* Assign yourself as "Assignee", and follow up on reviews. You are responsible for resolving any issues that are found, and doing the final merge, after you get an approval from Reviewers.
* If you are still working on the branch, make it a "Draft" PR - you can add/reach out to Reviewers if you want early feedback, or wait until the PR is ready before assigning Reviewers.
* If a new release should be created, notify Tom Arne Pedersen.

### Testing PRs

1. Check out the PR branch
Expand All @@ -170,10 +205,10 @@ The html documentation will then be available in `docs/build/html/index.html`
uv self update
uv sync -U
uv pip install -e .
pytest .
uv run pytest .
```

1. Run any additional tests you want / care about / related to PR topic, e.g.:
1. Run any additional tests you want / care about / related to PR topic (in your virtual env or prepend `uv run`) e.g.:

```sh
trafficgen gen-situation -o test_output
Expand Down
14 changes: 13 additions & 1 deletion data/baseline_situations_generated/traffic_situation_01.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.8.2",
"version": "0.8.3",
"title": "HO",
"description": "A head on situation with one target ship.",
"ownShip": {
Expand All @@ -18,12 +18,18 @@
"position": {
"lon": 10.490654,
"lat": 58.763449
},
"leg": {
"sog": 10.0
}
},
{
"position": {
"lon": 10.490654,
"lat": 58.8465724
},
"leg": {
"sog": 10.0
}
}
],
Expand Down Expand Up @@ -60,12 +66,18 @@
"position": {
"lon": 10.49680582,
"lat": 58.85500037
},
"leg": {
"sog": 12.1
}
},
{
"position": {
"lon": 10.48458595,
"lat": 58.75501409
},
"leg": {
"sog": 12.1
}
}
],
Expand Down
14 changes: 13 additions & 1 deletion data/baseline_situations_generated/traffic_situation_02.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.8.2",
"version": "0.8.3",
"title": "CR-GW",
"description": "A crossing situation with one target ship. Own ship is give-way.",
"ownShip": {
Expand All @@ -18,12 +18,18 @@
"position": {
"lon": 10.490654,
"lat": 58.763449
},
"leg": {
"sog": 10.0
}
},
{
"position": {
"lon": 10.490654,
"lat": 58.8465724
},
"leg": {
"sog": 10.0
}
}
],
Expand Down Expand Up @@ -60,12 +66,18 @@
"position": {
"lon": 10.52697741,
"lat": 58.81530237
},
"leg": {
"sog": 8.0
}
},
{
"position": {
"lon": 10.43617067,
"lat": 58.76878387
},
"leg": {
"sog": 8.0
}
}
],
Expand Down
30 changes: 21 additions & 9 deletions data/baseline_situations_generated/traffic_situation_03.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.8.2",
"version": "0.8.3",
"title": "CR-SO",
"description": "A crossing situation with one target ship. Own ship is stand-on.",
"ownShip": {
Expand All @@ -18,12 +18,18 @@
"position": {
"lon": 10.490654,
"lat": 58.763449
},
"leg": {
"sog": 10.0
}
},
{
"position": {
"lon": 10.490654,
"lat": 58.8465724
},
"leg": {
"sog": 10.0
}
}
],
Expand Down Expand Up @@ -60,28 +66,34 @@
"position": {
"lon": 10.43613433,
"lat": 58.81250143
},
"leg": {
"sog": 6.0
}
},
{
"position": {
"lon": 10.53232818,
"lat": 58.80903752
},
"leg": {
"sog": 6.0
}
}
],
"static": {
"id": 2,
"name": "target_ship_1",
"dimensions": {
"length": 50.0,
"width": 10.0,
"height": 8.0,
"a": 25.0,
"b": 25.0,
"c": 5.0,
"d": 5.0
"length": 178.0,
"width": 30.0,
"height": 30.0,
"a": 89.0,
"b": 89.0,
"c": 15.0,
"d": 15.0
},
"shipType": "Cargo"
"shipType": "Passenger"
}
}
]
Expand Down
28 changes: 20 additions & 8 deletions data/baseline_situations_generated/traffic_situation_04.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.8.2",
"version": "0.8.3",
"title": "OT-GW",
"description": "A overting situation with one target ship. Own ship is give-way.",
"ownShip": {
Expand All @@ -18,12 +18,18 @@
"position": {
"lon": 10.490654,
"lat": 58.763449
},
"leg": {
"sog": 10.0
}
},
{
"position": {
"lon": 10.490654,
"lat": 58.8465724
},
"leg": {
"sog": 10.0
}
}
],
Expand Down Expand Up @@ -60,28 +66,34 @@
"position": {
"lon": 10.50093584,
"lat": 58.78336982
},
"leg": {
"sog": 5.1
}
},
{
"position": {
"lon": 10.47888298,
"lat": 58.82379175
},
"leg": {
"sog": 5.1
}
}
],
"static": {
"id": 2,
"name": "target_ship_1",
"dimensions": {
"length": 122.0,
"width": 20.0,
"length": 50.0,
"width": 10.0,
"height": 8.0,
"a": 61.0,
"b": 61.0,
"c": 10.0,
"d": 10.0
"a": 25.0,
"b": 25.0,
"c": 5.0,
"d": 5.0
},
"shipType": "Passenger"
"shipType": "Cargo"
}
}
]
Expand Down
Loading
Loading