dbdreader 0.5.8__tar.gz → 0.6.0.dev1__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.
Files changed (90) hide show
  1. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/MANIFEST.in +1 -1
  2. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/PKG-INFO +88 -92
  3. dbdreader-0.5.8/README.rst → dbdreader-0.6.0.dev1/README.md +77 -86
  4. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/__init__.py +5 -1
  5. dbdreader-0.6.0.dev1/dbdreader/data/02380107.ecd +0 -0
  6. dbdreader-0.6.0.dev1/dbdreader/data/02380108.ecd +0 -0
  7. dbdreader-0.6.0.dev1/dbdreader/data/02450133.tcd +0 -0
  8. dbdreader-0.6.0.dev1/dbdreader/data/02450137.tcd +0 -0
  9. dbdreader-0.6.0.dev1/dbdreader/data/amadeus-2014-203-00-000.SBD +0 -0
  10. dbdreader-0.6.0.dev1/dbdreader/data/amadeus-2014-203-00-000.TBD +0 -0
  11. dbdreader-0.6.0.dev1/dbdreader/data/cac/5fbf5947.cac +99 -0
  12. dbdreader-0.6.0.dev1/dbdreader/data/dbd2asc_output.txt +25 -0
  13. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/dbdreader.py +82 -18
  14. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/decompress.py +4 -0
  15. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/scripts.py +10 -7
  16. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader.egg-info/PKG-INFO +88 -92
  17. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader.egg-info/SOURCES.txt +10 -1
  18. dbdreader-0.6.0.dev1/dbdreader.egg-info/requires.txt +3 -0
  19. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/extension/dbdreader.c +73 -66
  20. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/extension/decompress.c +54 -35
  21. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/extension/include/dbdreader.h +1 -1
  22. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/extension/include/decompress.h +6 -1
  23. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/extension/py_dbdreader.c +18 -4
  24. dbdreader-0.6.0.dev1/pyproject.toml +76 -0
  25. dbdreader-0.5.8/dbdreader.egg-info/requires.txt → dbdreader-0.6.0.dev1/requirements.txt +2 -0
  26. dbdreader-0.6.0.dev1/setup.py +94 -0
  27. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/tests/test_dbdreader.py +33 -6
  28. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/tests/test_decompress.py +30 -1
  29. dbdreader-0.5.8/requirements.txt +0 -4
  30. dbdreader-0.5.8/setup.py +0 -147
  31. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/COPYING +0 -0
  32. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/COPYRIGHT +0 -0
  33. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/INSTALL.rst +0 -0
  34. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/LICENSE +0 -0
  35. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/01600000.dcd +0 -0
  36. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/01600000.ebd +0 -0
  37. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/01600000.ecd +0 -0
  38. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/01600000.mcg +0 -0
  39. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/01600000.mlg +0 -0
  40. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/01600001.dbd +0 -0
  41. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/01600001.dcd +0 -0
  42. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/01600001.ebd +0 -0
  43. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/01600001.ecd +0 -0
  44. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/amadeus-2014-204-05-000.dbd +0 -0
  45. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/amadeus-2014-204-05-000.ebd +0 -0
  46. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/amadeus-2014-204-05-000.sbd +0 -0
  47. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/amadeus-2014-204-05-000.tbd +0 -0
  48. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/amadeus-2014-204-05-001.sbd +0 -0
  49. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/amadeus-2014-204-05-001.tbd +0 -0
  50. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/amadeus-2014-204-05-002.sbd +0 -0
  51. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/amadeus-2014-204-05-002.tbd +0 -0
  52. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/ammonite-2008-028-01-000.mbd +0 -0
  53. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/cac/06a36d4e.cac +0 -0
  54. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/cac/06a36d4e.ccc +0 -0
  55. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/cac/093bd5ed.cac +0 -0
  56. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/cac/0f682cb2.cac +0 -0
  57. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/cac/39b2c12e.cac +0 -0
  58. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/cac/468fd1be.cac +0 -0
  59. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/cac/61b1780f.cac +0 -0
  60. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/cac/6f9a08d3.cac +0 -0
  61. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/cac/813b137d.cac +0 -0
  62. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/cac/8d31d0c8.cac +0 -0
  63. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/cac/92610b65.cac +0 -0
  64. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/cac/c4ec741e.cac +0 -0
  65. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/cac/d6f44165.cac +0 -0
  66. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/cac/daad1b20.cac +0 -0
  67. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/cac/daad1b20.ccc +0 -0
  68. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/cac/dc76ebd5.cac +0 -0
  69. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/cac_missing/d6f44165.cac +0 -0
  70. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/electa-2023-143-00-050.sbd +0 -0
  71. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/electa-2023-143-00-050.tbd +0 -0
  72. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/empty-2014-204-05-000.dbd +0 -0
  73. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/hal_1002-2024-183-4-4.sbd +0 -0
  74. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/hal_1002-2024-183-4-4.tbd +0 -0
  75. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/hal_1002-2024-183-4-6.tbd +0 -0
  76. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/invalid_encoding-2014-204-05-000.dbd +0 -0
  77. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/sebastian-2014-204-05-000.dbd +0 -0
  78. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/sebastian-2014-204-05-000.ebd +0 -0
  79. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/sebastian-2014-204-05-001.dbd +0 -0
  80. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/sebastian-2014-204-05-001.ebd +0 -0
  81. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/unit_887-2021-321-3-0.sbd +0 -0
  82. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader/data/unit_887-2021-321-3-0.tbd +0 -0
  83. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader.egg-info/dependency_links.txt +0 -0
  84. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader.egg-info/entry_points.txt +0 -0
  85. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/dbdreader.egg-info/top_level.txt +0 -0
  86. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/examples/read_multiple_dbd_files.py +0 -0
  87. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/examples/read_single_dbd_file.py +0 -0
  88. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/lz4/include/lz4.h +0 -0
  89. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/lz4/lz4.c +0 -0
  90. {dbdreader-0.5.8 → dbdreader-0.6.0.dev1}/setup.cfg +0 -0
@@ -1,4 +1,4 @@
1
- include README.rst COPYING COPYRIGHT MANIFEST.in INSTALL.rst LICENSE
1
+ include README.md COPYING COPYRIGHT MANIFEST.in INSTALL.rst LICENSE
2
2
  include requirements.txt
3
3
  include extension/*.c
4
4
  include extension/include/*.h
@@ -1,38 +1,48 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: dbdreader
3
- Version: 0.5.8
3
+ Version: 0.6.0.dev1
4
4
  Summary: A python module to access binary data files generated by Teledyne WebbResearch gliders
5
- Home-page: https://dbdreader.readthedocs.io/en/latest/
6
- Author: Lucas Merckelbach
7
- Author-email: lucas.merckelbach@hereon.de
5
+ Author-email: Lucas Merckelbach <lucas.merckelbach@hereon.de>
6
+ License: GPL-3.0
7
+ Project-URL: Homepage, https://dbdreader.readthedocs.io/en/latest/
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: Intended Audience :: Science/Research
10
10
  Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
11
11
  Classifier: Operating System :: POSIX
12
- Description-Content-Type: text/x-rst
12
+ Requires-Python: >=3.10
13
+ Description-Content-Type: text/markdown
13
14
  License-File: LICENSE
14
15
  License-File: COPYING
16
+ Requires-Dist: lz4>=4.4.5
17
+ Requires-Dist: numpy>=2.2.6
18
+ Requires-Dist: scipy>=1.15.3
19
+ Dynamic: license-file
15
20
 
16
- |PyPI version| |Docs badge| |License|
21
+ [![PyPI version](https://badgen.net/pypi/v/dbdreader)](https://pypi.org/project/dbdreader)
22
+ [![Docs badge](https://readthedocs.org/projects/dbdreader/badge/?version=latest)](https://dbdreader.readthedocs.io/en/latest/)
23
+ [![License](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
17
24
 
18
- DBDREADER
19
- =========
25
+ # DBDREADER
26
+
27
+ ## Synopsis
20
28
 
21
- Synopsis
22
- --------
23
29
  Slocum ocean gliders are autonomous underwater vehicles, used for
24
30
  making oceanographic measurements. The data that these devices and
25
31
  their sensors collect, are stored in binary data files. The python
26
32
  module *dbdreader* provides the utilities to extract the data from the
27
33
  binary files, so that they can be further analysed.
28
34
 
29
- Change log
30
- ----------
35
+ ## Change log
36
+
37
+ ### version 0.5.9
31
38
 
32
- version 0.5.8
39
+ * Handles reading errors that can occur when a compressed file turns
40
+ out to be corrupted.
41
+
42
+ ### version 0.5.8
33
43
 
34
44
  * Changes default location for cache files on linux from
35
- $HOME/.dbdreader to $HOME/.local/share/dbdreader
45
+ `$HOME/.dbdreader` to `$HOME/.local/share/dbdreader`
36
46
 
37
47
  * Introduces new class DBDCache to manage the location where cache
38
48
  files are looked up. Constructing an object with an arguments (re-)sets a
@@ -44,38 +54,38 @@ version 0.5.8
44
54
  returns just those data that are present. In case of get_sync and
45
55
  friends, data are interpolated if possible, or padded with nans.
46
56
 
47
- Version 0.5.7
57
+ ### Version 0.5.7
48
58
 
49
59
  * Drops dependency on python 3.10+, introduced in 0.5.6, and should
50
60
  work still with python 3.9.
51
61
 
52
- Version 0.5.6
62
+ ### Version 0.5.6
53
63
 
54
64
  * Moves data directory under dbdreader, making these files accessible
55
65
  after an pip install
56
66
 
57
- Version 0.5.5
67
+ ### Version 0.5.5
58
68
 
59
69
  * Makes MultiDBD's get_CTD_sync method compatible with RBR CTD data.
60
70
 
61
- Version 0.5.4
71
+ ### Version 0.5.4
62
72
 
63
73
  * Adds support for reading compressed data files for windows platform.
64
74
  * Improved building environment
65
75
 
66
- Version 0.5.1
76
+ ### Version 0.5.1
67
77
 
68
78
  * Adds support for reading compressed data files
69
- * dbdrename.py now accepts -x and -X options to rename compressed data files as uncompressed data files
79
+ * dbdrename now accepts -x and -X options to rename compressed data files as uncompressed data files
70
80
 
71
- Version 0.4.15
81
+ ### Version 0.4.15
72
82
 
73
- * Modifies sorting key algorithm to the DBDList class. This fixes a
74
- bug when glider data filenames are composed of a glider name that
83
+ * Modifies sorting key algorithm to the DBDList class. This fixes a
84
+ bug when glider data filenames are composed of a glider name that
75
85
  contains a dash. For example, filenames such as hereon-amadeus-2019-3-1.sbd
76
86
  would fail, but are valid now.
77
87
 
78
- Version 0.4.14
88
+ ### Version 0.4.14
79
89
 
80
90
  * Adds a new option to the get() method of the MultiDBD class, where
81
91
  if the keyword include_sources=True, for each parameter an
@@ -85,7 +95,7 @@ Version 0.4.14
85
95
 
86
96
  This merges the (modified) pull request #14 by MCazaly.
87
97
 
88
- Version 0.4.13
98
+ ### Version 0.4.13
89
99
 
90
100
  * Modifies behaviour when the user requests a parameter that has no
91
101
  data. If the requested parameter is not a valid glider sensor name,
@@ -95,13 +105,13 @@ Version 0.4.13
95
105
  This behaviour fixes a bug for MultiDBD:
96
106
  each file opened with MultiDBD would fail to produce any data if one or
97
107
  more parameters that are asked for, are not present in the file.
98
-
108
+
99
109
  New behaviour returns data for the exisiting parameters (only); empty
100
110
  array for the missing parameters (or nans if return_nans=True)
101
111
 
102
112
  Concludes pull request #16 by jklymak.
103
113
 
104
- Version 0.4.12
114
+ ### Version 0.4.12
105
115
 
106
116
  * PatternSelect now accepts the option of a non-standard cache
107
117
  directory.
@@ -109,9 +119,9 @@ Version 0.4.12
109
119
 
110
120
  * MultiDBD's get_sync() now returns nan's for those parameters for
111
121
  which no data exist, provided that at least one of the requested
112
- parameters contains data.
113
-
114
- Version 0.4.11
122
+ parameters contains data.
123
+
124
+ ### Version 0.4.11
115
125
 
116
126
  * Version 0.4.9 introduced a bug that in some rare circumstances caused
117
127
  segmentation faults. This has been fixed.
@@ -121,8 +131,7 @@ Version 0.4.11
121
131
  cache file, detailed information can be obtained from the .data
122
132
  property of the exception instance.
123
133
 
124
-
125
- Version 0.4.10
134
+ ### Version 0.4.10
126
135
 
127
136
  * Includes pull request by jklymak, which allows dbdreader to deal
128
137
  with empty files, and files capitalised file extensions, as well as
@@ -136,65 +145,61 @@ Version 0.4.10
136
145
  pattern. An error is raised if pattern is specified explicitly when
137
146
  filenames is given as a string.
138
147
 
139
- Version 0.4.9
148
+ ### Version 0.4.9
140
149
 
141
150
  * Bug fix for handling inf values correctly (issue #8). Thanks to jr3cermak for spotting this bug.
142
151
  * Bug fix for incorrect behaviour when reading the time parameter explicitly for example xxx.get("m_present_time").
143
152
 
144
- Version 0.4.8
153
+ ### Version 0.4.8
145
154
 
146
155
  * Support for reading {demnst}bd files from G3S gliders (issue #6). (Thanks to Owain Jones)
147
156
 
148
157
  * Bug fix for correctly throwing an exception when cache file is missing(issue #5)
149
158
 
150
- Version 0.4.7
159
+ ### Version 0.4.7
151
160
 
152
161
  * Bug fix for reading dbd files on Windows.
153
162
 
154
- * a wheel provided for CPython 3.9 on Windows 64 bit.
163
+ * a wheel provided for CPython 3.9 on Windows 64 bit.
155
164
 
156
- Version 0.4.6
165
+ ### Version 0.4.6
157
166
 
158
167
  * Added get_CTD_sync, a convenience method to retrieve CTD data, and other parameters mapped on the CTD time stamps. Also ensures time stamps are monotonically increasing.
159
168
 
160
169
  * Adds bounds to what values of latitude and longitude are considered valid.
161
170
 
162
- Version 0.4.5
171
+ ### Version 0.4.5
163
172
 
164
173
  * dbdreader now ignores the first line of data in each binary file
165
-
166
- * dbdreader checks whether the value of the parameters read are finite, ignoring them if they are not.
167
-
168
174
 
175
+ * dbdreader checks whether the value of the parameters read are finite, ignoring them if they are not.
169
176
 
170
- Installation (linux)
171
- --------------------
177
+ ## Installation (linux)
172
178
 
173
179
  The python module *dbdreader* can be installed from source, using the
174
180
  standard method to install python code. Note that this method requires
175
181
  an C-extension to be build. (The actual reading from files is done in
176
182
  C for speed.) In order to build the extension successfully, you would
177
183
  need a C-compiler. On Linux, this can be gcc, with supporting
178
- development/header files for python. On Fedora you would do ``sudo dnf
179
- install python3-devel``, or ``sudo apt-get install python3-dev`` on
184
+ development/header files for python. On Fedora you would do `sudo dnf
185
+ install python3-devel`, or `sudo apt-get install python3-dev` on
180
186
  Ubuntu.
181
187
 
182
188
  Furthermore, as of version 0.5, which adds support for reading
183
189
  compressed files, a dependency on the lz4 library is introduced. If
184
190
  available, the system-wide library will be used (recommended
185
191
  approach). Alternatively, the lz4.[ch] files from the original source
186
- (https://github.com/lz4/lz4), and included in this package, will be
192
+ (<https://github.com/lz4/lz4>), and included in this package, will be
187
193
  compiled into the C-extension. To install the system-wide lz4 library
188
- on Fedora you would do ``sudo dnf install lz4-devel lz4-libs``. On
189
- Ubuntu this can be achieved by ``sudo apt-get install liblz4-dev
190
- liblz4-1``.
194
+ on Fedora you would do `sudo dnf install lz4-devel lz4-libs`. On
195
+ Ubuntu this can be achieved by `sudo apt-get install liblz4-dev
196
+ liblz4-1`.
191
197
 
192
- Alternatively, dbdreader can also be installed from PyPi, using ``pip3
193
- install dbdreader``.
198
+ Alternatively, dbdreader can also be installed from PyPi, using `pip3
199
+ install dbdreader`.
194
200
 
201
+ ## Installation on Windows
195
202
 
196
- Installation on Windows
197
- -----------------------
198
203
  If you want to install dbdreader from source, you will need a C
199
204
  compiler as well to compile the C-extension. Besides the Python
200
205
  environment you will need to install the Microsoft Visual Studio
@@ -203,29 +208,29 @@ you tick the box *python development* during the setup. Once installed
203
208
  dbdreader can be installed, and the C-extension should be compiled
204
209
  automatically.
205
210
 
206
-
207
- Installiation using pip, for example as in ``py -m pip install
208
- dbdreader`` also requires the C compiler. For Python version 3.9,
211
+ Installiation using pip, for example as in `py -m pip install
212
+ dbdreader` also requires the C compiler. For Python version 3.9,
209
213
  however, a wheel is provided, which can be installed adding the option
210
- ``--only-binary :all:`` to the pip command: ::
214
+ `--only-binary :all:` to the pip command:
211
215
 
212
- $ pip install --only-binary :all: dbdreader
216
+ ```
217
+ $ pip install --only-binary :all: dbdreader
218
+ ```
213
219
 
220
+ ## Documentation
214
221
 
215
- Documentation
216
- -------------
217
- Comprehensive documentation is provided at https://dbdreader.readthedocs.io/en/latest/
222
+ Comprehensive documentation is provided at <https://dbdreader.readthedocs.io/en/latest/>
223
+
224
+ ## Quick-start
218
225
 
219
- Quick-start
220
- -----------
221
226
  For the impatient...
222
227
 
223
228
  The dbdreader module implements a class DBD() which provides the
224
229
  machinery to read a single dbd file. The most commonly used methods
225
230
  are:
226
231
 
227
- * get(parametername)
228
- * get_sync(parametername, \*other_parameternames)
232
+ * `get(parametername)`
233
+ * `get_sync(parametername, *other_parameternames)`
229
234
 
230
235
  The first method returs a tuple with time and values for requested
231
236
  parameter. The second method, returns a tuple with time and values of
@@ -237,40 +242,31 @@ number of them. This interface is implemented by the MultiDBD
237
242
  class. Files can either be specified as a list of filenames, or as a
238
243
  pattern using wildcards.
239
244
 
240
- Examples
241
- ^^^^^^^^
245
+ ### Examples
246
+
247
+ To read a single file:
242
248
 
243
- To read a single file::
249
+ ```python
250
+ >>> dbd = DBD("00010010.dbd")
251
+ >>> t, pitch = dbd.get("m_pitch")
252
+ >>> t, hdg, ptch, roll = dbd.get_sync("m_heading", "m_pitch", "m_roll")
253
+ ```
244
254
 
245
- >>> dbd = DBD("00010010.dbd")
246
- >>> t, pitch = dbd.get("m_pitch")
247
- >>> t, hdg, ptch, roll = dbd.get_sync("m_heading", "m_pitch", "m_roll)
255
+ Or, doing the same, but using both dbd and ebd files:
248
256
 
249
- Or, doing the same, but using both dbd and ebd files::
250
-
251
- >>> dbd = DBD(pattern="00010010.[de]bd")
252
- >>> t, pitch = dbd.get("m_pitch")
253
- >>> t, hdg, ptch, roll = dbd.get_sync("m_heading", "m_pitch", "m_roll")
254
- >>> t, p_ctd, p_nav = dbd.get_sync("sci_water_pressure", "m_water_pressure")
257
+ ```python
258
+ >>> dbd = DBD(pattern="00010010.[de]bd")
259
+ >>> t, pitch = dbd.get("m_pitch")
260
+ >>> t, hdg, ptch, roll = dbd.get_sync("m_heading", "m_pitch", "m_roll")
261
+ >>> t, p_ctd, p_nav = dbd.get_sync("sci_water_pressure", "m_water_pressure")
262
+ ```
255
263
 
256
-
264
+ ## Python 2
257
265
 
258
- Python 2
259
- --------
260
266
  Python 2.7 is not supported anymore. However, you should be able to
261
267
  make the code able to run on python2.7 using the *future* package.
262
268
 
263
269
  * pip install future
264
270
  * pasteurize dbdreader.
265
271
 
266
- For details see http://python-future.org/pasteurize.html.
267
-
268
-
269
- .. |PyPI version| image:: https://badgen.net/pypi/v/dbdreader
270
- :target: https://pypi.org/project/dbdreader
271
- .. |Docs badge| image:: https://readthedocs.org/projects/dbdreader/badge/?version=latest
272
- :target: https://dbdreader.readthedocs.io/en/latest/
273
- .. |License| image:: https://img.shields.io/badge/License-GPLv3-blue.svg
274
- :target: https://www.gnu.org/licenses/gpl-3.0
275
-
276
-
272
+ For details see <http://python-future.org/pasteurize.html>.
@@ -1,23 +1,28 @@
1
- |PyPI version| |Docs badge| |License|
1
+ [![PyPI version](https://badgen.net/pypi/v/dbdreader)](https://pypi.org/project/dbdreader)
2
+ [![Docs badge](https://readthedocs.org/projects/dbdreader/badge/?version=latest)](https://dbdreader.readthedocs.io/en/latest/)
3
+ [![License](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
2
4
 
3
- DBDREADER
4
- =========
5
+ # DBDREADER
6
+
7
+ ## Synopsis
5
8
 
6
- Synopsis
7
- --------
8
9
  Slocum ocean gliders are autonomous underwater vehicles, used for
9
10
  making oceanographic measurements. The data that these devices and
10
11
  their sensors collect, are stored in binary data files. The python
11
12
  module *dbdreader* provides the utilities to extract the data from the
12
13
  binary files, so that they can be further analysed.
13
14
 
14
- Change log
15
- ----------
15
+ ## Change log
16
+
17
+ ### version 0.5.9
16
18
 
17
- version 0.5.8
19
+ * Handles reading errors that can occur when a compressed file turns
20
+ out to be corrupted.
21
+
22
+ ### version 0.5.8
18
23
 
19
24
  * Changes default location for cache files on linux from
20
- $HOME/.dbdreader to $HOME/.local/share/dbdreader
25
+ `$HOME/.dbdreader` to `$HOME/.local/share/dbdreader`
21
26
 
22
27
  * Introduces new class DBDCache to manage the location where cache
23
28
  files are looked up. Constructing an object with an arguments (re-)sets a
@@ -29,38 +34,38 @@ version 0.5.8
29
34
  returns just those data that are present. In case of get_sync and
30
35
  friends, data are interpolated if possible, or padded with nans.
31
36
 
32
- Version 0.5.7
37
+ ### Version 0.5.7
33
38
 
34
39
  * Drops dependency on python 3.10+, introduced in 0.5.6, and should
35
40
  work still with python 3.9.
36
41
 
37
- Version 0.5.6
42
+ ### Version 0.5.6
38
43
 
39
44
  * Moves data directory under dbdreader, making these files accessible
40
45
  after an pip install
41
46
 
42
- Version 0.5.5
47
+ ### Version 0.5.5
43
48
 
44
49
  * Makes MultiDBD's get_CTD_sync method compatible with RBR CTD data.
45
50
 
46
- Version 0.5.4
51
+ ### Version 0.5.4
47
52
 
48
53
  * Adds support for reading compressed data files for windows platform.
49
54
  * Improved building environment
50
55
 
51
- Version 0.5.1
56
+ ### Version 0.5.1
52
57
 
53
58
  * Adds support for reading compressed data files
54
- * dbdrename.py now accepts -x and -X options to rename compressed data files as uncompressed data files
59
+ * dbdrename now accepts -x and -X options to rename compressed data files as uncompressed data files
55
60
 
56
- Version 0.4.15
61
+ ### Version 0.4.15
57
62
 
58
- * Modifies sorting key algorithm to the DBDList class. This fixes a
59
- bug when glider data filenames are composed of a glider name that
63
+ * Modifies sorting key algorithm to the DBDList class. This fixes a
64
+ bug when glider data filenames are composed of a glider name that
60
65
  contains a dash. For example, filenames such as hereon-amadeus-2019-3-1.sbd
61
66
  would fail, but are valid now.
62
67
 
63
- Version 0.4.14
68
+ ### Version 0.4.14
64
69
 
65
70
  * Adds a new option to the get() method of the MultiDBD class, where
66
71
  if the keyword include_sources=True, for each parameter an
@@ -70,7 +75,7 @@ Version 0.4.14
70
75
 
71
76
  This merges the (modified) pull request #14 by MCazaly.
72
77
 
73
- Version 0.4.13
78
+ ### Version 0.4.13
74
79
 
75
80
  * Modifies behaviour when the user requests a parameter that has no
76
81
  data. If the requested parameter is not a valid glider sensor name,
@@ -80,13 +85,13 @@ Version 0.4.13
80
85
  This behaviour fixes a bug for MultiDBD:
81
86
  each file opened with MultiDBD would fail to produce any data if one or
82
87
  more parameters that are asked for, are not present in the file.
83
-
88
+
84
89
  New behaviour returns data for the exisiting parameters (only); empty
85
90
  array for the missing parameters (or nans if return_nans=True)
86
91
 
87
92
  Concludes pull request #16 by jklymak.
88
93
 
89
- Version 0.4.12
94
+ ### Version 0.4.12
90
95
 
91
96
  * PatternSelect now accepts the option of a non-standard cache
92
97
  directory.
@@ -94,9 +99,9 @@ Version 0.4.12
94
99
 
95
100
  * MultiDBD's get_sync() now returns nan's for those parameters for
96
101
  which no data exist, provided that at least one of the requested
97
- parameters contains data.
98
-
99
- Version 0.4.11
102
+ parameters contains data.
103
+
104
+ ### Version 0.4.11
100
105
 
101
106
  * Version 0.4.9 introduced a bug that in some rare circumstances caused
102
107
  segmentation faults. This has been fixed.
@@ -106,8 +111,7 @@ Version 0.4.11
106
111
  cache file, detailed information can be obtained from the .data
107
112
  property of the exception instance.
108
113
 
109
-
110
- Version 0.4.10
114
+ ### Version 0.4.10
111
115
 
112
116
  * Includes pull request by jklymak, which allows dbdreader to deal
113
117
  with empty files, and files capitalised file extensions, as well as
@@ -121,65 +125,61 @@ Version 0.4.10
121
125
  pattern. An error is raised if pattern is specified explicitly when
122
126
  filenames is given as a string.
123
127
 
124
- Version 0.4.9
128
+ ### Version 0.4.9
125
129
 
126
130
  * Bug fix for handling inf values correctly (issue #8). Thanks to jr3cermak for spotting this bug.
127
131
  * Bug fix for incorrect behaviour when reading the time parameter explicitly for example xxx.get("m_present_time").
128
132
 
129
- Version 0.4.8
133
+ ### Version 0.4.8
130
134
 
131
135
  * Support for reading {demnst}bd files from G3S gliders (issue #6). (Thanks to Owain Jones)
132
136
 
133
137
  * Bug fix for correctly throwing an exception when cache file is missing(issue #5)
134
138
 
135
- Version 0.4.7
139
+ ### Version 0.4.7
136
140
 
137
141
  * Bug fix for reading dbd files on Windows.
138
142
 
139
- * a wheel provided for CPython 3.9 on Windows 64 bit.
143
+ * a wheel provided for CPython 3.9 on Windows 64 bit.
140
144
 
141
- Version 0.4.6
145
+ ### Version 0.4.6
142
146
 
143
147
  * Added get_CTD_sync, a convenience method to retrieve CTD data, and other parameters mapped on the CTD time stamps. Also ensures time stamps are monotonically increasing.
144
148
 
145
149
  * Adds bounds to what values of latitude and longitude are considered valid.
146
150
 
147
- Version 0.4.5
151
+ ### Version 0.4.5
148
152
 
149
153
  * dbdreader now ignores the first line of data in each binary file
150
-
151
- * dbdreader checks whether the value of the parameters read are finite, ignoring them if they are not.
152
-
153
154
 
155
+ * dbdreader checks whether the value of the parameters read are finite, ignoring them if they are not.
154
156
 
155
- Installation (linux)
156
- --------------------
157
+ ## Installation (linux)
157
158
 
158
159
  The python module *dbdreader* can be installed from source, using the
159
160
  standard method to install python code. Note that this method requires
160
161
  an C-extension to be build. (The actual reading from files is done in
161
162
  C for speed.) In order to build the extension successfully, you would
162
163
  need a C-compiler. On Linux, this can be gcc, with supporting
163
- development/header files for python. On Fedora you would do ``sudo dnf
164
- install python3-devel``, or ``sudo apt-get install python3-dev`` on
164
+ development/header files for python. On Fedora you would do `sudo dnf
165
+ install python3-devel`, or `sudo apt-get install python3-dev` on
165
166
  Ubuntu.
166
167
 
167
168
  Furthermore, as of version 0.5, which adds support for reading
168
169
  compressed files, a dependency on the lz4 library is introduced. If
169
170
  available, the system-wide library will be used (recommended
170
171
  approach). Alternatively, the lz4.[ch] files from the original source
171
- (https://github.com/lz4/lz4), and included in this package, will be
172
+ (<https://github.com/lz4/lz4>), and included in this package, will be
172
173
  compiled into the C-extension. To install the system-wide lz4 library
173
- on Fedora you would do ``sudo dnf install lz4-devel lz4-libs``. On
174
- Ubuntu this can be achieved by ``sudo apt-get install liblz4-dev
175
- liblz4-1``.
174
+ on Fedora you would do `sudo dnf install lz4-devel lz4-libs`. On
175
+ Ubuntu this can be achieved by `sudo apt-get install liblz4-dev
176
+ liblz4-1`.
176
177
 
177
- Alternatively, dbdreader can also be installed from PyPi, using ``pip3
178
- install dbdreader``.
178
+ Alternatively, dbdreader can also be installed from PyPi, using `pip3
179
+ install dbdreader`.
179
180
 
181
+ ## Installation on Windows
180
182
 
181
- Installation on Windows
182
- -----------------------
183
183
  If you want to install dbdreader from source, you will need a C
184
184
  compiler as well to compile the C-extension. Besides the Python
185
185
  environment you will need to install the Microsoft Visual Studio
@@ -188,29 +188,29 @@ you tick the box *python development* during the setup. Once installed
188
188
  dbdreader can be installed, and the C-extension should be compiled
189
189
  automatically.
190
190
 
191
-
192
- Installiation using pip, for example as in ``py -m pip install
193
- dbdreader`` also requires the C compiler. For Python version 3.9,
191
+ Installiation using pip, for example as in `py -m pip install
192
+ dbdreader` also requires the C compiler. For Python version 3.9,
194
193
  however, a wheel is provided, which can be installed adding the option
195
- ``--only-binary :all:`` to the pip command: ::
194
+ `--only-binary :all:` to the pip command:
196
195
 
197
- $ pip install --only-binary :all: dbdreader
196
+ ```
197
+ $ pip install --only-binary :all: dbdreader
198
+ ```
198
199
 
200
+ ## Documentation
199
201
 
200
- Documentation
201
- -------------
202
- Comprehensive documentation is provided at https://dbdreader.readthedocs.io/en/latest/
202
+ Comprehensive documentation is provided at <https://dbdreader.readthedocs.io/en/latest/>
203
+
204
+ ## Quick-start
203
205
 
204
- Quick-start
205
- -----------
206
206
  For the impatient...
207
207
 
208
208
  The dbdreader module implements a class DBD() which provides the
209
209
  machinery to read a single dbd file. The most commonly used methods
210
210
  are:
211
211
 
212
- * get(parametername)
213
- * get_sync(parametername, \*other_parameternames)
212
+ * `get(parametername)`
213
+ * `get_sync(parametername, *other_parameternames)`
214
214
 
215
215
  The first method returs a tuple with time and values for requested
216
216
  parameter. The second method, returns a tuple with time and values of
@@ -222,40 +222,31 @@ number of them. This interface is implemented by the MultiDBD
222
222
  class. Files can either be specified as a list of filenames, or as a
223
223
  pattern using wildcards.
224
224
 
225
- Examples
226
- ^^^^^^^^
225
+ ### Examples
226
+
227
+ To read a single file:
227
228
 
228
- To read a single file::
229
+ ```python
230
+ >>> dbd = DBD("00010010.dbd")
231
+ >>> t, pitch = dbd.get("m_pitch")
232
+ >>> t, hdg, ptch, roll = dbd.get_sync("m_heading", "m_pitch", "m_roll")
233
+ ```
229
234
 
230
- >>> dbd = DBD("00010010.dbd")
231
- >>> t, pitch = dbd.get("m_pitch")
232
- >>> t, hdg, ptch, roll = dbd.get_sync("m_heading", "m_pitch", "m_roll)
235
+ Or, doing the same, but using both dbd and ebd files:
233
236
 
234
- Or, doing the same, but using both dbd and ebd files::
235
-
236
- >>> dbd = DBD(pattern="00010010.[de]bd")
237
- >>> t, pitch = dbd.get("m_pitch")
238
- >>> t, hdg, ptch, roll = dbd.get_sync("m_heading", "m_pitch", "m_roll")
239
- >>> t, p_ctd, p_nav = dbd.get_sync("sci_water_pressure", "m_water_pressure")
237
+ ```python
238
+ >>> dbd = DBD(pattern="00010010.[de]bd")
239
+ >>> t, pitch = dbd.get("m_pitch")
240
+ >>> t, hdg, ptch, roll = dbd.get_sync("m_heading", "m_pitch", "m_roll")
241
+ >>> t, p_ctd, p_nav = dbd.get_sync("sci_water_pressure", "m_water_pressure")
242
+ ```
240
243
 
241
-
244
+ ## Python 2
242
245
 
243
- Python 2
244
- --------
245
246
  Python 2.7 is not supported anymore. However, you should be able to
246
247
  make the code able to run on python2.7 using the *future* package.
247
248
 
248
249
  * pip install future
249
250
  * pasteurize dbdreader.
250
251
 
251
- For details see http://python-future.org/pasteurize.html.
252
-
253
-
254
- .. |PyPI version| image:: https://badgen.net/pypi/v/dbdreader
255
- :target: https://pypi.org/project/dbdreader
256
- .. |Docs badge| image:: https://readthedocs.org/projects/dbdreader/badge/?version=latest
257
- :target: https://dbdreader.readthedocs.io/en/latest/
258
- .. |License| image:: https://img.shields.io/badge/License-GPLv3-blue.svg
259
- :target: https://www.gnu.org/licenses/gpl-3.0
260
-
261
-
252
+ For details see <http://python-future.org/pasteurize.html>.
@@ -1,7 +1,11 @@
1
1
  import os
2
2
  from .dbdreader import *
3
3
 
4
- __version__ = "0.5.8"
4
+ from importlib.metadata import version, PackageNotFoundError
5
+ try:
6
+ __version__ = version("dbdreader")
7
+ except PackageNotFoundError:
8
+ __version__ = "unknown"
5
9
  __all__ = ['dbdreader']
6
10
 
7
11
  EXAMPLE_DATA_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__),