Skip to content

Commit bf58f35

Browse files
committed
fix: Remove Self typing
1 parent 4416a09 commit bf58f35

File tree

1 file changed

+36
-37
lines changed

1 file changed

+36
-37
lines changed

pystac/extensions/processing.py

Lines changed: 36 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
Any,
1212
Generic,
1313
Literal,
14-
Self,
1514
TypeVar,
1615
cast,
1716
)
@@ -136,15 +135,15 @@ class ProcessingExtension(
136135

137136
name: Literal["processing"] = "processing"
138137

139-
def __init__(self: Self, item: pystac.Item) -> None:
138+
def __init__(self, item: pystac.Item) -> None:
140139
self.item = item
141140
self.properties = item.properties
142141

143-
def __repr__(self: Self) -> str:
142+
def __repr__(self) -> str:
144143
return f"<ProcessingExtension Item id={self.item.id}>"
145144

146145
def apply(
147-
self: Self,
146+
self,
148147
level: ProcessingLevel | None = None,
149148
datetime: datetime | None = None,
150149
expression: str | None = None,
@@ -180,7 +179,7 @@ def apply(
180179
self.software = software
181180

182181
@property
183-
def level(self: Self) -> ProcessingLevel | None:
182+
def level(self) -> ProcessingLevel | None:
184183
"""Get or sets the processing level as the name commonly used to refer to the
185184
processing level to make it easier to search for product level across
186185
collections or items. This property is expected to be a `ProcessingLevel`"""
@@ -189,11 +188,11 @@ def level(self: Self) -> ProcessingLevel | None:
189188
)
190189

191190
@level.setter
192-
def level(self: Self, v: ProcessingLevel | None) -> None:
191+
def level(self, v: ProcessingLevel | None) -> None:
193192
self._set_property(LEVEL_PROP, map_opt(lambda x: x.value, v))
194193

195194
@property
196-
def datetime(self: Self) -> datetime | None:
195+
def datetime(self) -> datetime | None:
197196
"""Gets or set the processing date and time of the corresponding data formatted
198197
according to RFC 3339, section 5.6, in UTC. The time of the processing can be
199198
specified as a global field in processing:datetime, but it can also be specified
@@ -203,11 +202,11 @@ def datetime(self: Self) -> datetime | None:
203202
return map_opt(str_to_datetime, self._get_property(DATETIME_PROP, str))
204203

205204
@datetime.setter
206-
def datetime(self: Self, v: datetime | None) -> None:
205+
def datetime(self, v: datetime | None) -> None:
207206
self._set_property(DATETIME_PROP, map_opt(datetime_to_str, v))
208207

209208
@property
210-
def expression(self: Self) -> dict[str, str | Any] | None:
209+
def expression(self) -> dict[str, str | Any] | None:
211210
"""Gets or sets an expression or processing chain that describes how the data
212211
has been processed. Alternatively, you can also link to a processing chain with
213212
the relation type processing-expression.
@@ -217,7 +216,7 @@ def expression(self: Self) -> dict[str, str | Any] | None:
217216
return self._get_property(EXPRESSION_PROP, dict[str, str | Any])
218217

219218
@expression.setter
220-
def expression(self: Self, v: str | Any | None) -> None:
219+
def expression(self, v: str | Any | None) -> None:
221220
if isinstance(v, str):
222221
exp_format = "string"
223222
elif isinstance(v, object):
@@ -235,7 +234,7 @@ def expression(self: Self, v: str | Any | None) -> None:
235234
self._set_property(EXPRESSION_PROP, expression)
236235

237236
@property
238-
def lineage(self: Self) -> str | None:
237+
def lineage(self) -> str | None:
239238
"""Gets or sets the lineage provided as free text information about how
240239
observations were processed or models that were used to create the resource
241240
being described NASA ISO. For example, GRD Post Processing for "GRD" product of
@@ -244,32 +243,32 @@ def lineage(self: Self) -> str | None:
244243
return self._get_property(LINEAGE_PROP, str)
245244

246245
@lineage.setter
247-
def lineage(self: Self, v: str | None) -> None:
246+
def lineage(self, v: str | None) -> None:
248247
self._set_property(LINEAGE_PROP, v)
249248

250249
@property
251-
def facility(self: Self) -> str | None:
250+
def facility(self) -> str | None:
252251
"""Gets or sets the name of the facility that produced the data. For example,
253252
Copernicus S1 Core Ground Segment - DPA for product of Sentinel-1 satellites."""
254253
return self._get_property(FACILITY_PROP, str)
255254

256255
@facility.setter
257-
def facility(self: Self, v: str | None) -> None:
256+
def facility(self, v: str | None) -> None:
258257
self._set_property(FACILITY_PROP, v)
259258

260259
@property
261-
def version(self: Self) -> str | None:
260+
def version(self) -> str | None:
262261
"""Gets or sets The version of the primary processing software or processing
263262
chain that produced the data. For example, this could be the processing baseline
264263
for the Sentinel missions."""
265264
return self._get_property(VERSION_PROP, str)
266265

267266
@version.setter
268-
def version(self: Self, v: str | None) -> None:
267+
def version(self, v: str | None) -> None:
269268
self._set_property(VERSION_PROP, v)
270269

271270
@property
272-
def software(self: Self) -> dict[str, str] | None:
271+
def software(self) -> dict[str, str] | None:
273272
"""Gets or sets the processing software as a dictionary with name/version for
274273
key/value describing one or more applications or libraries that were involved
275274
during the production of the data for provenance purposes.
@@ -288,7 +287,7 @@ def software(self: Self) -> dict[str, str] | None:
288287
return self._get_property(SOFTWARE_PROP, dict[str, str])
289288

290289
@software.setter
291-
def software(self: Self, v: dict[str, str] | None) -> None:
290+
def software(self, v: dict[str, str] | None) -> None:
292291
self._set_property(SOFTWARE_PROP, v)
293292

294293
@classmethod
@@ -308,11 +307,11 @@ class ItemProcessingExtension(ProcessingExtension[pystac.Item]):
308307
item: pystac.Item
309308
properties: dict[str, Any]
310309

311-
def __init__(self: Self, item: pystac.Item) -> None:
310+
def __init__(self, item: pystac.Item) -> None:
312311
self.item = item
313312
self.properties = item.properties
314313

315-
def __repr__(self: Self) -> str:
314+
def __repr__(self) -> str:
316315
return f"<ItemProcessingExtension Item id={self.item.id}>"
317316

318317

@@ -335,21 +334,21 @@ class AssetProcessingExtension(ProcessingExtension[pystac.Asset]):
335334
"""If present, this will be a list containing 1 dictionary representing the
336335
properties of the owning :class:`~pystac.Item`."""
337336

338-
def __init__(self: Self, asset: pystac.Asset):
337+
def __init__(self, asset: pystac.Asset):
339338
self.asset_href = asset.href
340339
self.properties = asset.extra_fields
341340
if asset.owner and isinstance(asset.owner, pystac.Item):
342341
self.additional_read_properties = [asset.owner.properties]
343342

344-
def __repr__(self: Self) -> str:
343+
def __repr__(self) -> str:
345344
return f"<AssetProcessingExtension Asset href={self.asset_href}>"
346345

347346

348347
class ItemAssetsProcessingExtension(ProcessingExtension[pystac.ItemAssetDefinition]):
349348
properties: dict[str, Any]
350349
asset_defn: pystac.ItemAssetDefinition
351350

352-
def __init__(self: Self, item_asset: pystac.ItemAssetDefinition):
351+
def __init__(self, item_asset: pystac.ItemAssetDefinition):
353352
self.asset_defn = item_asset
354353
self.properties = item_asset.properties
355354

@@ -361,87 +360,87 @@ class SummariesProcessingExtension(SummariesExtension):
361360
"""
362361

363362
@property
364-
def level(self: Self) -> list[ProcessingLevel] | None:
363+
def level(self) -> list[ProcessingLevel] | None:
365364
"""Get or sets the summary of :attr:`ProcessingExtension.level` values
366365
for this Collection.
367366
"""
368367

369368
return self.summaries.get_list(LEVEL_PROP)
370369

371370
@level.setter
372-
def level(self: Self, v: list[ProcessingLevel] | None) -> None:
371+
def level(self, v: list[ProcessingLevel] | None) -> None:
373372
self._set_summary(LEVEL_PROP, v)
374373

375374
@property
376-
def datetime(self: Self) -> RangeSummary[datetime] | None:
375+
def datetime(self) -> RangeSummary[datetime] | None:
377376
"""Get or sets the summary of :attr:`ProcessingExtension.datetime` values
378377
for this Collection.
379378
"""
380379

381380
return self.summaries.get_range(DATETIME_PROP)
382381

383382
@datetime.setter
384-
def datetime(self: Self, v: RangeSummary[datetime] | None) -> None:
383+
def datetime(self, v: RangeSummary[datetime] | None) -> None:
385384
self._set_summary(DATETIME_PROP, v)
386385

387386
@property
388-
def expression(self: Self) -> list[dict[str, str | Any]] | None:
387+
def expression(self) -> list[dict[str, str | Any]] | None:
389388
"""Get or sets the summary of :attr:`ProcessingExtension.expression` values
390389
for this Collection.
391390
"""
392391

393392
return self.summaries.get_list(EXPRESSION_PROP)
394393

395394
@expression.setter
396-
def expression(self: Self, v: list[dict[str, str | Any]] | None) -> None:
395+
def expression(self, v: list[dict[str, str | Any]] | None) -> None:
397396
self._set_summary(EXPRESSION_PROP, v)
398397

399398
@property
400-
def lineage(self: Self) -> RangeSummary[str] | None:
399+
def lineage(self) -> RangeSummary[str] | None:
401400
"""Get or sets the summary of :attr:`ProcessingExtension.lineage` values
402401
for this Collection.
403402
"""
404403

405404
return self.summaries.get_range(LINEAGE_PROP)
406405

407406
@lineage.setter
408-
def lineage(self: Self, v: RangeSummary[str] | None) -> None:
407+
def lineage(self, v: RangeSummary[str] | None) -> None:
409408
self._set_summary(LINEAGE_PROP, v)
410409

411410
@property
412-
def facility(self: Self) -> RangeSummary[str] | None:
411+
def facility(self) -> RangeSummary[str] | None:
413412
"""Get or sets the summary of :attr:`ProcessingExtension.facility` values
414413
for this Collection.
415414
"""
416415

417416
return self.summaries.get_range(FACILITY_PROP)
418417

419418
@facility.setter
420-
def facility(self: Self, v: RangeSummary[str] | None) -> None:
419+
def facility(self, v: RangeSummary[str] | None) -> None:
421420
self._set_summary(FACILITY_PROP, v)
422421

423422
@property
424-
def version(self: Self) -> RangeSummary[str] | None:
423+
def version(self) -> RangeSummary[str] | None:
425424
"""Get or sets the summary of :attr:`ProcessingExtension.version` values
426425
for this Collection.
427426
"""
428427

429428
return self.summaries.get_range(VERSION_PROP)
430429

431430
@version.setter
432-
def version(self: Self, v: RangeSummary[str] | None) -> None:
431+
def version(self, v: RangeSummary[str] | None) -> None:
433432
self._set_summary(VERSION_PROP, v)
434433

435434
@property
436-
def software(self: Self) -> RangeSummary[dict[str, str]] | None:
435+
def software(self) -> RangeSummary[dict[str, str]] | None:
437436
"""Get or sets the summary of :attr:`ProcessingExtension.software` values
438437
for this Collection.
439438
"""
440439

441440
return self.summaries.get_range(SOFTWARE_PROP)
442441

443442
@software.setter
444-
def software(self: Self, v: RangeSummary[dict[str, str]] | None) -> None:
443+
def software(self, v: RangeSummary[dict[str, str]] | None) -> None:
445444
self._set_summary(SOFTWARE_PROP, v)
446445

447446

0 commit comments

Comments
 (0)