Skip to content

Commit

Permalink
Remove deprecated preprocess subpackage [all tests ci] (OSOceanAcoust…
Browse files Browse the repository at this point in the history
…ics#1082)

* Remove deprecated preprocess subpackage

* docs: replace references to preprocess with clean and commongrid

* docs: add attention box about removal of preprocess subpackage
  • Loading branch information
emiliom authored and lsetiawan committed Jul 28, 2023
1 parent 3ce4d6e commit e8ff8c9
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 51 deletions.
11 changes: 9 additions & 2 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,17 @@ calibrate
:no-inheritance-diagram:
:no-heading:

preprocess
clean
^^^^^

.. automodapi:: echopype.clean
:no-inheritance-diagram:
:no-heading:

commongrid
^^^^^^^^^^

.. automodapi:: echopype.preprocess
.. automodapi:: echopype.commongrid
:no-inheritance-diagram:
:no-heading:

Expand Down
22 changes: 15 additions & 7 deletions docs/source/process.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ The steps for performing these analyses are summarized below:
.. code-block:: python
# Reduce data based on physical units
ds_MVBS = ep.preprocess.compute_MVBS(
ds_MVBS = ep.commongrid.compute_MVBS(
ds_Sv, # calibrated Sv dataset
range_meter_bin=20, # bin size to average along echo_range in meters
ping_time_bin='20S' # bin size to average along ping_time in seconds
)
# Reduce data based on sample number
ds_MVBS = ep.preprocess.compute_MVBS_index_binning(
ds_MVBS = ep.commongrid.compute_MVBS_index_binning(
ds_Sv, # calibrated Sv dataset
range_sample_num=30, # number of sample bins to average along the range_sample dimensionm
ping_num=5 # number of pings to average
Expand All @@ -72,21 +72,27 @@ The steps for performing these analyses are summarized below:
.. code-block:: python
# Remove noise
ds_Sv_clean = ep.preprocess.remove_noise( # obtain a denoised Sv dataset
ds_Sv_clean = ep.clean.remove_noise( # obtain a denoised Sv dataset
ds_Sv, # calibrated Sv dataset
range_sample_num=30, # number of samples along the range_sample dimension for estimating noise
ping_num=5, # number of pings for estimating noise
)
.. attention::

The ``clean`` and ``commongrid`` subpackages were introduced in version 0.7.0.
They contain functions previously found in the deprecated ``preprocess`` subpackage;
``preprocess`` was removed in version 0.8.0.

The functions in the ``calibrate`` subpackage take in an ``EchoData`` object,
which is essentially a container for multiple xarray ``Dataset`` instances,
and return a single xarray ``Dataset`` containing the calibrated backscatter
quantities and the samples' corresponding range in meters.
The input and output of all functions in the ``preprocess``
subpackage are xarray ``Dataset`` instances, with the input being a ``Dataset``
The input and output of all functions in the ``clean`` and ``commongrid``
subpackages are xarray ``Dataset`` instances, with the input being a ``Dataset``
containing ``Sv`` and ``echo_range`` generated from calibration.

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

Expand All @@ -98,7 +104,9 @@ For example, to save the Sv and MVBS results to disk:
ds_MVBS.to_netcdf('file_MVBS.nc')
.. note:: Echopype's data processing functionality is being developed actively.
.. note::

Echopype's data processing functionality is being developed actively.
Be sure to check back here often!


Expand Down
3 changes: 1 addition & 2 deletions echopype/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from _echopype_version import version as __version__ # noqa

from . import calibrate, clean, commongrid, consolidate, mask, preprocess, utils
from . import calibrate, clean, commongrid, consolidate, mask, utils
from .convert.api import open_raw
from .echodata.api import open_converted
from .echodata.combine import combine_echodata
Expand All @@ -23,7 +23,6 @@
"mask",
"open_converted",
"open_raw",
"preprocess",
"utils",
"verbose",
]
8 changes: 0 additions & 8 deletions echopype/preprocess/__init__.py

This file was deleted.

32 changes: 0 additions & 32 deletions echopype/preprocess/api.py

This file was deleted.

0 comments on commit e8ff8c9

Please sign in to comment.