stac-utils / stac-task

Provides a class interface for running custom algorithms on STAC ItemCollections
Apache License 2.0
20 stars 4 forks source link

Change validate to instance method #133

Closed drnextgis closed 2 days ago

drnextgis commented 3 months ago

Currently, Task.validate is marked as a class method, but there are scenarios where having access to the task instance within the validate method would be beneficial. For example, if a STAC item property name is passed as a task parameter and we need to validate that all input items possess that property, access to self.parameters would be useful. What do you think about changing validate to a regular instance method?

ircwaves commented 6 days ago

@drnextgis -- You're thinking along these lines #147 ? Seems reasonable to me, but is somewhat breaking-change, in that any subclasses out there which implement validate(cls, payload) will need to update to validate(self).

drnextgis commented 3 days ago

Yes, @ircwaves, this is exactly what I needed!