Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring #95

Merged
merged 43 commits into from
Jul 2, 2023
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
2814e3d
Merge pull request #1 from ctuguinay/Update-requirements-and-fix-test…
ctuguinay May 31, 2023
3a778c8
Merge branch 'main' of https://github.com/ctuguinay/echoregions
ctuguinay Jun 9, 2023
cb976c7
remove parse scaffolding and majority of offset
ctuguinay Jun 12, 2023
824768f
reduce spacing and removing unused imports
ctuguinay Jun 12, 2023
f1e71fb
ignore no gridpoint belongs to any region
ctuguinay Jun 12, 2023
a369ff8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 12, 2023
facf089
remove unused f in str
ctuguinay Jun 12, 2023
62e6c52
remove offset
ctuguinay Jun 13, 2023
5ce662e
remove offset further
ctuguinay Jun 13, 2023
49b2f83
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 13, 2023
05b0440
initial refactoring
ctuguinay Jun 14, 2023
e0faf5c
refactoring base structure finished
ctuguinay Jun 14, 2023
cb9fb28
Merge branch 'main' into refactoring
ctuguinay Jun 14, 2023
5a179fb
lines mask creation and regions2d_mask factorization
ctuguinay Jun 15, 2023
185a31c
add sonar for nc data storage
ctuguinay Jun 15, 2023
e5aa902
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 15, 2023
9929410
add zarr data
ctuguinay Jun 20, 2023
a6f3656
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 20, 2023
ce422e2
add lines mask options
ctuguinay Jun 20, 2023
3ab0ec2
place zarr and netcdf4 in req txt
ctuguinay Jun 20, 2023
90b104a
add ability to parse zarr files into sonar
ctuguinay Jun 21, 2023
b6ddbb0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 21, 2023
05985d1
add scipy
ctuguinay Jun 21, 2023
d967d4c
Merge branch 'refactoring' of https://github.com/ctuguinay/echoregion…
ctuguinay Jun 21, 2023
8e27109
make processing for zarr and nc files cleaner
ctuguinay Jun 22, 2023
da129fb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 22, 2023
9841b93
satisfy flake8 requirements
ctuguinay Jun 22, 2023
bb05a7a
remove sonar
ctuguinay Jun 22, 2023
38b8078
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 22, 2023
6b88034
remove zarr file
ctuguinay Jun 22, 2023
42875d7
Merge branch 'refactoring' of https://github.com/ctuguinay/echoregion…
ctuguinay Jun 22, 2023
5dda9c8
fix line too long error
ctuguinay Jun 22, 2023
3031d4d
comment out plt.show
ctuguinay Jun 22, 2023
f9f4c36
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 22, 2023
9cff68e
send to core
ctuguinay Jun 26, 2023
2f802fa
simplify init files
ctuguinay Jun 26, 2023
80296d6
simplify echoregions main init
ctuguinay Jun 26, 2023
bdfea0a
lines: lines mask, tests, and properties
ctuguinay Jun 26, 2023
da3131f
regions2d: properties, testing, and mask
ctuguinay Jun 26, 2023
6209a9a
catch invalid method and limit_area
ctuguinay Jun 26, 2023
f0ce433
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 26, 2023
c497539
fix line too long error
ctuguinay Jun 26, 2023
cf7f15d
lines mask docstring and reindex/loc
ctuguinay Jul 2, 2023
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,4 @@ __main__.py
*.csv
*.json
*.png
!x1.zarr
13 changes: 2 additions & 11 deletions echoregions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
from .convert.api import read_evl, read_evr
from .convert.utils import parse_simrad_fname_time, parse_time
from .formats import Lines, Regions2D
from .core import read_evl, read_evr

__all__ = [
"read_evl",
"read_evr",
"parse_simrad_fname_time",
"parse_time",
"Lines",
"Regions2D",
]
__all__ = ["read_evl", "read_evr"]
3 changes: 0 additions & 3 deletions echoregions/convert/__init__.py

This file was deleted.

110 changes: 0 additions & 110 deletions echoregions/convert/ev_parser.py

This file was deleted.

54 changes: 0 additions & 54 deletions echoregions/convert/evl_parser.py

This file was deleted.

150 changes: 0 additions & 150 deletions echoregions/convert/evr_parser.py

This file was deleted.

42 changes: 42 additions & 0 deletions echoregions/core.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
from .lines.lines import Lines
from .regions2d.regions2d import Regions2D


def read_evr(
filepath: str, min_depth: float = None, max_depth: float = None
) -> Regions2D:
"""Read an EVR file into a Regions2D object.

Parameters
----------
filepath : str, Path object
A valid path to an EVR file
min_depth : float, default ``None``
Depth value in meters to set -9999.99 depth edges to.
max_depth : float, default ``None``
Depth value in meters to set 9999.99 depth edges to.

Returns
-------
Regions2D
Object that contains the EVR data and metadata with methods for saving to file.
"""
return Regions2D(input_file=str(filepath), min_depth=min_depth, max_depth=max_depth)


def read_evl(filepath: str, nan_depth_value: float = None) -> Lines:
"""Read an EVL file into a Lines object.

Parameters
----------
filepath : str, Path object
A valid path to an EVL file
nan_depth_value : float, default ``None``
Depth in meters to replace -10000.990000 ranges with.

Returns
-------
Lines
Object that contains EVL data and metadata with methods for saving to file.
"""
return Lines(input_file=str(filepath), nan_depth_value=nan_depth_value)
5 changes: 0 additions & 5 deletions echoregions/formats/__init__.py

This file was deleted.

Loading