tensorflow / datasets

TFDS is a collection of datasets ready to use with TensorFlow, Jax, ...
https://www.tensorflow.org/datasets
Apache License 2.0
4.31k stars 1.54k forks source link

`pylint` errors in TFDS. #1644

Open ChanchalKumarMaji opened 4 years ago

ChanchalKumarMaji commented 4 years ago

Short description Many pylint errors exists in TFDS. Running pylint not generating 10.0/10 rating.

For example running ./oss_scripts/lint.sh tensorflow_datasets/image gives -

click here
``` Using config file /tmp/pylintrc ************* Module tensorflow_datasets.image.so2sat C: 93, 2: Missing method docstring (missing-docstring) C:150, 6: Consider using enumerate instead of iterating with range and len (consider-using-enumerate) ************* Module tensorflow_datasets.image.clevr C:100, 2: Missing method docstring (missing-docstring) ************* Module tensorflow_datasets.image.places365_small_test C: 1, 0: Missing module docstring (missing-docstring) ************* Module tensorflow_datasets.image.patch_camelyon C: 69, 2: Missing method docstring (missing-docstring) ************* Module tensorflow_datasets.image.eurosat C:102, 2: Missing method docstring (missing-docstring) ************* Module tensorflow_datasets.image.caltech_birds C: 84, 2: Missing method docstring (missing-docstring) ************* Module tensorflow_datasets.image.oxford_flowers102_test C: 44, 0: Trailing newlines (trailing-newlines) ************* Module tensorflow_datasets.image.patch_camelyon_test C: 27, 0: Missing class docstring (missing-docstring) ************* Module tensorflow_datasets.image.visual_domain_decathlon C:111, 2: Missing method docstring (missing-docstring) ************* Module tensorflow_datasets.image.sun C:225, 2: Missing method docstring (missing-docstring) R:242, 4: Unnecessary "else" after "return" (no-else-return) C:276, 2: Missing method docstring (missing-docstring) C:305, 2: Missing method docstring (missing-docstring) ************* Module tensorflow_datasets.image.stanford_online_products_test C: 1, 0: Missing module docstring (missing-docstring) ************* Module tensorflow_datasets.image.duke_ultrasound C:116, 2: Missing method docstring (missing-docstring) C:143, 2: Missing method docstring (missing-docstring) ************* Module tensorflow_datasets.image.imagenet2012_corrupted_test C: 28, 0: Missing class docstring (missing-docstring) ************* Module tensorflow_datasets.image.cars196_test C: 1, 0: Missing module docstring (missing-docstring) ************* Module tensorflow_datasets.image.caltech_test C: 26, 0: Missing class docstring (missing-docstring) C: 35, 2: Method name "setUp" doesn't conform to u'^(?:(?P__[a-z0-9_]+__|next)|(?P_{0,2}[A-Z][a-zA-Z0-9]*)|(?P_{0,2}[a-z][a-z0-9_]*))$' pattern (invalid-name) W: 37, 4: Access to a protected member _TRAIN_POINTS_PER_CLASS of a client class (protected-access) ************* Module tensorflow_datasets.image.cars196 W:208,31: Unused argument 'split_name' (unused-argument) C:227, 2: Method name "returnImageDict" doesn't conform to u'^(?:(?P__[a-z0-9_]+__|next)|(?P_{0,2}[A-Z][a-zA-Z0-9]*)|(?P_{0,2}[a-z][a-z0-9_]*))$' pattern (invalid-name) C:233, 2: Method name "returnBbox" doesn't conform to u'^(?:(?P__[a-z0-9_]+__|next)|(?P_{0,2}[A-Z][a-zA-Z0-9]*)|(?P_{0,2}[a-z][a-z0-9_]*))$' pattern (invalid-name) C:233, 2: Missing method docstring (missing-docstring) ************* Module tensorflow_datasets.image.cifar10_1 C: 87, 0: Line too long (115/80) (line-too-long) C: 88, 0: Line too long (114/80) (line-too-long) C: 89, 0: Line too long (111/80) (line-too-long) C: 90, 0: Line too long (117/80) (line-too-long) C: 91, 0: Line too long (89/80) (line-too-long) C: 98, 0: Line too long (119/80) (line-too-long) C: 99, 0: Line too long (111/80) (line-too-long) C:139, 2: Missing method docstring (missing-docstring) ************* Module tensorflow_datasets.image.cassava C:110, 0: Trailing newlines (trailing-newlines) ************* Module tensorflow_datasets.image.aflw2k3d C: 94, 2: Missing method docstring (missing-docstring) ************* Module tensorflow_datasets.image.binary_alpha_digits_test C: 1, 0: Missing module docstring (missing-docstring) ************* Module tensorflow_datasets.image.lost_and_found C:135, 2: Missing method docstring (missing-docstring) ************* Module tensorflow_datasets.image.beans_test C: 39, 0: Trailing newlines (trailing-newlines) ************* Module tensorflow_datasets.image.vgg_face2_test C: 37, 0: Trailing newlines (trailing-newlines) ************* Module tensorflow_datasets.image.colorectal_histology C:104, 2: Missing method docstring (missing-docstring) ************* Module tensorflow_datasets.image.dmlab C:118, 2: Missing method docstring (missing-docstring) ************* Module tensorflow_datasets.image.cbis_ddsm C:118, 0: Line too long (121/80) (line-too-long) C:161, 2: Missing method docstring (missing-docstring) C:202, 2: Missing method docstring (missing-docstring) C:218, 2: Missing method docstring (missing-docstring) C:254, 2: Missing method docstring (missing-docstring) C:288, 2: Missing method docstring (missing-docstring) C:360, 2: Missing method docstring (missing-docstring) R:363, 6: Unnecessary "else" after "return" (no-else-return) C:385, 2: Missing method docstring (missing-docstring) ************* Module tensorflow_datasets.image.cassava_test C: 37, 0: Trailing newlines (trailing-newlines) ************* Module tensorflow_datasets.image.imagenet_resized_test C: 1, 0: Missing module docstring (missing-docstring) C: 25, 0: Missing class docstring (missing-docstring) ************* Module tensorflow_datasets.image.places365_small C:127, 2: Missing method docstring (missing-docstring) ************* Module tensorflow_datasets.image.food101_test C: 1, 0: Missing module docstring (missing-docstring) ************* Module tensorflow_datasets.image.inaturalist C: 80, 2: Missing method docstring (missing-docstring) ************* Module tensorflow_datasets.image.imagenet_resized C: 99, 2: Missing method docstring (missing-docstring) ************* Module tensorflow_datasets.image.caltech_birds_test C: 1, 0: Missing module docstring (missing-docstring) C: 37, 0: Missing class docstring (missing-docstring) ************* Module tensorflow_datasets.image.oxford_iiit_pet C:119, 2: Missing method docstring (missing-docstring) ************* Module tensorflow_datasets.image.plantae_k_test C: 27, 0: Missing class docstring (missing-docstring) ************* Module tensorflow_datasets.image.stanford_dogs_test C: 1, 0: Missing module docstring (missing-docstring) C: 25, 0: Missing class docstring (missing-docstring) ************* Module tensorflow_datasets.image.bigearthnet C:141, 2: Missing method docstring (missing-docstring) ************* Module tensorflow_datasets.image.cityscapes C:172, 2: Missing method docstring (missing-docstring) C:199, 2: Missing method docstring (missing-docstring) C:252, 2: Missing method docstring (missing-docstring) ************* Module tensorflow_datasets.image.imagenet C:144, 2: Missing method docstring (missing-docstring) ************* Module tensorflow_datasets.image.abstract_reasoning_test C: 22, 0: Missing class docstring (missing-docstring) ************* Module tensorflow_datasets.image.binarized_mnist_test W: 38,20: Access to a protected member _TRAIN_DATA_FILENAME of a client class (protected-access) W: 39,25: Access to a protected member _VALID_DATA_FILENAME of a client class (protected-access) W: 40,19: Access to a protected member _TEST_DATA_FILENAME of a client class (protected-access) ************* Module tensorflow_datasets.image.beans C:100, 0: Trailing newlines (trailing-newlines) ************* Module tensorflow_datasets.image.diabetic_retinopathy_detection R:197, 6: Unnecessary "else" after "return" (no-else-return) ************* Module tensorflow_datasets.image.dtd C: 88, 2: Missing method docstring (missing-docstring) ************* Module tensorflow_datasets.image.stanford_dogs C: 96, 2: Missing method docstring (missing-docstring) ************* Module tensorflow_datasets.image.deep_weeds_test C: 1, 0: Missing module docstring (missing-docstring) ------------------------------------------------------------------ Your code has been rated at 9.83/10 (previous run: 9.83/10, +0.00) ```

Expected Behaviour Remove all pylint errors. Sometimes it requires - # pylint: disable=some-error-message.

CC : @Conchylicultor

Eshan-Agarwal commented 4 years ago

@ChanchalKumarMaji Yes I also observed it many files have wrong pylint. So can we correct it and sending PR's ?

Conchylicultor commented 4 years ago

Thank you for reporting. Please don't hesitate to fix those if you have time.

Eshan-Agarwal commented 4 years ago

Okay I think we have to send multiple PR's for this, So I am sending PR for tensorflow_datasets/image soon.

ChanchalKumarMaji commented 4 years ago

Okay I think we have to send multiple PR's for this, So I am sending PR for tensorflow_datasets/image soon.

Sure, Thanks! :smiley: .

ManishAradwad commented 4 years ago

Thanks for reporting this @ChanchalKumarMaji, I'll start working on tensorflow_datasets/audio.

ManishAradwad commented 4 years ago

I've completed tensorflow_datasets/audio in the above PR. Plz review it. Meanwhile, I'll start working on tensorflow_datasets/object_detection. Thanks.

Eshan-Agarwal commented 4 years ago

@Conchylicultor please have a look, and let me know if it requires any correction.