* Run linters on tests/data

* Configuration: use .gitignore for tool skip

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
Ashwin Nair 2022-01-13 23:16:10 +04:00 коммит произвёл GitHub
Родитель 08a365f55b
Коммит 4bd4f2acdc
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
7 изменённых файлов: 7 добавлений и 46 удалений

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

@ -9,31 +9,6 @@ build-backend = "setuptools.build_meta"
target-version = ["py36", "py37", "py38", "py39"]
color = true
skip_magic_trailing_comma = true
exclude = '''
/(
# TorchGeo
| data
| logo
| logs
| output
# Spack
| \.spack-env
# Python
| build
| dist
| \.cache
| \.mypy_cache
| \.pytest_cache
| __pycache__
| .*\.egg-info
# Git
| \.git
| \.github
)/
'''
[tool.coverage.report]
# Ignore warnings for overloads
@ -46,7 +21,6 @@ exclude_lines = [
[tool.isort]
profile = "black"
known_first_party = ["docs", "tests", "torchgeo", "train"]
extend_skip = [".spack-env/", "data", "logs", "output"]
skip_gitignore = true
color_output = true

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

@ -5,15 +5,14 @@
import bz2
import csv
import hashlib
import glob
import hashlib
import os
import random
import shutil
from PIL import Image
SIZE = 64 # image width/height
STOP = 20 # range of values for labels
PREFIX = "Counting"

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

@ -5,15 +5,14 @@
import bz2
import csv
import hashlib
import glob
import hashlib
import os
import random
import shutil
from PIL import Image
SIZE = 64 # image width/height
STOP = 2 # range of values for labels
PREFIX = "Detection"

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

@ -10,7 +10,6 @@ import shutil
import numpy as np
from PIL import Image
SIZE = 64 # image width/height
np.random.seed(0)

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

@ -9,8 +9,8 @@ import shutil
import numpy as np
import rasterio
from rasterio.transform import Affine
from rasterio.crs import CRS
from rasterio.transform import Affine
SIZE = 64 # image width/height

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

@ -9,7 +9,6 @@ import os
import h5py
import numpy as np
SIZE = 64 # image width/height
NUM_CLASSES = 17
NUM_SAMPLES = 1

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

@ -4,12 +4,11 @@
# Licensed under the MIT License.
import os
import h5py
from pathlib import Path
import h5py
import numpy as np
# Sentinel-2 is 12-bit with range 0-4095
SENTINEL2_MAX = 4096
@ -34,20 +33,12 @@ Path(labels_file).touch()
# Create dataset file
data = np.random.randint(
SENTINEL2_MAX,
size=(NUM_SAMPLES, 1, SIZE, SIZE, NUM_CHANNELS),
dtype=np.int16
SENTINEL2_MAX, size=(NUM_SAMPLES, 1, SIZE, SIZE, NUM_CHANNELS), dtype=np.int16
)
data = data.astype(np.float64)
gt = np.random.randint(
NUM_CLASSES,
size=(NUM_SAMPLES, SIZE, SIZE, 1),
dtype=np.int16
)
gt = np.random.randint(NUM_CLASSES, size=(NUM_SAMPLES, SIZE, SIZE, 1), dtype=np.int16)
gt_instance = np.random.randint(
NUM_CLASSES,
size=(NUM_SAMPLES, SIZE, SIZE, 1),
dtype=np.int32
NUM_CLASSES, size=(NUM_SAMPLES, SIZE, SIZE, 1), dtype=np.int32
)
with h5py.File(data_file, "w") as f: