Skip to content

Commit e8ff8c9

Browse files
emiliomlsetiawan
authored andcommitted
Remove deprecated preprocess subpackage [all tests ci] (OSOceanAcoustics#1082)
* Remove deprecated preprocess subpackage * docs: replace references to preprocess with clean and commongrid * docs: add attention box about removal of preprocess subpackage
1 parent 3ce4d6e commit e8ff8c9

File tree

5 files changed

+25
-51
lines changed

5 files changed

+25
-51
lines changed

docs/source/api.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,17 @@ calibrate
5858
:no-inheritance-diagram:
5959
:no-heading:
6060

61-
preprocess
61+
clean
62+
^^^^^
63+
64+
.. automodapi:: echopype.clean
65+
:no-inheritance-diagram:
66+
:no-heading:
67+
68+
commongrid
6269
^^^^^^^^^^
6370

64-
.. automodapi:: echopype.preprocess
71+
.. automodapi:: echopype.commongrid
6572
:no-inheritance-diagram:
6673
:no-heading:
6774

docs/source/process.rst

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ The steps for performing these analyses are summarized below:
5454
.. code-block:: python
5555
5656
# Reduce data based on physical units
57-
ds_MVBS = ep.preprocess.compute_MVBS(
57+
ds_MVBS = ep.commongrid.compute_MVBS(
5858
ds_Sv, # calibrated Sv dataset
5959
range_meter_bin=20, # bin size to average along echo_range in meters
6060
ping_time_bin='20S' # bin size to average along ping_time in seconds
6161
)
6262
6363
# Reduce data based on sample number
64-
ds_MVBS = ep.preprocess.compute_MVBS_index_binning(
64+
ds_MVBS = ep.commongrid.compute_MVBS_index_binning(
6565
ds_Sv, # calibrated Sv dataset
6666
range_sample_num=30, # number of sample bins to average along the range_sample dimensionm
6767
ping_num=5 # number of pings to average
@@ -72,21 +72,27 @@ The steps for performing these analyses are summarized below:
7272
.. code-block:: python
7373
7474
# Remove noise
75-
ds_Sv_clean = ep.preprocess.remove_noise( # obtain a denoised Sv dataset
75+
ds_Sv_clean = ep.clean.remove_noise( # obtain a denoised Sv dataset
7676
ds_Sv, # calibrated Sv dataset
7777
range_sample_num=30, # number of samples along the range_sample dimension for estimating noise
7878
ping_num=5, # number of pings for estimating noise
7979
)
8080
81+
.. attention::
82+
83+
The ``clean`` and ``commongrid`` subpackages were introduced in version 0.7.0.
84+
They contain functions previously found in the deprecated ``preprocess`` subpackage;
85+
``preprocess`` was removed in version 0.8.0.
86+
8187
The functions in the ``calibrate`` subpackage take in an ``EchoData`` object,
8288
which is essentially a container for multiple xarray ``Dataset`` instances,
8389
and return a single xarray ``Dataset`` containing the calibrated backscatter
8490
quantities and the samples' corresponding range in meters.
85-
The input and output of all functions in the ``preprocess``
86-
subpackage are xarray ``Dataset`` instances, with the input being a ``Dataset``
91+
The input and output of all functions in the ``clean`` and ``commongrid``
92+
subpackages are xarray ``Dataset`` instances, with the input being a ``Dataset``
8793
containing ``Sv`` and ``echo_range`` generated from calibration.
8894

89-
The ``calibrate`` and ``preprocess`` functions do not save the calculation results to disk,
95+
The ``calibrate``, ``clean`` and ``commongrid`` functions do not save the calculation results to disk,
9096
but the returned xarray ``Dataset`` can be saved using native xarray methods
9197
such as ``to_netcdf`` and ``to_zarr``.
9298

@@ -98,7 +104,9 @@ For example, to save the Sv and MVBS results to disk:
98104
ds_MVBS.to_netcdf('file_MVBS.nc')
99105
100106
101-
.. note:: Echopype's data processing functionality is being developed actively.
107+
.. note::
108+
109+
Echopype's data processing functionality is being developed actively.
102110
Be sure to check back here often!
103111

104112

echopype/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from _echopype_version import version as __version__ # noqa
44

5-
from . import calibrate, clean, commongrid, consolidate, mask, preprocess, utils
5+
from . import calibrate, clean, commongrid, consolidate, mask, utils
66
from .convert.api import open_raw
77
from .echodata.api import open_converted
88
from .echodata.combine import combine_echodata
@@ -23,7 +23,6 @@
2323
"mask",
2424
"open_converted",
2525
"open_raw",
26-
"preprocess",
2726
"utils",
2827
"verbose",
2928
]

echopype/preprocess/__init__.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

echopype/preprocess/api.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)