Skip to content

Commit a5839ca

Browse files
committed
merge main
2 parents 24f209f + b0b56cf commit a5839ca

27 files changed

Lines changed: 1004 additions & 442 deletions

.github/workflows/github_ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- uses: actions/checkout@v4
10+
- uses: actions/checkout@v5
1111

1212
- name: Install uv
13-
uses: astral-sh/setup-uv@v5
13+
uses: astral-sh/setup-uv@v7
1414
with:
1515
version: "0.7.8"
1616
enable-cache: true
1717

1818
- name: "Set up Python"
19-
uses: actions/setup-python@v5
19+
uses: actions/setup-python@v6
2020
with:
21-
python-version-file: "pyproject.toml"
21+
python-version: '3.13'
2222

2323
- name: Install the project
2424
run: uv sync --locked --all-extras --dev

docs/source/conf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
# -- Project information -----------------------------------------------------
77
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
88

9-
project = 'OSmOSE_post_processing'
10-
copyright = '2025, Mathieu Dupont'
11-
author = 'Mathieu Dupont'
12-
release = '0.0.1'
9+
project = "OSmOSE_post_processing"
10+
copyright = "2025, Mathieu Dupont"
11+
author = "Mathieu Dupont"
12+
release = "0.0.1"
1313

1414
# -- General configuration ---------------------------------------------------
1515
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

docs/source/example_APOCADO.ipynb

Lines changed: 58 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,72 @@
11
{
22
"cells": [
33
{
4-
"metadata": {},
54
"cell_type": "code",
5+
"execution_count": null,
6+
"id": "6ea41f4ba78fb69f",
7+
"metadata": {},
8+
"outputs": [],
69
"source": [
710
"from __future__ import annotations\n",
11+
"\n",
812
"from pathlib import Path\n",
13+
"\n",
914
"import matplotlib.pyplot as plt\n",
1015
"from pandas import Timedelta\n",
1116
"from pandas.tseries import frequencies\n",
17+
"\n",
1218
"from post_processing.dataclass.data_aplose import DataAplose"
13-
],
14-
"id": "6ea41f4ba78fb69f",
15-
"outputs": [],
16-
"execution_count": null
19+
]
1720
},
1821
{
19-
"metadata": {},
2022
"cell_type": "markdown",
21-
"source": "### Load data",
22-
"id": "4b10aaa427d1da6e"
23+
"id": "4b10aaa427d1da6e",
24+
"metadata": {},
25+
"source": "### Load data"
2326
},
2427
{
25-
"metadata": {},
2628
"cell_type": "code",
29+
"execution_count": null,
30+
"id": "c19ddde8bf965ee8",
31+
"metadata": {},
32+
"outputs": [],
2733
"source": [
2834
"yaml_file = Path(r\"resource/APOCADO_yaml.yml\")\n",
2935
"data = DataAplose.from_yaml(file=yaml_file)\n",
3036
"data.lat = 47\n",
3137
"data.lon = -5"
32-
],
33-
"id": "c19ddde8bf965ee8",
34-
"outputs": [],
35-
"execution_count": null
38+
]
3639
},
3740
{
38-
"metadata": {},
3941
"cell_type": "markdown",
40-
"source": "### Overview",
41-
"id": "e17cf669b1d31019"
42+
"id": "e17cf669b1d31019",
43+
"metadata": {},
44+
"source": "### Overview"
4245
},
4346
{
44-
"metadata": {},
4547
"cell_type": "code",
48+
"execution_count": null,
49+
"id": "cf59962e0e23eb96",
50+
"metadata": {},
51+
"outputs": [],
4652
"source": [
4753
"data.overview()\n",
4854
"plt.tight_layout()\n",
4955
"plt.show()"
50-
],
51-
"id": "cf59962e0e23eb96",
52-
"outputs": [],
53-
"execution_count": null
56+
]
5457
},
5558
{
56-
"metadata": {},
5759
"cell_type": "markdown",
58-
"source": "### Single barplot",
59-
"id": "29bb29560f971722"
60+
"id": "29bb29560f971722",
61+
"metadata": {},
62+
"source": "### Single barplot"
6063
},
6164
{
62-
"metadata": {},
6365
"cell_type": "code",
66+
"execution_count": null,
67+
"id": "8f7c3085e3f2550e",
68+
"metadata": {},
69+
"outputs": [],
6470
"source": [
6571
"fig, ax = plt.subplots(1, 1)\n",
6672
"\n",
@@ -79,20 +85,20 @@
7985
")\n",
8086
"plt.tight_layout()\n",
8187
"plt.show()"
82-
],
83-
"id": "8f7c3085e3f2550e",
84-
"outputs": [],
85-
"execution_count": null
88+
]
8689
},
8790
{
88-
"metadata": {},
8991
"cell_type": "markdown",
90-
"source": "### Multi-barplot",
91-
"id": "2dd2f7611b2d5d73"
92+
"id": "2dd2f7611b2d5d73",
93+
"metadata": {},
94+
"source": "### Multi-barplot"
9295
},
9396
{
94-
"metadata": {},
9597
"cell_type": "code",
98+
"execution_count": null,
99+
"id": "fd3b245c3fd9bce1",
100+
"metadata": {},
101+
"outputs": [],
96102
"source": [
97103
"fig, axs = plt.subplots(3, 1)\n",
98104
"\n",
@@ -118,39 +124,39 @@
118124
"\n",
119125
"plt.tight_layout()\n",
120126
"plt.show()"
121-
],
122-
"id": "fd3b245c3fd9bce1",
123-
"outputs": [],
124-
"execution_count": null
127+
]
125128
},
126129
{
127-
"metadata": {},
128130
"cell_type": "markdown",
129-
"source": "### Detection performances",
130-
"id": "5d82f65b7966fa04"
131+
"id": "5d82f65b7966fa04",
132+
"metadata": {},
133+
"source": "### Detection performances"
131134
},
132135
{
133-
"metadata": {},
134136
"cell_type": "code",
137+
"execution_count": null,
138+
"id": "dd6b3d9e2e9284ae",
139+
"metadata": {},
140+
"outputs": [],
135141
"source": [
136142
"data.detection_perf(\n",
137143
" annotators=[\"mdupon\", \"bcolon\"],\n",
138144
" labels=\"Odontocete whistle\",\n",
139145
")"
140-
],
141-
"id": "dd6b3d9e2e9284ae",
142-
"outputs": [],
143-
"execution_count": null
146+
]
144147
},
145148
{
146-
"metadata": {},
147149
"cell_type": "markdown",
148-
"source": "### Agreement",
149-
"id": "fdca3535add2d488"
150+
"id": "fdca3535add2d488",
151+
"metadata": {},
152+
"source": "### Agreement"
150153
},
151154
{
152-
"metadata": {},
153155
"cell_type": "code",
156+
"execution_count": null,
157+
"id": "1995f0abbfa15e93",
158+
"metadata": {},
159+
"outputs": [],
154160
"source": [
155161
"fig, (ax1, ax2) = plt.subplots(1, 2, gridspec_kw={\"width_ratios\": [4, 1]})\n",
156162
"\n",
@@ -180,17 +186,14 @@
180186
")\n",
181187
"plt.tight_layout()\n",
182188
"plt.show()"
183-
],
184-
"id": "1995f0abbfa15e93",
185-
"outputs": [],
186-
"execution_count": null
189+
]
187190
}
188191
],
189192
"metadata": {
190193
"kernelspec": {
191-
"name": "python3",
194+
"display_name": "Python 3 (ipykernel)",
192195
"language": "python",
193-
"display_name": "Python 3 (ipykernel)"
196+
"name": "python3"
194197
}
195198
},
196199
"nbformat": 4,

docs/source/example_OHAGEODAMS.ipynb

Lines changed: 50 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,101 +2,106 @@
22
"cells": [
33
{
44
"cell_type": "code",
5+
"execution_count": null,
56
"id": "initial_id",
67
"metadata": {
78
"collapsed": true
89
},
10+
"outputs": [],
911
"source": [
1012
"from pathlib import Path\n",
1113
"\n",
12-
"from pandas import Timedelta, Timestamp, read_csv\n",
13-
"\n",
14+
"import matplotlib.pyplot as plt\n",
1415
"from osekit.utils.timestamp_utils import strptime_from_text\n",
16+
"from pandas import Timedelta, Timestamp, read_csv\n",
1517
"\n",
16-
"from post_processing.utils.glider_utils import load_glider_nav, plot_detections_with_nav_data, \\\n",
17-
" compute_acoustic_diversity, export_gpx\n",
18-
"import matplotlib.pyplot as plt"
19-
],
20-
"outputs": [],
21-
"execution_count": null
18+
"from post_processing.utils.glider_utils import (\n",
19+
" compute_acoustic_diversity,\n",
20+
" export_gpx,\n",
21+
" load_glider_nav,\n",
22+
" plot_detections_with_nav_data,\n",
23+
")"
24+
]
2225
},
2326
{
24-
"metadata": {},
2527
"cell_type": "markdown",
26-
"source": "### Load data",
27-
"id": "429edfb71ec618a"
28+
"id": "429edfb71ec618a",
29+
"metadata": {},
30+
"source": "### Load data"
2831
},
2932
{
30-
"metadata": {},
3133
"cell_type": "code",
34+
"execution_count": null,
35+
"id": "3014915fe657e321",
36+
"metadata": {},
37+
"outputs": [],
3238
"source": [
3339
"input_dir = Path(r\"resource\\OHAGEODAMS_nav\")\n",
3440
"nav = load_glider_nav(input_dir)\n",
35-
"nav = nav[nav['Timestamp'] > Timestamp('2024-02-21', tz='UTC')]\n",
36-
"df = read_csv(Path(r\"resource\\OHAGEODAMS_results.csv\"), parse_dates=['start_datetime', 'end_datetime']).dropna(subset=['annotation']).reset_index(drop=True)"
37-
],
38-
"id": "3014915fe657e321",
39-
"outputs": [],
40-
"execution_count": null
41+
"nav = nav[nav[\"Timestamp\"] > Timestamp(\"2024-02-21\", tz=\"UTC\")]\n",
42+
"df = read_csv(Path(r\"resource\\OHAGEODAMS_results.csv\"), parse_dates=[\"start_datetime\", \"end_datetime\"]).dropna(subset=[\"annotation\"]).reset_index(drop=True)"
43+
]
4144
},
4245
{
43-
"metadata": {},
4446
"cell_type": "markdown",
45-
"source": "### Plot detection with nav data",
46-
"id": "303cd23d5b4d12dd"
47+
"id": "303cd23d5b4d12dd",
48+
"metadata": {},
49+
"source": "### Plot detection with nav data"
4750
},
4851
{
49-
"metadata": {},
5052
"cell_type": "code",
53+
"execution_count": null,
54+
"id": "7b478cccaf1c70eb",
55+
"metadata": {},
56+
"outputs": [],
5157
"source": [
52-
"ticks = Timedelta('1d')\n",
58+
"ticks = Timedelta(\"1d\")\n",
5359
"\n",
5460
"# plot specific labels\n",
55-
"plot_detections_with_nav_data(df=df[df['annotation'].isin([\"Sperm_Whale\", \"Delphinids clics\"])], nav=nav, criterion='Depth', ticks=ticks)\n",
61+
"plot_detections_with_nav_data(df=df[df[\"annotation\"].isin([\"Sperm_Whale\", \"Delphinids clics\"])], nav=nav, criterion=\"Depth\", ticks=ticks)\n",
5662
"plt.show()\n",
5763
"\n",
5864
"# plot all labels\n",
59-
"plot_detections_with_nav_data(df=df, nav=nav, criterion='Depth', ticks=ticks)\n",
65+
"plot_detections_with_nav_data(df=df, nav=nav, criterion=\"Depth\", ticks=ticks)\n",
6066
"plt.show()"
61-
],
62-
"id": "7b478cccaf1c70eb",
63-
"outputs": [],
64-
"execution_count": null
67+
]
6568
},
6669
{
67-
"metadata": {},
6870
"cell_type": "markdown",
69-
"source": "### Compute acoustic diversity",
70-
"id": "798518fc43a69afc"
71+
"id": "798518fc43a69afc",
72+
"metadata": {},
73+
"source": "### Compute acoustic diversity"
7174
},
7275
{
73-
"metadata": {},
7476
"cell_type": "code",
77+
"execution_count": null,
78+
"id": "395af53656d318b4",
79+
"metadata": {},
80+
"outputs": [],
7581
"source": [
76-
"task_status_filenames = read_csv(r\"resource\\OHAGEODAMS_status.csv\")['filename']\n",
77-
"time_vector = [strptime_from_text(f, \"%Y_%m_%d_%H_%M_%S\").tz_localize('UTC') for f in task_status_filenames]\n",
82+
"task_status_filenames = read_csv(r\"resource\\OHAGEODAMS_status.csv\")[\"filename\"]\n",
83+
"time_vector = [strptime_from_text(f, \"%Y_%m_%d_%H_%M_%S\").tz_localize(\"UTC\") for f in task_status_filenames]\n",
7884
"\n",
7985
"df_acoustic_div = compute_acoustic_diversity(df=df, nav=nav, time_vector=time_vector)\n",
8086
"\n",
8187
"# df_acoustic_div.to_csv(Path(r'\\output\\path\\acoustic_diversity.csv'), index=False)"
82-
],
83-
"id": "395af53656d318b4",
84-
"outputs": [],
85-
"execution_count": null
88+
]
8689
},
8790
{
88-
"metadata": {},
8991
"cell_type": "markdown",
90-
"source": "### Export navigation data to GPX",
91-
"id": "aa6d95c921329545"
92+
"id": "aa6d95c921329545",
93+
"metadata": {},
94+
"source": "### Export navigation data to GPX"
9295
},
9396
{
94-
"metadata": {},
9597
"cell_type": "code",
96-
"source": "export_gpx(nav=nav, output_dir=Path(r\"\\output\\path\"), output_file=\"test_trace\")",
98+
"execution_count": null,
9799
"id": "54f691859e36b232",
100+
"metadata": {},
98101
"outputs": [],
99-
"execution_count": null
102+
"source": [
103+
"export_gpx(nav=nav, output_dir=Path(r\"\\output\\path\"), output_file=\"test_trace\")"
104+
]
100105
}
101106
],
102107
"metadata": {

0 commit comments

Comments
 (0)