Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.9%) to scientific vocabulary
Last synced: 9 months ago · JSON representation ·

Repository

Basic Info
  • Host: GitHub
  • Owner: dnv-opensource
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 1.77 MB
Statistics
  • Stars: 19
  • Watchers: 3
  • Forks: 3
  • Open Issues: 2
  • Releases: 10
Created almost 3 years ago · Last pushed 9 months ago
Metadata Files
Readme Changelog License Citation

README.md

Traffic Generator

The tool generates a structured set of encounters for verifying automatic collision and grounding avoidance systems. Based on input parameters such as desired situation, relative speed, relative bearing etc, the tool will generate a set of traffic situations. The traffic situations may be written to files and/or inspected using plots.

A paper is written describing the background for the tool and how it works [paper]

For package documentation, see https://dnv-opensource.github.io/ship-traffic-generator/

Installation

To install Ship Traffic Generator, run this command in your terminal: sh pip install trafficgen This is the preferred method to install Traffic Generator, as it will always install the most recent stable release.

You can check your installation by running: sh uv run trafficgen --help

Usage

For simplest usage, clone this repo, then run pip install -e . (you may want to do this in a local environment, such as a venv, see an example with uv below).

Then run: trafficgen gen-situation. You can add the option -v for visualization.

For further explanations, see the documentation pages of the Ship Traffic Generator.

Development Setup

Install UV

This project uses uv as package manager. If you haven't already, install uv, preferably using it's "Standalone installer" method:
..on Windows: sh powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" ..on MacOS and Linux: sh curl -LsSf https://astral.sh/uv/install.sh | sh (see docs.astral.sh/uv for all / alternative installation methods.)

Once installed, you can update uv to its latest version, anytime, by running: sh uv self update

Install Python

The traffic generator requires Python 3.11 or later.

If you don't already have a compatible version installed on your machine, you way install Python through uv: sh uv python install This will install the latest stable version of Python into the uv Python directory, i.e. as a uv-managed version of Python.

Note: you can also do this after you clone the repo, see below.

Alternatively, and if you want a standalone version of Python on your machine, you can install Python either via winget: sh winget install --id Python.Python or you can download and install Python from the python.org website.

Clone the repository

Clone the traffig generator repository into your local development directory: sh git clone https://github.com/dnv-opensource/ship-traffic-generator path/to/your/dir/ship-traffic-generator Change into the project directory after cloning: sh cd ship-traffic-generator

Install dependencies

Run uv sync -U to create a virtual environment and install all project dependencies into it: sh uv sync -U

Note: Using --no-dev will omit installing development dependencies.

Note: You can also define the python environment at the same time, by running for example uv sync -U -p 3.12 to install Python 3.12.

Note: uv will create a new virtual environment called .venv in the project root directory when running uv sync the first time. Optionally, you can create your own virtual environment using e.g. uv venv, before running uv sync.

(Optional) Activate the virtual environment

When using uv, there is in almost all cases no longer a need to manually activate the virtual environment.
uv will find the .venv virtual environment in the working directory or any parent directory, and activate it on the fly whenever you run a command via uv inside your project folder structure: sh uv run <command>

However, you still can manually activate the virtual environment if needed. When developing in an IDE, for instance, this can in some cases be necessary depending on your IDE settings. To manually activate the virtual environment, run one of the "known" legacy commands:
..on Windows: sh .venv\Scripts\activate.bat

Note: If you use the cmd terminal in VS Code, it will show this activated venv as (trafficgen) at the start of every line command. ..on Linux: sh source .venv/bin/activate

Install the package

sh uv pip install -e .

Test the install

sh pytest .

Documentation

For pre-generated package documentation, see https://dnv-opensource.github.io/ship-traffic-generator/

To generate documentation from the source code, use: sh uv run docs/make.bat html The html documentation will then be available in docs/build/html/index.html

Owner

  • Name: DNV open source
  • Login: dnv-opensource
  • Kind: organization
  • Location: Norway

Open source from DNV

Citation (CITATION.cff)

cff-version: 1.2.0
title: trafficgen
message: Ship Traffic Generator.
type: software
authors:
  - name: DNV
    address: 'Veritasveien 1, 1363 Høvik'
    city: Oslo
    website: 'https://www.dnv.com/'
  - given-names: Tom Arne
    family-names: Pedersen
    email: Tom.Arne.Pedersen@dnv.com
    affiliation: DNV
  - given-names: Claas
    family-names: Rostock
    email: claas.rostock@dnv.com
    affiliation: DNV
  - given-names: Minos
    family-names: Hemrich
    email: Minos.Hemrich@dnv.com
    affiliation: DNV
testers:
  - given-names: Grunde
    family-names: Løvoll
    affiliation: DNV
  - given-names: Stephanie
    family-names: Kemna
    affiliation: DNV
abstract: >-
  The tool trafficgen generates unlimited set of encounters (based on input parameters)
  to allow a systematic assessment of the vessel's ability to act according to COLREG
  using simulation-based testing.
keywords:
  - Traffic Generator
  - Simulation-based testing
  - Systematic assessment
license: MIT
url: 'https://github.com/dnv-opensource/ship-traffic-generator'
version: 0.7.2

GitHub Events

Total
  • Create event: 19
  • Release event: 8
  • Issues event: 24
  • Watch event: 7
  • Delete event: 14
  • Issue comment event: 21
  • Push event: 376
  • Pull request review comment event: 6
  • Pull request event: 31
  • Pull request review event: 19
Last Year
  • Create event: 19
  • Release event: 8
  • Issues event: 24
  • Watch event: 7
  • Delete event: 14
  • Issue comment event: 21
  • Push event: 376
  • Pull request review comment event: 6
  • Pull request event: 31
  • Pull request review event: 19

Issues and Pull Requests

Last synced: 9 months ago

All Time
  • Total issues: 33
  • Total pull requests: 44
  • Average time to close issues: 21 days
  • Average time to close pull requests: 7 days
  • Total issue authors: 5
  • Total pull request authors: 5
  • Average comments per issue: 0.33
  • Average comments per pull request: 0.68
  • Merged pull requests: 42
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 13
  • Pull requests: 28
  • Average time to close issues: 27 days
  • Average time to close pull requests: 9 days
  • Issue authors: 3
  • Pull request authors: 3
  • Average comments per issue: 0.69
  • Average comments per pull request: 0.5
  • Merged pull requests: 28
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • tomarnepedersen (17)
  • ClaasRostock (10)
  • StephanieKemna (6)
  • henrikstoklandberg (1)
  • minhemdnv (1)
Pull Request Authors
  • tomarnepedersen (26)
  • ClaasRostock (12)
  • StephanieKemna (8)
  • minhemdnv (2)
  • freol35241 (2)
Top Labels
Issue Labels
enhancement (2) bug (2) documentation (1)
Pull Request Labels
bug (6) documentation (4)

Dependencies

pyproject.toml pypi
  • basemap ^1.3.8
  • basemap-data-hires ^1.3.2
  • click ^8.1
  • click-log ^0.4.0
  • folium ^0.14.0
  • global-land-mask ^1.0.0
  • matplotlib ^3.7.2
  • numpy ^1.25.2
  • python ^3.9
.github/workflows/_build_and_publish_documentation.yml actions
  • actions/checkout v4 composite
  • actions/download-artifact v3 composite
  • actions/setup-python v4 composite
  • peaceiris/actions-gh-pages v3 composite
  • sphinx-doc/github-problem-matcher master composite
.github/workflows/_build_package.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
.github/workflows/_code_quality.yml actions
  • actions/checkout v4 composite
  • actions/download-artifact v3 composite
  • actions/setup-python v4 composite
  • psf/black stable composite
.github/workflows/_requirements_files.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
.github/workflows/_test.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v4 composite
.github/workflows/_test_future.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v4 composite
.github/workflows/nightly_build.yml actions
.github/workflows/pull_request_to_main.yml actions
.github/workflows/push.yml actions
.github/workflows/push_to_main.yml actions
.github/workflows/push_to_release.yml actions