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

Add exception for coords of len <= 1 or multidimensional coords in fill_missing_bounds() #141

Merged
merged 2 commits into from
Nov 9, 2021

Conversation

tomvothecoder
Copy link
Collaborator

Description

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

If applicable:

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass with my changes (locally and CI/CD build)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have noted that this is a breaking change for a major release (fix or feature that would cause existing functionality to not work as expected) -- skipping major release, will note in changelog for v0.2.0

@tomvothecoder tomvothecoder added type: bug Inconsistencies or issues which will cause an issue or problem for users or implementors. Priority: High breaking-change A breaking change, intended for a major release. labels Nov 9, 2021
@tomvothecoder tomvothecoder self-assigned this Nov 9, 2021
@@ -96,19 +96,27 @@ def names(self) -> List[str]:
)
)

def fill_missing(self) -> xr.Dataset:
def fill_missing_bounds(self) -> xr.Dataset:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was named as fill_missing() since it is encapsulated under bounds accessor (ds.bounds.fill_missing()/DatasetBounds(ds).fill_missing()), which explains the target is filling the missing bounds.

However, it has been changed to fill_missing_bounds() so that it is in alignment with ds.xcdat.fill_missing_bounds()/XCDATAccessor(ds).fill_missing_bounds() to make APIs consistent.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's a nice change! Thank you.

@tomvothecoder
Copy link
Collaborator Author

Hi @chengzhuzhang, this PR is ready for review. Thanks!

@tomvothecoder tomvothecoder changed the title Add exception for coords of len <= 1 in fill_missing_bounds() Add exception for coords of len <= 1 or multidimensional coords in fill_missing_bounds() Nov 9, 2021
@@ -96,19 +96,27 @@ def names(self) -> List[str]:
)
)

def fill_missing(self) -> xr.Dataset:
def fill_missing_bounds(self) -> xr.Dataset:
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's a nice change! Thank you.

- Rename `fill_missing()` to `fill_missing_bounds()`
- Update logger name to `root` in `bounds.py`
@tomvothecoder tomvothecoder force-pushed the bugfix/137-bounds-single-coord branch from f893751 to 1b9caea Compare November 9, 2021 21:28
@codecov-commenter
Copy link

Codecov Report

Merging #141 (23db00a) into main (af67830) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #141   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines          342       345    +3     
=========================================
+ Hits           342       345    +3     
Impacted Files Coverage Δ
xcdat/bounds.py 100.00% <100.00%> (ø)
xcdat/dataset.py 100.00% <100.00%> (ø)
xcdat/xcdat.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update af67830...23db00a. Read the comment docs.

@tomvothecoder tomvothecoder merged commit ca9dee4 into main Nov 9, 2021
@tomvothecoder tomvothecoder deleted the bugfix/137-bounds-single-coord branch November 9, 2021 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change A breaking change, intended for a major release. type: bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot generate bounds for a dataset that has no bounds
3 participants