diff --git a/pystac/catalog.py b/pystac/catalog.py index ea77557d1..9b6b457ac 100644 --- a/pystac/catalog.py +++ b/pystac/catalog.py @@ -46,8 +46,9 @@ def __str__(self) -> str: local computer, so all links need to be relative. See: - :stac-spec:`The best practices documentation on self-contained catalogs ` - """ # noqa E501 + :stac-spec:`The best practices documentation on self-contained catalogs + ` + """ ABSOLUTE_PUBLISHED = "ABSOLUTE_PUBLISHED" """ @@ -55,17 +56,19 @@ def __str__(self) -> str: both in the links objects and in the asset hrefs. See: - :stac-spec:`The best practices documentation on published catalogs ` - """ # noqa E501 + :stac-spec:`The best practices documentation on published catalogs + ` + """ RELATIVE_PUBLISHED = "RELATIVE_PUBLISHED" """ - Relative Published Catalog is a catalog that uses relative links for everything, - but includes an absolute self link at the root catalog, to identify its online location. + Relative Published Catalog is a catalog that uses relative links for everything, but + includes an absolute self link at the root catalog, to identify its online location. See: - :stac-spec:`The best practices documentation on published catalogs ` - """ # noqa E501 + :stac-spec:`The best practices documentation on published catalogs + ` + """ @classmethod def determine_type(cls, stac_json: Dict[str, Any]) -> Optional["CatalogType"]: @@ -564,11 +567,13 @@ def normalize_hrefs( Args: root_href : The absolute HREF that all links will be normalized against. strategy : The layout strategy to use in setting the HREFS - for this catalog. Defaults to :class:`~pystac.layout.BestPracticesLayoutStrategy` + for this catalog. Defaults to + :class:`~pystac.layout.BestPracticesLayoutStrategy` See: - :stac-spec:`STAC best practices document ` for the canonical layout of a STAC. - """ # noqa E501 + :stac-spec:`STAC best practices document ` + for the canonical layout of a STAC. + """ if strategy is None: _strategy: HrefLayoutStrategy = BestPracticesLayoutStrategy() else: diff --git a/pystac/extensions/eo.py b/pystac/extensions/eo.py index f21afbba3..a41f9aa28 100644 --- a/pystac/extensions/eo.py +++ b/pystac/extensions/eo.py @@ -66,11 +66,11 @@ def apply( of accepted common names `. description : Description to fully explain the band. center_wavelength : The center wavelength of the band, in micrometers (μm). - full_width_half_max : Full width at half maximum (FWHM). The width of the band, - as measured at half the maximum transmission, in micrometers (μm). + full_width_half_max : Full width at half maximum (FWHM). The width of the + band, as measured at half the maximum transmission, in micrometers (μm). solar_illumination: The solar illumination of the band, as measured at half the maximum transmission, in W/m2/micrometers. - """ # noqa + """ self.name = name self.common_name = common_name self.description = description @@ -98,11 +98,11 @@ def create( accepted common names `. description : Description to fully explain the band. center_wavelength : The center wavelength of the band, in micrometers (μm). - full_width_half_max : Full width at half maximum (FWHM). The width of the band, - as measured at half the maximum transmission, in micrometers (μm). + full_width_half_max : Full width at half maximum (FWHM). The width of the + band, as measured at half the maximum transmission, in micrometers (μm). solar_illumination: The solar illumination of the band, as measured at half the maximum transmission, in W/m2/micrometers. - """ # noqa + """ b = cls({}) b.apply( name=name, @@ -135,7 +135,7 @@ def common_name(self) -> Optional[str]: Returns: Optional[str] - """ # noqa + """ return self.properties.get("common_name") @common_name.setter @@ -234,7 +234,7 @@ def band_range(common_name: str) -> Optional[Tuple[float, float]]: Returns: Tuple[float, float] or None: The band range for this name as (min, max), or None if this is not a recognized common name. - """ # noqa E501 + """ name_to_range = { "coastal": (0.40, 0.45), "blue": (0.45, 0.50), @@ -265,9 +265,9 @@ def band_description(common_name: str) -> Optional[str]: accepted common names `. Returns: - str or None: If a recognized common name, returns a description including the - band range. Otherwise returns None. - """ # noqa E501 + str or None: If a recognized common name, returns a description including + the band range. Otherwise returns None. + """ r = Band.band_range(common_name) if r is not None: return "Common name: {}, Range: {} to {}".format(common_name, r[0], r[1]) diff --git a/pystac/extensions/projection.py b/pystac/extensions/projection.py index 0ec16ec4d..05553a68c 100644 --- a/pystac/extensions/projection.py +++ b/pystac/extensions/projection.py @@ -220,13 +220,14 @@ def transform(self) -> Optional[List[float]]: """Get or sets the the affine transformation coefficients for the default grid. The transform is a linear mapping from pixel coordinate space (Pixel, Line) to - projection coordinate space (Xp, Yp). It is a 3x3 matrix stored as a flat array of 9 - elements in row major order. Since the last row is always 0,0,1 it can be omitted, in - which case only 6 elements are recorded. This mapping can be obtained from - GDAL `GetGeoTransform `_ - or the - Rasterio `Transform `_. - """ # noqa: E501 + projection coordinate space (Xp, Yp). It is a 3x3 matrix stored as a flat array + of 9 elements in row major order. Since the last row is always 0,0,1 it can be + omitted, in which case only 6 elements are recorded. This mapping can be + obtained from GDAL `GetGeoTransform `_ + or the Rasterio `Transform `_. + """ return self._get_property(TRANSFORM_PROP, List[float]) @transform.setter diff --git a/pystac/extensions/raster.py b/pystac/extensions/raster.py index 919923f3e..30eaf3da3 100644 --- a/pystac/extensions/raster.py +++ b/pystac/extensions/raster.py @@ -75,7 +75,7 @@ def apply( mean : Mean value of all the pixels in the band. stddev : Standard Deviation value of all the pixels in the band. valid_percent : Percentage of valid (not nodata) pixel. - """ # noqa + """ self.minimum = minimum self.maximum = maximum self.mean = mean @@ -100,7 +100,7 @@ def create( mean : Mean value of all the pixels in the band. stddev : Standard Deviation value of all the pixels in the band. valid_percent : Percentage of valid (not nodata) pixel. - """ # noqa + """ b = cls({}) b.apply( minimum=minimum, @@ -236,7 +236,7 @@ def apply( Also the mean value of the last bucket. buckets : Array of integer indicating the number of pixels included in the bucket. - """ # noqa + """ self.count = count self.min = min self.max = max @@ -261,7 +261,7 @@ def create( Also the mean value of the last bucket. buckets : Array of integer indicating the number of pixels included in the bucket. - """ # noqa + """ b = cls({}) b.apply( count=count, @@ -370,22 +370,26 @@ def apply( Args: nodata : Pixel values used to identify pixels that are nodata in the assets. - sampling : One of area or point. Indicates whether a pixel value should be assumed - to represent a sampling over the region of the pixel or a point sample at the center of the pixel. + sampling : One of area or point. Indicates whether a pixel value should be + assumed to represent a sampling over the region of the pixel or a point + sample at the center of the pixel. data_type :The data type of the band. - One of the data types as described in . + One of the data types as described in + . bits_per_sample : The actual number of bits used for this band. - Normally only present when the number of bits is non-standard for the datatype, - such as when a 1 bit TIFF is represented as byte - spatial_resolution : Average spatial resolution (in meters) of the pixels in the band. + Normally only present when the number of bits is non-standard for the + datatype, such as when a 1 bit TIFF is represented as byte + spatial_resolution : Average spatial resolution (in meters) of the pixels in + the band. statistics: Statistics of all the pixels in the band unit: unit denomination of the pixel value scale: multiplicator factor of the pixel value to transform into the value (i.e. translate digital number to reflectance). - offset: number to be added to the pixel value (after scaling) to transform into the value - (i.e. translate digital number to reflectance). - histogram: Histogram distribution information of the pixels values in the band - """ # noqa + offset: number to be added to the pixel value (after scaling) to transform + into the value (i.e. translate digital number to reflectance). + histogram: Histogram distribution information of the pixels values in the + band + """ self.nodata = nodata self.sampling = sampling self.data_type = data_type @@ -416,22 +420,26 @@ def create( Args: nodata : Pixel values used to identify pixels that are nodata in the assets. - sampling : One of area or point. Indicates whether a pixel value should be assumed - to represent a sampling over the region of the pixel or a point sample at the center of the pixel. + sampling : One of area or point. Indicates whether a pixel value should be + assumed to represent a sampling over the region of the pixel or a point + sample at the center of the pixel. data_type :The data type of the band. - One of the data types as described in . + One of the data types as described in + . bits_per_sample : The actual number of bits used for this band. - Normally only present when the number of bits is non-standard for the datatype, - such as when a 1 bit TIFF is represented as byte - spatial_resolution : Average spatial resolution (in meters) of the pixels in the band. + Normally only present when the number of bits is non-standard for the + datatype, such as when a 1 bit TIFF is represented as byte + spatial_resolution : Average spatial resolution (in meters) of the pixels in + the band. statistics: Statistics of all the pixels in the band unit: unit denomination of the pixel value scale: multiplicator factor of the pixel value to transform into the value (i.e. translate digital number to reflectance). - offset: number to be added to the pixel value (after scaling) to transform into the value - (i.e. translate digital number to reflectance). - histogram: Histogram distribution information of the pixels values in the band - """ # noqa + offset: number to be added to the pixel value (after scaling) to transform + into the value (i.e. translate digital number to reflectance). + histogram: Histogram distribution information of the pixels values in the + band + """ b = cls({}) b.apply( nodata=nodata, @@ -471,7 +479,7 @@ def sampling(self) -> Optional[Sampling]: Returns: Optional[Sampling] - """ # noqa + """ return self.properties.get("sampling") @sampling.setter diff --git a/pystac/serialization/migrate.py b/pystac/serialization/migrate.py index 35d962f04..0c9e7e1a4 100644 --- a/pystac/serialization/migrate.py +++ b/pystac/serialization/migrate.py @@ -99,7 +99,7 @@ def _get_removed_extension_migrations() -> Dict[ ] ], ], -]: # noqa +]: """Handles removed extensions. This does not handle renamed extension or extensions that were absorbed diff --git a/tests/utils/test_cases.py b/tests/utils/test_cases.py index 4fc820265..c9b8934b1 100644 --- a/tests/utils/test_cases.py +++ b/tests/utils/test_cases.py @@ -72,7 +72,7 @@ ARBITRARY_EXTENT = Extent( spatial=SpatialExtent.from_coordinates(ARBITRARY_GEOM["coordinates"]), temporal=TemporalExtent.from_now(), -) # noqa: E126 +) class ExampleInfo: @@ -206,8 +206,9 @@ def test_case_3() -> Catalog: def test_case_4() -> Catalog: """Test case that is based on a local copy of the Tier 1 dataset from DrivenData's OpenCities AI Challenge. - See: https://www.drivendata.org/competitions/60/building-segmentation-disaster-resilience - """ # noqa + See: https://www.drivendata.org/competitions/60/building-segmentation-disaster\ +-resilience + """ return Catalog.from_file( TestCases.get_path("data-files/catalogs/test-case-4/catalog.json") )