Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ The changelog format is based on [Keep a Changelog](https://keepachangelog.com/e

-/-

## [0.7.2] - 2025-03-14

### Changed

* Fixed ruff errors which appeared during last nightly build
* Removed code quality from nightly build
* Added -U to for the 'uv sync -U' in readme file

## [0.7.1] - 2025-01-30

### Changed
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ keywords:
- Systematic assessment
license: MIT
url: 'https://github.com/dnv-opensource/ship-traffic-generator'
version: 0.7.1
version: 0.7.2
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ cd ship-traffic-generator
```

### Install dependencies
Run `uv sync` to create a virtual environment and install all project dependencies into it:
Run `uv sync -U` to create a virtual environment and install all project dependencies into it:
```sh
uv sync
uv sync -U
```
> **Note**: Using `--no-dev` will omit installing development dependencies.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
author = "Tom Arne Pedersen, Claas Rostock, Minos Hemrich"

# The full version, including alpha/beta/rc tags
release = "0.7.1"
release = "0.7.2"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ packages = [

[project]
name = "trafficgen"
version = "0.7.1"
version = "0.7.2"
description = "Automatic generation of ship traffic situations from a set of predefined situations"
readme = "README.md"
requires-python = ">= 3.11, < 3.13"
Expand Down
4 changes: 2 additions & 2 deletions src/trafficgen/plot_traffic_situation.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ def plot_specific_traffic_situation(
# Configure logging
logging.basicConfig(level=logging.INFO)

# Replace print with logging
logging.info(
logger = logging.getLogger(__name__)
logger.info(
f"Situation_number specified higher than number of situations available, "
f"plotting last situation: {num_situations}"
)
Expand Down
9 changes: 4 additions & 5 deletions src/trafficgen/read_files.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Functions to read the files needed to build one or more traffic situations."""

import json
import os
from pathlib import Path
from typing import Any, cast

Expand Down Expand Up @@ -32,7 +31,7 @@ def read_situation_files(situation_folder: Path) -> list[SituationInput]:
List of desired traffic situations
"""
situations: list[SituationInput] = []
for file_name in sorted([file for file in os.listdir(situation_folder) if file.endswith(".json")]):
for file_name in sorted([file for file in Path.iterdir(situation_folder) if str(file).endswith(".json")]):
file_path = situation_folder / file_name
with Path.open(file_path, encoding="utf-8") as f:
data = json.load(f)
Expand Down Expand Up @@ -64,7 +63,7 @@ def read_generated_situation_files(situation_folder: Path) -> list[TrafficSituat
List of desired traffic situations
"""
situations: list[TrafficSituation] = []
for file_name in sorted([file for file in os.listdir(situation_folder) if file.endswith(".json")]):
for file_name in sorted([file for file in Path.iterdir(situation_folder) if str(file).endswith(".json")]):
file_path = situation_folder / file_name
with Path.open(file_path, encoding="utf-8") as f:
data = json.load(f)
Expand Down Expand Up @@ -237,7 +236,7 @@ def read_target_ship_static_files(target_ship_folder: Path) -> list[ShipStatic]:
"""
target_ships_static: list[ShipStatic] = []
i = 0
for file_name in sorted([file for file in os.listdir(target_ship_folder) if file.endswith(".json")]):
for file_name in sorted([file for file in Path.iterdir(target_ship_folder) if str(file).endswith(".json")]):
i = i + 1
file_path = target_ship_folder / file_name
with Path.open(file_path, encoding="utf-8") as f:
Expand Down Expand Up @@ -339,7 +338,7 @@ def camel_to_snake(string: str) -> str:

def convert_keys_to_snake_case(data: dict[str, Any]) -> dict[str, Any]:
"""Convert keys in a nested dictionary from camel case to snake case."""
return cast(dict[str, Any], _convert_keys_to_snake_case(data))
return cast("dict[str, Any]", _convert_keys_to_snake_case(data))


def _convert_keys_to_snake_case(
Expand Down
906 changes: 330 additions & 576 deletions uv.lock

Large diffs are not rendered by default.