comfort-db 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- comfort_db-0.1.0/LICENSE +21 -0
- comfort_db-0.1.0/MANIFEST.in +1 -0
- comfort_db-0.1.0/PKG-INFO +190 -0
- comfort_db-0.1.0/README.md +127 -0
- comfort_db-0.1.0/pyproject.toml +107 -0
- comfort_db-0.1.0/setup.cfg +4 -0
- comfort_db-0.1.0/src/comfort/__init__.py +35 -0
- comfort_db-0.1.0/src/comfort/app/__init__.py +2 -0
- comfort_db-0.1.0/src/comfort/app/__main__.py +9 -0
- comfort_db-0.1.0/src/comfort/app/explorer.py +1033 -0
- comfort_db-0.1.0/src/comfort/database/__init__.py +32 -0
- comfort_db-0.1.0/src/comfort/database/information.py +425 -0
- comfort_db-0.1.0/src/comfort/geo.py +739 -0
- comfort_db-0.1.0/src/comfort/gridding.py +755 -0
- comfort_db-0.1.0/src/comfort/io.py +1062 -0
- comfort_db-0.1.0/src/comfort/physics.py +435 -0
- comfort_db-0.1.0/src/comfort/plot/__init__.py +72 -0
- comfort_db-0.1.0/src/comfort/plot/_helpers.py +98 -0
- comfort_db-0.1.0/src/comfort/plot/coverage.py +308 -0
- comfort_db-0.1.0/src/comfort/plot/distribution.py +272 -0
- comfort_db-0.1.0/src/comfort/plot/profile.py +263 -0
- comfort_db-0.1.0/src/comfort/plot/relationships.py +433 -0
- comfort_db-0.1.0/src/comfort/plot/spatial.py +322 -0
- comfort_db-0.1.0/src/comfort/profile_analysis.py +568 -0
- comfort_db-0.1.0/src/comfort/qc.py +201 -0
- comfort_db-0.1.0/src/comfort/scaling.py +107 -0
- comfort_db-0.1.0/src/comfort/sections.py +108 -0
- comfort_db-0.1.0/src/comfort/units.py +543 -0
- comfort_db-0.1.0/src/comfort/util/__init__.py +6 -0
- comfort_db-0.1.0/src/comfort/util/columns.py +78 -0
- comfort_db-0.1.0/src/comfort/util/optional.py +28 -0
- comfort_db-0.1.0/src/comfort/util/sqlite_utils.py +25 -0
- comfort_db-0.1.0/src/comfort/util/types.py +82 -0
- comfort_db-0.1.0/src/comfort_db.egg-info/PKG-INFO +190 -0
- comfort_db-0.1.0/src/comfort_db.egg-info/SOURCES.txt +54 -0
- comfort_db-0.1.0/src/comfort_db.egg-info/dependency_links.txt +1 -0
- comfort_db-0.1.0/src/comfort_db.egg-info/requires.txt +48 -0
- comfort_db-0.1.0/src/comfort_db.egg-info/top_level.txt +1 -0
- comfort_db-0.1.0/test/conftest.py +35 -0
- comfort_db-0.1.0/test/test_columns.py +68 -0
- comfort_db-0.1.0/test/test_explorer.py +191 -0
- comfort_db-0.1.0/test/test_geo.py +891 -0
- comfort_db-0.1.0/test/test_gridding.py +973 -0
- comfort_db-0.1.0/test/test_information.py +327 -0
- comfort_db-0.1.0/test/test_io.py +1343 -0
- comfort_db-0.1.0/test/test_optional.py +46 -0
- comfort_db-0.1.0/test/test_physics.py +476 -0
- comfort_db-0.1.0/test/test_plot.py +610 -0
- comfort_db-0.1.0/test/test_profile_analysis.py +668 -0
- comfort_db-0.1.0/test/test_public_api.py +41 -0
- comfort_db-0.1.0/test/test_qc.py +311 -0
- comfort_db-0.1.0/test/test_scaling.py +113 -0
- comfort_db-0.1.0/test/test_sections.py +100 -0
- comfort_db-0.1.0/test/test_sqlite_utils.py +29 -0
- comfort_db-0.1.0/test/test_types.py +59 -0
- comfort_db-0.1.0/test/test_units.py +758 -0
comfort_db-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Yvonne Jenniges, Universität Bremen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the “Software”),
|
|
7
|
+
to deal in the Software without restriction, including without limitation
|
|
8
|
+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
9
|
+
and/or sell copies of the Software, and to permit persons to whom the
|
|
10
|
+
Software is furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included
|
|
13
|
+
in all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
16
|
+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
recursive-include test *.py
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: comfort-db
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Helper library for working with the COMFORT oceanographic dataset (SQLite)
|
|
5
|
+
Author: Are Olsen, Boris Peter Koch, Sebastian Maneth
|
|
6
|
+
Author-email: Yvonne Jenniges <yvonne.jenniges@gmail.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Repository, https://github.com/y-jenniges/comfort-db
|
|
9
|
+
Project-URL: Issues, https://github.com/y-jenniges/comfort-db/issues
|
|
10
|
+
Project-URL: Documentation, https://comfort-db.readthedocs.io/en/latest/
|
|
11
|
+
Keywords: oceanography,data-exploration,data-analysis,COMFORT,SQLite
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: numpy>=1.23
|
|
24
|
+
Requires-Dist: pandas>=2.0
|
|
25
|
+
Requires-Dist: scipy>=1.10
|
|
26
|
+
Requires-Dist: gsw>=3.6.16
|
|
27
|
+
Requires-Dist: python-dateutil>=2.8.2
|
|
28
|
+
Requires-Dist: python-dotenv>=1.0
|
|
29
|
+
Provides-Extra: plot
|
|
30
|
+
Requires-Dist: matplotlib>=3.8.1; extra == "plot"
|
|
31
|
+
Requires-Dist: seaborn>=0.13; extra == "plot"
|
|
32
|
+
Provides-Extra: geo
|
|
33
|
+
Requires-Dist: shapely>=2.0; extra == "geo"
|
|
34
|
+
Requires-Dist: geopandas>=0.14.4; extra == "geo"
|
|
35
|
+
Requires-Dist: cartopy>=0.22; extra == "geo"
|
|
36
|
+
Provides-Extra: grid
|
|
37
|
+
Requires-Dist: xarray>=2023.1; extra == "grid"
|
|
38
|
+
Requires-Dist: netcdf4>=1.6; extra == "grid"
|
|
39
|
+
Provides-Extra: scale
|
|
40
|
+
Requires-Dist: scikit-learn>=1.2; extra == "scale"
|
|
41
|
+
Provides-Extra: dash
|
|
42
|
+
Requires-Dist: dash>=2.14; extra == "dash"
|
|
43
|
+
Requires-Dist: dash-bootstrap-components>=1.5; extra == "dash"
|
|
44
|
+
Requires-Dist: plotly>=5.18; extra == "dash"
|
|
45
|
+
Provides-Extra: docs
|
|
46
|
+
Requires-Dist: sphinx>=7.0; extra == "docs"
|
|
47
|
+
Requires-Dist: sphinx-rtd-theme>=2.0; extra == "docs"
|
|
48
|
+
Provides-Extra: all
|
|
49
|
+
Requires-Dist: comfort-db[plot]; extra == "all"
|
|
50
|
+
Requires-Dist: comfort-db[geo]; extra == "all"
|
|
51
|
+
Requires-Dist: comfort-db[grid]; extra == "all"
|
|
52
|
+
Requires-Dist: comfort-db[scale]; extra == "all"
|
|
53
|
+
Requires-Dist: comfort-db[dash]; extra == "all"
|
|
54
|
+
Requires-Dist: comfort-db[docs]; extra == "all"
|
|
55
|
+
Provides-Extra: test
|
|
56
|
+
Requires-Dist: pytest>=7.4; extra == "test"
|
|
57
|
+
Requires-Dist: pytest-cov>=4.1; extra == "test"
|
|
58
|
+
Requires-Dist: openpyxl>=3.1; extra == "test"
|
|
59
|
+
Provides-Extra: dev
|
|
60
|
+
Requires-Dist: comfort-db[all]; extra == "dev"
|
|
61
|
+
Requires-Dist: comfort-db[test]; extra == "dev"
|
|
62
|
+
Dynamic: license-file
|
|
63
|
+
|
|
64
|
+
# comfort-db
|
|
65
|
+
|
|
66
|
+
[](https://github.com/y-jenniges/comfort-db/blob/main/LICENSE)
|
|
67
|
+
[](https://www.python.org/)
|
|
68
|
+
[](https://comfort-db.readthedocs.io/en/latest/)
|
|
69
|
+
|
|
70
|
+
Python library for working with the [COMFORT](https://www.doi.org/10.11582/2022.00039)[1] oceanographic SQLite dataset
|
|
71
|
+
with [code documentation](https://comfort-db.readthedocs.io/en/latest/).
|
|
72
|
+
|
|
73
|
+
`comfort-db` wraps database access, preprocessing and basic analysis utilities into one library.
|
|
74
|
+
This includes filtering for quality and space-time ranges, unit conversions, spatiotemporal gridding, profile and water-mass analysis,
|
|
75
|
+
geospatial utilities, scaling, plotting and visualisation using a dashboard.
|
|
76
|
+
|
|
77
|
+
The data structure broadly follows oceanographic ship measurement practice:
|
|
78
|
+
At a latitude, longitude and time, a station defines where measurements were taken.
|
|
79
|
+
At a station, profiles are measured, i.e. a parameter like temperature at different depths with a specific instrument.
|
|
80
|
+
There can be multiple profiles at the same station, though in the COMFORT dataset, it is mostly one profile per station.
|
|
81
|
+
|
|
82
|
+
This library bases on and extends code developed in [2], including parts of the gridding, unit conversion, analysis and plotting
|
|
83
|
+
routines.
|
|
84
|
+
|
|
85
|
+
[1] Korablev, A., Olsen, A., (2022) Geophysical Institute, University of Bergen, Bjerknes Centre for Climate Research. COMFORT Dataset [Data set]. NIRD RDA. https://doi.org/10.11582/2022.00039
|
|
86
|
+
|
|
87
|
+
[2] Jenniges, Y., Sonnewald, M., Maneth, S., Olsen, A., Koch, Boris P., (2025) Unveiling 3D ocean biogeochemical provinces in the North Atlantic:
|
|
88
|
+
A systematic comparison and validation of clustering methods, Ecological Informatics, Volume 91, 103390, ISSN 1574-9541,
|
|
89
|
+
https://doi.org/10.1016/j.ecoinf.2025.103390.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Installation
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
pip install comfort-db
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Optional extras add more specialised functionality:
|
|
100
|
+
|
|
101
|
+
| Extra | Adds | Enables |
|
|
102
|
+
|---|---|-------------------------------------------------------|
|
|
103
|
+
| `plot` | matplotlib, seaborn | `comfort.plot` |
|
|
104
|
+
| `geo` | shapely, geopandas, cartopy | Water masses, Longhurst provinces, coastline distance (`distance_to_coast`) |
|
|
105
|
+
| `grid` | xarray, netcdf4 | Spatio-temporal gridding, bathymetry masking, biome classification (`load_biomes`), xarray output |
|
|
106
|
+
| `scale` | scikit-learn | `ParamScaler` |
|
|
107
|
+
| `dash` | dash, plotly | Interactive Dash explorer app |
|
|
108
|
+
| `docs` | sphinx, sphinx-rtd-theme | Building the documentation locally |
|
|
109
|
+
| `all` | everything above | |
|
|
110
|
+
|
|
111
|
+
Install via e.g.
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
pip install "comfort-db[geo,plot]"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**From source (editable, for development):**
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
git clone https://github.com/y-jenniges/comfort-db.git
|
|
121
|
+
cd comfort-db
|
|
122
|
+
pip install -e ".[dev]"
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
To build the documentation locally:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
sphinx-build documentation/source documentation/build/html
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Requires Python 3.10 or newer.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Quick start
|
|
136
|
+
|
|
137
|
+
```python
|
|
138
|
+
import comfort
|
|
139
|
+
|
|
140
|
+
# Overview of the database (no data loaded, takes some minutes)
|
|
141
|
+
comfort.info("/path/to/comfort.sqlite")
|
|
142
|
+
|
|
143
|
+
# Filter at SQL level, get back one DataFrame per parameter
|
|
144
|
+
# (output="xarray" returns an xarray Dataset and needs the `grid` extra)
|
|
145
|
+
data = comfort.load_comfort(
|
|
146
|
+
"/path/to/comfort.sqlite",
|
|
147
|
+
parameters=["NITRATE", "DIC"],
|
|
148
|
+
quality_flags=comfort.QC_GOOD, # quality filter
|
|
149
|
+
lat_min=30, lat_max=70, # latitude filter
|
|
150
|
+
date_min="2000-01-01 00:00:00", # date filter, format YYYY-MM-DD HH:MM:SS
|
|
151
|
+
target_depths=[0, 50, 100, 200, 500, 1000], # depth interpolation
|
|
152
|
+
limit=500_000, # first 500,000 rows per parameter (a warning is logged if rows are cut)
|
|
153
|
+
output="dict",
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
# Table exploration
|
|
157
|
+
with comfort.connect("/path/to/comfort.sqlite") as conn:
|
|
158
|
+
summary = comfort.describe_variables(conn, parameters=["NITRATE", "DIC"], quality_flags=comfort.QC_GOOD)
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Testing
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
pip install -e ".[dev]"
|
|
167
|
+
pytest
|
|
168
|
+
|
|
169
|
+
# Include the bathymetry test (needs a GEBCO NetCDF file)
|
|
170
|
+
export BATHYMETRY_PATH=/path/to/gebco_bathymetry.nc
|
|
171
|
+
pytest
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Citing
|
|
177
|
+
|
|
178
|
+
If you use `comfort-db` in published work, please cite the COMFORT dataset [1] and this library:
|
|
179
|
+
```bibtex
|
|
180
|
+
@article{jenniges_inprep,
|
|
181
|
+
author = {Yvonne Jenniges and Are Olsen and Boris Peter Koch and Sebastian Maneth},
|
|
182
|
+
title = {{comfort-db}: A Python toolkit to access, preprocess and explore the oceanographic COMFORT dataset},
|
|
183
|
+
journal = {Journal of Open Source Software},
|
|
184
|
+
year = {in prep.},
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## License
|
|
189
|
+
|
|
190
|
+
MIT
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# comfort-db
|
|
2
|
+
|
|
3
|
+
[](https://github.com/y-jenniges/comfort-db/blob/main/LICENSE)
|
|
4
|
+
[](https://www.python.org/)
|
|
5
|
+
[](https://comfort-db.readthedocs.io/en/latest/)
|
|
6
|
+
|
|
7
|
+
Python library for working with the [COMFORT](https://www.doi.org/10.11582/2022.00039)[1] oceanographic SQLite dataset
|
|
8
|
+
with [code documentation](https://comfort-db.readthedocs.io/en/latest/).
|
|
9
|
+
|
|
10
|
+
`comfort-db` wraps database access, preprocessing and basic analysis utilities into one library.
|
|
11
|
+
This includes filtering for quality and space-time ranges, unit conversions, spatiotemporal gridding, profile and water-mass analysis,
|
|
12
|
+
geospatial utilities, scaling, plotting and visualisation using a dashboard.
|
|
13
|
+
|
|
14
|
+
The data structure broadly follows oceanographic ship measurement practice:
|
|
15
|
+
At a latitude, longitude and time, a station defines where measurements were taken.
|
|
16
|
+
At a station, profiles are measured, i.e. a parameter like temperature at different depths with a specific instrument.
|
|
17
|
+
There can be multiple profiles at the same station, though in the COMFORT dataset, it is mostly one profile per station.
|
|
18
|
+
|
|
19
|
+
This library bases on and extends code developed in [2], including parts of the gridding, unit conversion, analysis and plotting
|
|
20
|
+
routines.
|
|
21
|
+
|
|
22
|
+
[1] Korablev, A., Olsen, A., (2022) Geophysical Institute, University of Bergen, Bjerknes Centre for Climate Research. COMFORT Dataset [Data set]. NIRD RDA. https://doi.org/10.11582/2022.00039
|
|
23
|
+
|
|
24
|
+
[2] Jenniges, Y., Sonnewald, M., Maneth, S., Olsen, A., Koch, Boris P., (2025) Unveiling 3D ocean biogeochemical provinces in the North Atlantic:
|
|
25
|
+
A systematic comparison and validation of clustering methods, Ecological Informatics, Volume 91, 103390, ISSN 1574-9541,
|
|
26
|
+
https://doi.org/10.1016/j.ecoinf.2025.103390.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pip install comfort-db
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Optional extras add more specialised functionality:
|
|
37
|
+
|
|
38
|
+
| Extra | Adds | Enables |
|
|
39
|
+
|---|---|-------------------------------------------------------|
|
|
40
|
+
| `plot` | matplotlib, seaborn | `comfort.plot` |
|
|
41
|
+
| `geo` | shapely, geopandas, cartopy | Water masses, Longhurst provinces, coastline distance (`distance_to_coast`) |
|
|
42
|
+
| `grid` | xarray, netcdf4 | Spatio-temporal gridding, bathymetry masking, biome classification (`load_biomes`), xarray output |
|
|
43
|
+
| `scale` | scikit-learn | `ParamScaler` |
|
|
44
|
+
| `dash` | dash, plotly | Interactive Dash explorer app |
|
|
45
|
+
| `docs` | sphinx, sphinx-rtd-theme | Building the documentation locally |
|
|
46
|
+
| `all` | everything above | |
|
|
47
|
+
|
|
48
|
+
Install via e.g.
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install "comfort-db[geo,plot]"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**From source (editable, for development):**
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
git clone https://github.com/y-jenniges/comfort-db.git
|
|
58
|
+
cd comfort-db
|
|
59
|
+
pip install -e ".[dev]"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
To build the documentation locally:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
sphinx-build documentation/source documentation/build/html
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Requires Python 3.10 or newer.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Quick start
|
|
73
|
+
|
|
74
|
+
```python
|
|
75
|
+
import comfort
|
|
76
|
+
|
|
77
|
+
# Overview of the database (no data loaded, takes some minutes)
|
|
78
|
+
comfort.info("/path/to/comfort.sqlite")
|
|
79
|
+
|
|
80
|
+
# Filter at SQL level, get back one DataFrame per parameter
|
|
81
|
+
# (output="xarray" returns an xarray Dataset and needs the `grid` extra)
|
|
82
|
+
data = comfort.load_comfort(
|
|
83
|
+
"/path/to/comfort.sqlite",
|
|
84
|
+
parameters=["NITRATE", "DIC"],
|
|
85
|
+
quality_flags=comfort.QC_GOOD, # quality filter
|
|
86
|
+
lat_min=30, lat_max=70, # latitude filter
|
|
87
|
+
date_min="2000-01-01 00:00:00", # date filter, format YYYY-MM-DD HH:MM:SS
|
|
88
|
+
target_depths=[0, 50, 100, 200, 500, 1000], # depth interpolation
|
|
89
|
+
limit=500_000, # first 500,000 rows per parameter (a warning is logged if rows are cut)
|
|
90
|
+
output="dict",
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
# Table exploration
|
|
94
|
+
with comfort.connect("/path/to/comfort.sqlite") as conn:
|
|
95
|
+
summary = comfort.describe_variables(conn, parameters=["NITRATE", "DIC"], quality_flags=comfort.QC_GOOD)
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Testing
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
pip install -e ".[dev]"
|
|
104
|
+
pytest
|
|
105
|
+
|
|
106
|
+
# Include the bathymetry test (needs a GEBCO NetCDF file)
|
|
107
|
+
export BATHYMETRY_PATH=/path/to/gebco_bathymetry.nc
|
|
108
|
+
pytest
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Citing
|
|
114
|
+
|
|
115
|
+
If you use `comfort-db` in published work, please cite the COMFORT dataset [1] and this library:
|
|
116
|
+
```bibtex
|
|
117
|
+
@article{jenniges_inprep,
|
|
118
|
+
author = {Yvonne Jenniges and Are Olsen and Boris Peter Koch and Sebastian Maneth},
|
|
119
|
+
title = {{comfort-db}: A Python toolkit to access, preprocess and explore the oceanographic COMFORT dataset},
|
|
120
|
+
journal = {Journal of Open Source Software},
|
|
121
|
+
year = {in prep.},
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## License
|
|
126
|
+
|
|
127
|
+
MIT
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Build instructions
|
|
2
|
+
[build-system]
|
|
3
|
+
requires = ["setuptools>=77"]
|
|
4
|
+
build-backend = "setuptools.build_meta"
|
|
5
|
+
|
|
6
|
+
# Metadata and requirements
|
|
7
|
+
[project]
|
|
8
|
+
name = "comfort-db"
|
|
9
|
+
dynamic = ["version"] # read from comfort.__version__, see [tool.setuptools.dynamic]
|
|
10
|
+
description = "Helper library for working with the COMFORT oceanographic dataset (SQLite)"
|
|
11
|
+
authors = [
|
|
12
|
+
{ name = "Yvonne Jenniges", email = "yvonne.jenniges@gmail.com" },
|
|
13
|
+
{ name = "Are Olsen" },
|
|
14
|
+
{ name = "Boris Peter Koch" },
|
|
15
|
+
{ name = "Sebastian Maneth" },
|
|
16
|
+
]
|
|
17
|
+
license = "MIT"
|
|
18
|
+
license-files = ["LICENSE"]
|
|
19
|
+
readme = "README.md"
|
|
20
|
+
requires-python = ">=3.10"
|
|
21
|
+
keywords = ["oceanography", "data-exploration", "data-analysis", "COMFORT", "SQLite"]
|
|
22
|
+
classifiers = [
|
|
23
|
+
"Development Status :: 4 - Beta",
|
|
24
|
+
"Intended Audience :: Science/Research",
|
|
25
|
+
"Programming Language :: Python :: 3",
|
|
26
|
+
"Programming Language :: Python :: 3.10",
|
|
27
|
+
"Programming Language :: Python :: 3.11",
|
|
28
|
+
"Programming Language :: Python :: 3.12",
|
|
29
|
+
"Programming Language :: Python :: 3.13",
|
|
30
|
+
"Topic :: Scientific/Engineering",
|
|
31
|
+
]
|
|
32
|
+
dependencies = [
|
|
33
|
+
"numpy>=1.23",
|
|
34
|
+
"pandas>=2.0",
|
|
35
|
+
"scipy>=1.10",
|
|
36
|
+
"gsw>=3.6.16",
|
|
37
|
+
"python-dateutil>=2.8.2",
|
|
38
|
+
"python-dotenv>=1.0",
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
# Optional dependencies
|
|
42
|
+
[project.optional-dependencies]
|
|
43
|
+
plot = [
|
|
44
|
+
"matplotlib>=3.8.1",
|
|
45
|
+
"seaborn>=0.13",
|
|
46
|
+
]
|
|
47
|
+
geo = [
|
|
48
|
+
"shapely>=2.0",
|
|
49
|
+
"geopandas>=0.14.4",
|
|
50
|
+
"cartopy>=0.22",
|
|
51
|
+
]
|
|
52
|
+
grid = [
|
|
53
|
+
"xarray>=2023.1",
|
|
54
|
+
"netcdf4>=1.6",
|
|
55
|
+
]
|
|
56
|
+
scale = [
|
|
57
|
+
"scikit-learn>=1.2",
|
|
58
|
+
]
|
|
59
|
+
dash = [
|
|
60
|
+
"dash>=2.14",
|
|
61
|
+
"dash-bootstrap-components>=1.5",
|
|
62
|
+
"plotly>=5.18",
|
|
63
|
+
]
|
|
64
|
+
docs = [
|
|
65
|
+
"sphinx>=7.0",
|
|
66
|
+
"sphinx-rtd-theme>=2.0",
|
|
67
|
+
]
|
|
68
|
+
all = [
|
|
69
|
+
"comfort-db[plot]",
|
|
70
|
+
"comfort-db[geo]",
|
|
71
|
+
"comfort-db[grid]",
|
|
72
|
+
"comfort-db[scale]",
|
|
73
|
+
"comfort-db[dash]",
|
|
74
|
+
"comfort-db[docs]",
|
|
75
|
+
]
|
|
76
|
+
test = [
|
|
77
|
+
"pytest>=7.4",
|
|
78
|
+
"pytest-cov>=4.1",
|
|
79
|
+
"openpyxl>=3.1",
|
|
80
|
+
]
|
|
81
|
+
dev = [
|
|
82
|
+
"comfort-db[all]",
|
|
83
|
+
"comfort-db[test]",
|
|
84
|
+
]
|
|
85
|
+
|
|
86
|
+
# Links shown on PyPI
|
|
87
|
+
[project.urls]
|
|
88
|
+
Repository = "https://github.com/y-jenniges/comfort-db"
|
|
89
|
+
Issues = "https://github.com/y-jenniges/comfort-db/issues"
|
|
90
|
+
Documentation = "https://comfort-db.readthedocs.io/en/latest/"
|
|
91
|
+
|
|
92
|
+
# Directory of packages
|
|
93
|
+
[tool.setuptools.packages.find]
|
|
94
|
+
where = ["src"]
|
|
95
|
+
|
|
96
|
+
# Single source of the version: Read from src/comfort/__init__.py
|
|
97
|
+
[tool.setuptools.dynamic]
|
|
98
|
+
version = { attr = "comfort.__version__" }
|
|
99
|
+
|
|
100
|
+
# Test suite settings
|
|
101
|
+
[tool.pytest.ini_options]
|
|
102
|
+
testpaths = ["test"] # test dir
|
|
103
|
+
pythonpath = ["src"] # source dir
|
|
104
|
+
tmp_path_retention_policy = "failed" # only keep temp dirs if tests fail
|
|
105
|
+
markers = [
|
|
106
|
+
"needs_bathymetry: Tests that require a real bathymetry NetCDF file (skipped by default)",
|
|
107
|
+
] # register bathymetry marker
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"""comfort-db - helper library for the COMFORT oceanographic dataset."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
__version__ = "0.1.0"
|
|
5
|
+
|
|
6
|
+
from .io import (
|
|
7
|
+
connect,
|
|
8
|
+
describe_variables,
|
|
9
|
+
info,
|
|
10
|
+
list_parameters,
|
|
11
|
+
load_comfort,
|
|
12
|
+
read_parameter,
|
|
13
|
+
read_station,
|
|
14
|
+
subset_region,
|
|
15
|
+
)
|
|
16
|
+
from .qc import QC_ALL, QC_GOOD, QCFilter
|
|
17
|
+
from .gridding import Grid
|
|
18
|
+
from .units import UnitsConverter
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
"__version__",
|
|
22
|
+
"connect",
|
|
23
|
+
"describe_variables",
|
|
24
|
+
"info",
|
|
25
|
+
"list_parameters",
|
|
26
|
+
"load_comfort",
|
|
27
|
+
"read_parameter",
|
|
28
|
+
"read_station",
|
|
29
|
+
"subset_region",
|
|
30
|
+
"QC_ALL",
|
|
31
|
+
"QC_GOOD",
|
|
32
|
+
"QCFilter",
|
|
33
|
+
"Grid",
|
|
34
|
+
"UnitsConverter",
|
|
35
|
+
]
|