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

area_or_point and get_mask - adapt changes to geouilts #519 and #501 #496

Closed
liuh886 opened this issue Mar 26, 2024 · 1 comment
Closed

Comments

@liuh886
Copy link
Contributor

liuh886 commented Mar 26, 2024

Two bugs spotted with the latest updates of geoultils

1. TypeError: DEM.from_array() got an unexpected keyword argument 'area_or_point'

Where

geoultis.raster line 1363

Reason

raster.from_array has appended metadata area_or_point, however, as the subclass, DEM has an override method from_array. When the self is a DEM instance, self.from_array do not accept argument area_or_point unless the override method accepts it as well.

Corrections

If a subclass overrides a method from its parent class, the overriding method should have the same signature (i.e., the same number and names of parameters) as the method in the parent class. The same error has happened before #416 .

For the same reason, self.tags should be update as well.

File changes

DEM.from_array

2. ImportError: unable import get_mask from geoutils.raster

Where

Volumne.py line 12

Reason

'get_mask' has been a new method under the Raster class.

Corrections

Change get_mask into get_mask_from_array

File changes

volumn.py

@rhugonnet
Copy link
Member

Fixed in #480, see #497 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants