ro-hit81 / GeoIndexity

MIT License
0 stars 2 forks source link

TypeError: __init__() missing 1 required positional argument: 'collection_id' #3

Open gernotnikolaus opened 4 months ago

gernotnikolaus commented 4 months ago

I had to pass the collection_id argument explicitly in the geoindexity class:

if self.collection_id == 'Sentinel':
            self.collection = Sentinel(roi=self.roi,
                                       start_date=self.start_date,
                                       end_date=self.end_date,
                                       collection_id= 'COPERNICUS/S2_SR_HARMONIZED',
                                       properties=self.properties
                                       ).select_product()

if self.collection_id == 'Landsat8':
    self.collection = Landsat8(roi=self.roi,
                               start_date=self.start_date,
                               end_date=self.end_date,
                               collection_id= 'LANDSAT/LC08/C02/T1_L2',
                               properties=self.properties
                               ).select_product()

Without I am getting this error:

TypeError Traceback (most recent call last) Cell In[23], line 1 ----> 1 geo_index = Geoindexity(roi=roi, start_date=start_date, end_date=end_date, collection_id='Sentinel')

Cell In[20], line 245, in Geoindexity.init(self, roi, start_date, end_date, collection_id, properties) 242 self.df = None 244 if self.collection_id == 'Sentinel': --> 245 self.collection = Sentinel(roi=self.roi, 246 start_date=self.start_date, 247 end_date=self.end_date, 248 properties=self.properties 249 ).select_product() 251 if self.collection_id == 'Landsat8': 252 self.collection = Landsat8(roi=self.roi, 253 start_date=self.start_date, 254 end_date=self.end_date, 255 properties=self.properties 256 ).select_product()

TypeError: init() missing 1 required positional argument: 'collection_id'

hansendav commented 4 months ago

Without what exactly? Without the collection_id parameter? If so, this is how it should be.

gernotnikolaus commented 4 months ago

Yes, I know. Without that I always got an error. That's why I put it the issue here that I changed it this way, so that my code can run and have noted it here. Does it work for you without it?

hansendav commented 4 months ago

Now, I understand what you mean. I will check on this today. Latest tomorrow.