Bump ruff from 0.7.4 to 0.8.0 in /requirements (#2423)

* Bump ruff from 0.7.4 to 0.8.0 in /requirements

Bumps [ruff](https://github.com/astral-sh/ruff) from 0.7.4 to 0.8.0.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.7.4...0.8.0)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Sort __all__, remove comments

* Bump minimum ruff, fix formatting

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
dependabot[bot] 2024-11-23 10:26:55 +00:00 коммит произвёл GitHub
Родитель 7df2529fd7
Коммит b3a1981170
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
11 изменённых файлов: 140 добавлений и 163 удалений

Просмотреть файл

@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.5
rev: v0.8.0
hooks:
- id: ruff
types_or:

Просмотреть файл

@ -520,7 +520,7 @@ if __name__ == '__main__':
print(f'Downloaded {count} images in {time.time() - start_time:.3f}s.')
else:
if args.debug:
print('no suitable image for location %d.' % (idx))
print(f'no suitable image for location {idx}.')
# add to existing checked locations
with open(ext_path, 'a') as f:

Просмотреть файл

@ -26,8 +26,8 @@ __all__ = (
'resnet50',
'resnet152',
'scalemae_large_patch16',
'swin_v2_t',
'swin_v2_b',
'swin_v2_t',
'vit_small_patch16_224',
)

Просмотреть файл

@ -115,8 +115,8 @@ docs = [
style = [
# mypy 0.900+ required for pyproject.toml support
"mypy>=0.900",
# ruff 0.2+ required for [ruff.lint]
"ruff>=0.2",
# ruff 0.8+ required for removal of ANN101, ANN102
"ruff>=0.8",
]
tests = [
# nbmake 1.3.3+ required for variable mocking
@ -298,7 +298,7 @@ skip-magic-trailing-comma = true
[tool.ruff.lint]
extend-select = ["ANN", "D", "I", "RUF", "UP"]
ignore = ["ANN101", "ANN102", "ANN401"]
ignore = ["ANN401"]
[tool.ruff.lint.per-file-ignores]
"docs/**" = ["ANN", "D"]

Просмотреть файл

@ -1,3 +1,3 @@
# style
mypy==1.13.0
ruff==0.7.4
ruff==0.8.0

Просмотреть файл

@ -55,67 +55,63 @@ from .vhr10 import VHR10DataModule
from .xview import XView2DataModule
__all__ = (
# GeoDataset
'AgriFieldNetDataModule',
'ChesapeakeCVPRDataModule',
'IOBenchDataModule',
'L7IrishDataModule',
'L8BiomeDataModule',
'NAIPChesapeakeDataModule',
'Sentinel2CDLDataModule',
'Sentinel2EuroCropsDataModule',
'Sentinel2NCCMDataModule',
'Sentinel2SouthAmericaSoybeanDataModule',
'SouthAfricaCropTypeDataModule',
# NonGeoDataset
'BaseDataModule',
'BigEarthNetDataModule',
'CaFFeDataModule',
'CaBuArDataModule',
'ChaBuDDataModule',
'COWCCountingDataModule',
'CaBuArDataModule',
'CaFFeDataModule',
'ChaBuDDataModule',
'ChesapeakeCVPRDataModule',
'DeepGlobeLandCoverDataModule',
'DigitalTyphoonDataModule',
'ETCI2021DataModule',
'EuroSAT100DataModule',
'EuroSATDataModule',
'EuroSATSpatialDataModule',
'EuroSAT100DataModule',
'FAIR1MDataModule',
'FieldsOfTheWorldDataModule',
'FireRiskDataModule',
'GeoNRWDataModule',
'GID15DataModule',
'GeoDataModule',
'GeoNRWDataModule',
'IOBenchDataModule',
'InriaAerialImageLabelingDataModule',
'LandCoverAIDataModule',
'LandCoverAI100DataModule',
'L7IrishDataModule',
'L8BiomeDataModule',
'LEVIRCDDataModule',
'LEVIRCDPlusDataModule',
'LandCoverAI100DataModule',
'LandCoverAIDataModule',
'LoveDADataModule',
'MisconfigurationException',
'NAIPChesapeakeDataModule',
'NASAMarineDebrisDataModule',
'NonGeoDataModule',
'OSCDDataModule',
'Potsdam2DDataModule',
'QuakeSetDataModule',
'RESISC45DataModule',
'SeasonalContrastS2DataModule',
'SEN12MSDataModule',
'SKIPPDDataModule',
'So2SatDataModule',
'SpaceNetBaseDataModule',
'SpaceNet1DataModule',
'SpaceNet6DataModule',
'SSL4EOLBenchmarkDataModule',
'SSL4EOLDataModule',
'SSL4EOS12DataModule',
'SeasonalContrastS2DataModule',
'Sentinel2CDLDataModule',
'Sentinel2EuroCropsDataModule',
'Sentinel2NCCMDataModule',
'Sentinel2SouthAmericaSoybeanDataModule',
'So2SatDataModule',
'SouthAfricaCropTypeDataModule',
'SpaceNet1DataModule',
'SpaceNet6DataModule',
'SpaceNetBaseDataModule',
'SustainBenchCropYieldDataModule',
'TropicalCycloneDataModule',
'UCMercedDataModule',
'USAVarsDataModule',
'Vaihingen2DDataModule',
'VHR10DataModule',
'Vaihingen2DDataModule',
'XView2DataModule',
# Base classes
'BaseDataModule',
'GeoDataModule',
'NonGeoDataModule',
# Utilities
'MisconfigurationException',
)

Просмотреть файл

@ -147,14 +147,47 @@ from .xview import XView2
from .zuericrop import ZueriCrop
__all__ = (
# GeoDataset
'ADVANCE',
'CDL',
'COWC',
'DFC2022',
'ETCI2021',
'EUDEM',
'FAIR1M',
'GBIF',
'GID15',
'LEVIRCD',
'NAIP',
'NCCM',
'NLCD',
'OSCD',
'PASTIS',
'PRISMA',
'RESISC45',
'SEN12MS',
'SKIPPD',
'SSL4EO',
'SSL4EOL',
'SSL4EOS12',
'VHR10',
'AbovegroundLiveWoodyBiomassDensity',
'AgriFieldNet',
'Airphen',
'AsterGDEM',
'BeninSmallHolderCashews',
'BigEarthNet',
'BioMassters',
'BoundingBox',
'CMSGlobalMangroveCanopy',
'COWCCounting',
'COWCDetection',
'CV4AKenyaCropType',
'CaBuAr',
'CaFFe',
'CanadianBuildingFootprints',
'CDL',
'ChaBuD',
'Chesapeake',
'ChesapeakeCVPR',
'ChesapeakeDC',
'ChesapeakeDE',
'ChesapeakeMD',
@ -162,19 +195,36 @@ __all__ = (
'ChesapeakePA',
'ChesapeakeVA',
'ChesapeakeWV',
'ChesapeakeCVPR',
'CMSGlobalMangroveCanopy',
'CloudCoverDetection',
'CropHarvest',
'DatasetNotFoundError',
'DeepGlobeLandCover',
'DependencyNotFoundError',
'DigitalTyphoon',
'EDDMapS',
'EnviroAtlas',
'Esri2020',
'EuroCrops',
'EUDEM',
'GBIF',
'EuroSAT',
'EuroSAT100',
'EuroSATSpatial',
'FieldsOfTheWorld',
'FireRisk',
'ForestDamage',
'GeoDataset',
'GeoNRW',
'GlobBiomass',
'IDTReeS',
'INaturalist',
'IOBench',
'InriaAerialImageLabeling',
'IntersectionDataset',
'L7Irish',
'L8Biome',
'LEVIRCDBase',
'LEVIRCDPlus',
'LandCoverAI',
'LandCoverAI100',
'LandCoverAIBase',
'LandCoverAIGeo',
'Landsat',
@ -188,70 +238,32 @@ __all__ = (
'Landsat7',
'Landsat8',
'Landsat9',
'NAIP',
'NCCM',
'NLCD',
'OpenBuildings',
'PRISMA',
'Sentinel',
'Sentinel1',
'Sentinel2',
'SouthAfricaCropType',
'SouthAmericaSoybean',
# NonGeoDataset
'ADVANCE',
'BeninSmallHolderCashews',
'BigEarthNet',
'BioMassters',
'CaBuAr',
'CaFFe',
'ChaBuD',
'CloudCoverDetection',
'COWC',
'COWCCounting',
'COWCDetection',
'CV4AKenyaCropType',
'DeepGlobeLandCover',
'DFC2022',
'DigitalTyphoon',
'EnviroAtlas',
'ETCI2021',
'EuroSAT',
'EuroSATSpatial',
'EuroSAT100',
'FAIR1M',
'FieldsOfTheWorld',
'FireRisk',
'ForestDamage',
'GeoNRW',
'GID15',
'IDTReeS',
'InriaAerialImageLabeling',
'LandCoverAI',
'LandCoverAI100',
'LEVIRCD',
'LEVIRCDBase',
'LEVIRCDPlus',
'LoveDA',
'MMEarth',
'MapInWild',
'MillionAID',
'MMEarth',
'NASAMarineDebris',
'OSCD',
'PASTIS',
'NonGeoClassificationDataset',
'NonGeoDataset',
'OpenBuildings',
'PatternNet',
'Potsdam2D',
'QuakeSet',
'RESISC45',
'RGBBandsMissingError',
'RasterDataset',
'ReforesTree',
'RwandaFieldBoundary',
'SSL4EOLBenchmark',
'SatlasPretrain',
'SeasonalContrastS2',
'SeasoNet',
'SEN12MS',
'SKIPPD',
'SeasonalContrastS2',
'Sentinel',
'Sentinel1',
'Sentinel2',
'SkyScript',
'So2Sat',
'SouthAfricaCropType',
'SouthAmericaSoybean',
'SpaceNet',
'SpaceNet1',
'SpaceNet2',
@ -261,41 +273,23 @@ __all__ = (
'SpaceNet6',
'SpaceNet7',
'SpaceNet8',
'SSL4EO',
'SSL4EOLBenchmark',
'SSL4EOL',
'SSL4EOS12',
'SustainBenchCropYield',
'TropicalCyclone',
'UCMerced',
'USAVars',
'UnionDataset',
'Vaihingen2D',
'VHR10',
'VectorDataset',
'WesternUSALiveFuelMoisture',
'XView2',
'ZueriCrop',
# Base classes
'GeoDataset',
'IntersectionDataset',
'NonGeoClassificationDataset',
'NonGeoDataset',
'RasterDataset',
'UnionDataset',
'VectorDataset',
# Utilities
'BoundingBox',
'concat_samples',
'merge_samples',
'stack_samples',
'unbind_samples',
# Splits
'random_bbox_assignment',
'random_bbox_splitting',
'random_grid_cell_assignment',
'roi_split',
'stack_samples',
'time_series_split',
# Errors
'DatasetNotFoundError',
'DependencyNotFoundError',
'RGBBandsMissingError',
'unbind_samples',
)

Просмотреть файл

@ -32,46 +32,43 @@ from .swin import Swin_V2_B_Weights, Swin_V2_T_Weights, swin_v2_b, swin_v2_t
from .vit import ViTSmall16_Weights, vit_small_patch16_224
__all__ = (
# models
'CROMA',
'DOFA',
'FCN',
'RCF',
'CROMABase_Weights',
'CROMALarge_Weights',
'ChangeMixin',
'ChangeStar',
'ChangeStarFarSeg',
'CROMA',
'CROMABase_Weights',
'CROMALarge_Weights',
'croma_base',
'croma_large',
'DOFA',
'dofa_small_patch16_224',
'dofa_base_patch16_224',
'dofa_large_patch16_224',
'dofa_huge_patch16_224',
'FarSeg',
'FCN',
'FCSiamConc',
'FCSiamDiff',
'RCF',
'resnet18',
'resnet50',
'resnet152',
'ScaleMAE',
'scalemae_large_patch16',
'swin_v2_t',
'swin_v2_b',
'vit_small_patch16_224',
# weights
'DOFABase16_Weights',
'DOFALarge16_Weights',
'FCSiamConc',
'FCSiamDiff',
'FarSeg',
'ResNet18_Weights',
'ResNet50_Weights',
'ResNet152_Weights',
'ScaleMAE',
'ScaleMAELarge16_Weights',
'Swin_V2_T_Weights',
'Swin_V2_B_Weights',
'Swin_V2_T_Weights',
'ViTSmall16_Weights',
# utilities
'croma_base',
'croma_large',
'dofa_base_patch16_224',
'dofa_huge_patch16_224',
'dofa_large_patch16_224',
'dofa_small_patch16_224',
'get_model',
'get_model_weights',
'get_weight',
'list_models',
'resnet18',
'resnet50',
'resnet152',
'scalemae_large_patch16',
'swin_v2_b',
'swin_v2_t',
'vit_small_patch16_224',
)

Просмотреть файл

@ -163,8 +163,7 @@ def interpolate_pos_embed(
# class_token and dist_token are kept unchanged
if orig_size != new_size:
print(
'Interpolating positional embeddings from %dx%d to %dx%d'
% (orig_size, orig_size, new_size, new_size)
f'Interpolating positional embeddings from {orig_size}x{orig_size} to {new_size}x{new_size}'
)
extra_tokens = pos_embed_checkpoint[:, :num_extra_tokens]
# only the position tokens are interpolated

Просмотреть файл

@ -9,18 +9,13 @@ from .single import GeoSampler, GridGeoSampler, PreChippedGeoSampler, RandomGeoS
from .utils import get_random_bounding_box, tile_to_chips
__all__ = (
# Samplers
'BatchGeoSampler',
'GeoSampler',
'GridGeoSampler',
'PreChippedGeoSampler',
'RandomGeoSampler',
# Batch samplers
'RandomBatchGeoSampler',
# Base classes
'GeoSampler',
'BatchGeoSampler',
# Utilities
'RandomGeoSampler',
'Units',
'get_random_bounding_box',
'tile_to_chips',
# Constants
'Units',
)

Просмотреть файл

@ -14,19 +14,15 @@ from .segmentation import SemanticSegmentationTask
from .simclr import SimCLRTask
__all__ = (
# Supervised
'BYOLTask',
'BaseTask',
'ClassificationTask',
'IOBenchTask',
'MoCoTask',
'MultiLabelClassificationTask',
'ObjectDetectionTask',
'PixelwiseRegressionTask',
'RegressionTask',
'SemanticSegmentationTask',
# Self-supervised
'BYOLTask',
'MoCoTask',
'SimCLRTask',
# Base classes
'BaseTask',
# Other
'IOBenchTask',
)