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

Masking Changes and DataFrame Read and Write Capabilities #148

Merged
merged 29 commits into from
Nov 25, 2023

Conversation

ctuguinay
Copy link
Collaborator

@ctuguinay ctuguinay commented Oct 5, 2023

For lines masking: Clean up how bottom_interpolated is constructed. Past version had unused variables.
For regions2d masking: Made use of numbers instead of names in regionmask regions initialization so to work directly with the dimension region instead of having to switch coordinate names with dimension regions.

Also, solved problem where echoregions version cannot be imported in the top level __init__.py file of the package.

@ctuguinay ctuguinay changed the title Remove echoregions import Remove echoregions version import from init Oct 5, 2023
@codecov
Copy link

codecov bot commented Oct 5, 2023

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (3534c97) 87.23% compared to head (a06060a) 87.54%.
Report is 3 commits behind head on main.

Files Patch % Lines
echoregions/regions2d/regions2d_parser.py 85.71% 3 Missing ⚠️
echoregions/lines/lines_parser.py 89.47% 2 Missing ⚠️
echoregions/lines/lines.py 93.75% 1 Missing ⚠️
echoregions/regions2d/regions2d.py 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #148      +/-   ##
==========================================
+ Coverage   87.23%   87.54%   +0.30%     
==========================================
  Files          14       13       -1     
  Lines         525      578      +53     
==========================================
+ Hits          458      506      +48     
- Misses         67       72       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ctuguinay ctuguinay changed the title Remove echoregions version import from init Slight Masking Changes and Remove Echoregions version import from init Nov 2, 2023
@ctuguinay ctuguinay requested a review from leewujung November 2, 2023 21:21
@ctuguinay
Copy link
Collaborator Author

@leewujung, Here are some slight changes made corresponding to errors that I noticed when running echoregion functions in hake labels.

@ctuguinay ctuguinay added bug Something isn't working enhancement dependencies Pull requests that update a dependency file setup infrastructure or packaging and removed dependencies Pull requests that update a dependency file labels Nov 2, 2023
@ctuguinay ctuguinay assigned leewujung and ctuguinay and unassigned leewujung Nov 2, 2023
Copy link
Member

@leewujung leewujung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ctuguinay : I have only a comment and a question for changes in this PR.

An offshoot when I was looking at the tests: seems like there is a missing assert condition in the last line of test_mask_empty_no_overlap?

I think this PR can be merged once we have the above addressed.

While reviewing it I created #151 that should be addressed in a separate PR.

Thanks!

echoregions/__init__.py Outdated Show resolved Hide resolved
@ctuguinay
Copy link
Collaborator Author

An offshoot when I was looking at the tests: seems like there is a missing assert condition in the last line of test_mask_empty_no_overlap?

Just added this assert.

@ctuguinay ctuguinay requested a review from leewujung November 13, 2023 19:46
@ctuguinay ctuguinay marked this pull request as draft November 15, 2023 16:03
@ctuguinay ctuguinay changed the title Slight Masking Changes and Remove Echoregions version import from init Masking Changes and DataFrame Read and Write Capabilities Nov 15, 2023
@ctuguinay ctuguinay marked this pull request as ready for review November 17, 2023 17:55
@ctuguinay
Copy link
Collaborator Author

ctuguinay commented Nov 17, 2023

Recent Changes:

  • Added read and write capabilities for Lines and Regions2d objects
    • Reading comes with the assumption that the CSV or Dataframe contains depth and time columns (similar to Lines) when being read in as a Lines object or region_id, depth, and time columns (similar to Regions2d objects) when being read in as a Regions2d object.
  • Added contour output for both Lines and Regions2d objects
    • Contour objects are dataframes that can be used to initialize new Lines or Regions2d objects respectively

@ctuguinay
Copy link
Collaborator Author

@leewujung This is ready to be reviewed again.

Copy link
Member

@leewujung leewujung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ctuguinay : Everything looks good and I only had very minor comments. Feel free to merge afterwards!

ctuguinay and others added 2 commits November 25, 2023 09:04
Co-authored-by: Wu-Jung Lee <leewujung@gmail.com>
@ctuguinay ctuguinay merged commit 5983491 into main Nov 25, 2023
4 checks passed
@ctuguinay ctuguinay deleted the ctuguinay-patch-1 branch November 25, 2023 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement setup infrastructure or packaging
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants