Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.DS_Store
_echopro_version.py
_echopop_version.py

# ignore output reports, if they were produced
EchoPro/tests/reports/EchoPro_python_output*
echopop/tests/reports/echopop_python_output*

# Created by .ignore support plugin (hsz.mobi)
### Python template
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
exclude: |
(?x)^(
EchoPro/tests/|
echopop/tests/|
docs/|
example_notebooks/|
project_docs
Expand Down Expand Up @@ -37,4 +37,4 @@ repos:
rev: v2.2.2
hooks:
- id: codespell
args: ["--skip=*.ipynb", "-w", "docs/source", "echopype", "EchoPro", "echopro"]
args: ["--skip=*.ipynb", "-w", "docs/source", "echopype", "echopop", "echopop"]
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Python EchoPro
# Echopro

Python EchoPro ("EchoPro") combines acoustic data analysis results with biological information from trawls (such as length, age, etc.) to produce estimates of biomass, biomass density, abundance, and other characteristics for Pacific hake. It is based on the Matlab EchoPro software originally developed for the [Joint U.S.-Canada Integrated Ecosystem and Pacific Hake Acoustic Trawl Survey](https://www.fisheries.noaa.gov/west-coast/science-data/joint-us-canada-integrated-ecosystem-and-pacific-hake-acoustic-trawl-survey) by the [Fisheries Engineering and Acoustic Technologies Team](https://www.fisheries.noaa.gov/west-coast/sustainable-fisheries/fisheries-engineering-and-acoustic-technologies-team) at the NOAA Northwest Fisheries Science Center.
Echopop combines acoustic data analysis results with biological information from trawls (such as length, age, etc.) to produce estimates of biomass, biomass density, abundance, and other characteristics for Pacific hake. It is based on the Matlab EchoPro software originally developed for the [Joint U.S.-Canada Integrated Ecosystem and Pacific Hake Acoustic Trawl Survey](https://www.fisheries.noaa.gov/west-coast/science-data/joint-us-canada-integrated-ecosystem-and-pacific-hake-acoustic-trawl-survey) by the [Fisheries Engineering and Acoustic Technologies Team](https://www.fisheries.noaa.gov/west-coast/sustainable-fisheries/fisheries-engineering-and-acoustic-technologies-team) at the NOAA Northwest Fisheries Science Center.

Go to https://uw-echospace.github.io/EchoPro/ to view Jupyter notebooks that demonstrate EchoPro functionality and typical workflows.

## Installation

Python EchoPro is not yet available for installation as a package on [PyPI](https://pypi.org/) or [conda-forge](https://conda-forge.org/). Until then, it must be installed either as a **"user"** from the GitHub repository or from the code (mainly for continued development purposes, as a **"developer"**) after "cloning" the GitHub repository using `git`. See the instructions below. Either way, we'll use [conda](https://docs.conda.io) to install EchoPro dependencies from conda packages on `conda-forge`. Installation of these dependencies has been tested extensively with `conda`.
Echopop is not yet available for installation as a package on [PyPI](https://pypi.org/) or [conda-forge](https://conda-forge.org/). Until then, it must be installed either as a **"user"** from the GitHub repository or from the code (mainly for continued development purposes, as a **"developer"**) after "cloning" the GitHub repository using `git`. See the instructions below. Either way, we'll use [conda](https://docs.conda.io) to install EchoPro dependencies from conda packages on `conda-forge`. Installation of these dependencies has been tested extensively with `conda`.

There are different ways of installing `conda`, but we recommend the use of [Miniconda with the conda libmamba solver](https://echospace-group-docs.readthedocs.io/en/latest/compute-conda-jupyter.html). `conda` can be used without administrative privileges.

Expand Down Expand Up @@ -94,4 +94,4 @@ Note that an interactive widget used for exploring and selecting the semi-variog

## Tests

Python EchoPro contains several tests to continuously verify functionality as changes are implemented. These tests are found in [EchoPro/tests](https://github.com/uw-echospace/EchoPro/tree/master/EchoPro/tests). They are not currently set up to run automatically in the GitHub Actions Continuous Integration system. Instead, they must be run locally. They require a set of Excel output files from Matlab EchoPro for comparison of restults, available in [this Google Drive folder](https://drive.google.com/drive/folders/1_sUDUJY_e6M9cB3n5uibWeoukPqFP8ZO?usp=drive_link). This link has restricted access and the folder can only be downloaded by approved parties. After downloading the files, please set the file path to the containing folder in `tests/conftest.py`, [here](https://github.com/uw-echospace/EchoPro/blob/master/EchoPro/tests/conftest.py#L45).
Echopop contains several tests to continuously verify functionality as changes are implemented. These tests are found in [EchoPro/tests](https://github.com/uw-echospace/EchoPro/tree/master/EchoPro/tests). They are not currently set up to run automatically in the GitHub Actions Continuous Integration system. Instead, they must be run locally. They require a set of Excel output files from Matlab EchoPro for comparison of restults, available in [this Google Drive folder](https://drive.google.com/drive/folders/1_sUDUJY_e6M9cB3n5uibWeoukPqFP8ZO?usp=drive_link). This link has restricted access and the folder can only be downloaded by approved parties. After downloading the files, please set the file path to the containing folder in `tests/conftest.py`, [here](https://github.com/uw-echospace/EchoPro/blob/master/EchoPro/tests/conftest.py#L45).
2 changes: 1 addition & 1 deletion condaenvironment.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: echopro
name: echopop
channels:
- conda-forge
dependencies:
Expand Down
2 changes: 1 addition & 1 deletion config_files/initialization_config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This YAML file is a configuration file for all
# initialization parameters used in EchoPro
# initialization parameters used in Echopop

---
#####################################################################################################################
Expand Down
2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Book settings
# Learn more at https://jupyterbook.org/customize/config.html

title: EchoPro
title: Echopop
author: The UW Echospace Group
# logo: logo.png

Expand Down
32 changes: 16 additions & 16 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@ API reference

* `Survey`_
* `Data loading`_
* :py:class:`KrigingMesh <EchoPro.data_loader.KrigingMesh>`
* :py:class:`LoadBioData <EchoPro.data_loader.LoadBioData>`
* :py:class:`LoadStrataData <EchoPro.data_loader.LoadStrataData>`
* :py:class:`load_nasc_df <EchoPro.data_loader.load_nasc_df>`
* :py:class:`KrigingMesh <echopop.data_loader.KrigingMesh>`
* :py:class:`LoadBioData <echopop.data_loader.LoadBioData>`
* :py:class:`LoadStrataData <echopop.data_loader.LoadStrataData>`
* :py:class:`load_nasc_df <echopop.data_loader.load_nasc_df>`
* `Computational routines`_
* :py:class:`Kriging <EchoPro.computation.Kriging>`
* :py:class:`SemiVariogram <EchoPro.computation.SemiVariogram>`
* :py:class:`ComputeTransectVariables <EchoPro.computation.ComputeTransectVariables>`
* :py:class:`ComputeKrigingVariables <EchoPro.computation.ComputeKrigingVariables>`
* :py:class:`Bootstrapping <EchoPro.computation.Bootstrapping>`
* :py:class:`Kriging <echopop.computation.Kriging>`
* :py:class:`SemiVariogram <echopop.computation.SemiVariogram>`
* :py:class:`ComputeTransectVariables <echopop.computation.ComputeTransectVariables>`
* :py:class:`ComputeKrigingVariables <echopop.computation.ComputeKrigingVariables>`
* :py:class:`Bootstrapping <echopop.computation.Bootstrapping>`
* `Reports`_
* :py:class:`Reports <EchoPro.reports.Reports>`
* :py:class:`Reports <echopop.reports.Reports>`


Survey
------

.. automodule:: EchoPro
.. automodule:: echopop
:members: Survey


Data loading
------------

.. automodule:: EchoPro.data_loader
.. automodule:: echopop.data_loader
:members: KrigingMesh, LoadBioData, LoadStrataData, load_nasc_df


Expand All @@ -39,24 +39,24 @@ Computational routines
Kriging
^^^^^^^

.. automodule:: EchoPro.computation
.. automodule:: echopop.computation
:members: Kriging, SemiVariogram

Computation of results
^^^^^^^^^^^^^^^^^^^^^^

.. automodule:: EchoPro.computation
.. automodule:: echopop.computation
:members: ComputeTransectVariables, ComputeKrigingVariables

Bootstrapping
^^^^^^^^^^^^^

.. automodule:: EchoPro.computation
.. automodule:: echopop.computation
:members: Bootstrapping


Reports
-------

.. automodule:: EchoPro.reports
.. automodule:: echopop.reports
:members: Reports
2 changes: 1 addition & 1 deletion docs/core_data_structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Classes

Python EchoPro is designed using an object-oriented approach where data are stored in core classes and computations are called as methods (functions) on those classes.
Echopop is designed using an object-oriented approach where data are stored in core classes and computations are called as methods (functions) on those classes.

- Core class
- survey.Survey
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# EchoPro

This site currently hosts example Jupyter notebooks for the new Python EchoPro package (https://github.com/uw-echospace/EchoPro/). Over time, the documentation for this package will be added here too.
This site currently hosts example Jupyter notebooks for the Echopop package (https://github.com/uw-echospace/EchoPro/). Over time, the documentation for this package will be added here too.

The Jupyter notebooks are shown in a "rendered", executed form.

Expand Down
4 changes: 2 additions & 2 deletions docs/input_files.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Input files
ipynb# Input files

Input files used in a Python EchoPro run, grouped by data type. The tables below describe the data columns required by Python EchoPro; other columns will be ignored. All input files are in Excel format. File paths, names, and Excel tab names are specified in the survey year configuration file (e.g., `survey_year_2019_config.yml`).
Input files used in an Echopop run, grouped by data type. The tables below describe the data columns required by Echopop; other columns will be ignored. All input files are in Excel format. File paths, names, and Excel tab names are specified in the survey year configuration file (e.g., `survey_year_2019_config.yml`).

Biological data are always separated into US vs Canada files. All other data files combine US and Canadian data.

Expand Down
2 changes: 1 addition & 1 deletion EchoPro/__init__.py → echopop/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

__all__ = ["Survey", "SemiVariogram"]

from _echopro_version import version as __version__ # noqa
from _echopop_version import version as __version__ # noqa
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def _get_bin_ind(input_data: np.ndarray, bin_edges: np.ndarray) -> List[np.ndarr
-----
The construction of the bin counts differs from the method
produced in `transect_results.py`. This is because the Matlab
version of EchoPro is inconsistent in how it is binning.
version of echopop is inconsistent in how it is binning.
"""

# initialize list that will hold the indices
Expand Down Expand Up @@ -78,7 +78,7 @@ def _get_bin_ind_age(input_data: np.ndarray, age_bins: np.ndarray) -> List[np.nd
-----
The construction of the bin counts differs from the method
produced in `transect_results.py`. This is because the Matlab
version of EchoPro is inconsistent in how it is binning ages.
version of echopop is inconsistent in how it is binning ages.
"""

# initialize list that will hold indices
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def stratified_transect_statistic( transects ,
Notes
-----
This function calculates the stratified summary statistics for biomass within
`EchoPro.survey.stratified_summary()`.
`echopop.survey.stratified_summary()`.
"""

### Convert specific DataFrame columns to arrays for speed
Expand Down
3 changes: 1 addition & 2 deletions EchoPro/core.py → echopop/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
# included in the ``Survey`` class initialization and parameterization (when the object is generated).
#
# TODO: This is a hard-coded feature and therefore is not particularly helpful for more dynamic
# use of this Python module (and the overall use of the EchoPro package).
# use of this Python module (and the overall use of the echopop package).
LAYER_NAME_MAP = {
'biological': {
'name': 'biology' ,
Expand Down Expand Up @@ -237,4 +237,3 @@
'abbr': 'F'
}
}

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def _process_nasc_data(survey, nasc_var_types: dict) -> pd.DataFrame:

if survey.params["survey_year"] < 2003:
# TODO: it may be the case that we need to include lines 35-61 of
# EchoPro/general/load_files_parameters/get_NASC_data.m
# EchoPro_matlab/general/load_files_parameters/get_NASC_data.m
raise NotImplementedError(
"Loading the NASC table for survey years less than 2003 has not been implemented!"
)
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions EchoPro/survey.py → echopop/survey.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import copy
from .core import CONFIG_MAP, LAYER_NAME_MAP
### !!! TODO : This is a temporary import call -- this will need to be changed to
# the correct relative structure (i.e. '.core' instead of 'EchoPro.core' at a future testing step)
# the correct relative structure (i.e. '.core' instead of 'echopop.core' at a future testing step)
from .computation.operations import bin_variable , bin_stats , count_variable , stretch
from .utils.data_file_validation import load_configuration , validate_data_columns
from .computation.acoustics import to_linear , ts_length_regression
Expand All @@ -16,11 +16,11 @@

### !!! TODO : This is a temporary import call -- this will need to be changed to
# the correct relative structure (i.e. '.utils.data_structure_utils' instead of
# 'EchoPro.utils.data_structure_utils' at a future testing step)
# 'echopop.utils.data_structure_utils' at a future testing step)

class Survey:
"""
EchoPro base class that imports and prepares parameters for
echopop base class that imports and prepares parameters for
a survey. Additionally, it includes functions for accessing
the modules associated with the transect and Kriging variable
calculations, CV analysis, semi-variogram algorithm, and Kriging.
Expand Down Expand Up @@ -246,7 +246,7 @@ def read_validated_data( self ,
df_initial.columns = df_initial.iloc[0]
df_initial = df_initial.drop(0)

# Slice only the columns that are relevant to the EchoPro module functionality
# Slice only the columns that are relevant to the echopop module functionality
valid_columns = list(set(validation_settings.keys()).intersection(set(df_initial.columns)))
df_filtered = df_initial[valid_columns]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This YAML file is a configuration file for all
# initialization parameters used in EchoPro
# initialization parameters used in Echopop

---
#####################################################################################################################
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion EchoPro/tests/conftest.py → echopop/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def reports_base_path() -> Path:
pathlib.Path
The base directory path for the reports
"""
return HERE / "tests/reports/EchoPro_python_output"
return HERE / "tests/reports/echopop_python_output"


@pytest.fixture(scope="session")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import yaml
from pathlib import Path
from EchoPro.utils.data_file_validation import load_configuration , validate_data_columns
from echopop.utils.data_file_validation import load_configuration , validate_data_columns

def test_load_configuration(test_path, tmp_path):
init_params = yaml.safe_load(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

import pandas as pd
import numpy as np
import EchoPro
from EchoPro.computation import SemiVariogram as SV
import echopop
from echopop.computation import SemiVariogram as SV


def test_biomass_age_output(config_base_path, matlab_output_base_path):
# initialize Survey object
survey_2019 = EchoPro.Survey(
survey_2019 = echopop.Survey(
init_file_path=config_base_path / 'initialization_config.yml',
survey_year_file_path=config_base_path / 'survey_year_2019_config.yml',
source=3,
Expand Down Expand Up @@ -96,7 +96,7 @@ def test_biomass_age_output(config_base_path, matlab_output_base_path):

def test_core_output(config_base_path, matlab_output_base_path):
# initialize Survey object
survey_2019 = EchoPro.Survey(
survey_2019 = echopop.Survey(
init_file_path=config_base_path / 'initialization_config.yml',
survey_year_file_path=config_base_path / 'survey_year_2019_config.yml',
source=3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

import pandas as pd
import numpy as np
import EchoPro
from EchoPro.computation import SemiVariogram as SV
import echopop
from echopop.computation import SemiVariogram as SV


def test_transect_based_length_age(config_base_path, matlab_output_base_path):
# TODO: formalize this test

# initialize Survey object
survey_2019 = EchoPro.Survey(
survey_2019 = echopop.Survey(
init_file_path=config_base_path / 'initialization_config.yml',
survey_year_file_path=config_base_path / 'survey_year_2019_config.yml',
source=3,
Expand Down Expand Up @@ -80,7 +80,7 @@ def test_kriging_based_length_age(config_base_path, matlab_output_base_path):
# TODO: formalize this test

# initialize Survey object
survey_2019 = EchoPro.Survey(
survey_2019 = echopop.Survey(
init_file_path=config_base_path / 'initialization_config.yml',
survey_year_file_path=config_base_path / 'survey_year_2019_config.yml',
source=3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import pandas as pd
import numpy as np

import EchoPro
from EchoPro.computation import SemiVariogram as SV
import echopop
from echopop.computation import SemiVariogram as SV


@pytest.fixture(scope="module")
Expand All @@ -31,7 +31,7 @@ def generate_reports(config_base_path: pathlib.Path,
"""

# initialize Survey object
survey_2019 = EchoPro.Survey(
survey_2019 = echopop.Survey(
init_file_path=config_base_path / 'initialization_config.yml',
survey_year_file_path=config_base_path / 'survey_year_2019_config.yml',
source=3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

import pandas as pd
import numpy as np
import EchoPro
import echopop


def test_biomass_age_output(config_base_path, matlab_output_base_path):
# TODO: formalize this test

# initialize Survey object
survey_2019 = EchoPro.Survey(
survey_2019 = echopop.Survey(
init_file_path=config_base_path / 'initialization_config.yml',
survey_year_file_path=config_base_path / 'survey_year_2019_config.yml',
source=3,
Expand Down Expand Up @@ -81,7 +81,7 @@ def test_core_output(config_base_path, matlab_output_base_path):
# TODO: formalize this test

# initialize Survey object
survey_2019 = EchoPro.Survey(
survey_2019 = echopop.Survey(
init_file_path=config_base_path / 'initialization_config.yml',
survey_year_file_path=config_base_path / 'survey_year_2019_config.yml',
source=3,
Expand Down
Loading