From 630f618f1b2609543552a424cbe649cb2d65adb5 Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
<66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Tue, 8 Oct 2024 00:21:31 +0530
Subject: [PATCH] [pre-commit.ci] pre-commit suggestions (#197)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* [pre-commit.ci] pre-commit suggestions
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v5.0.0)
- [github.com/psf/black: 23.9.1 → 24.8.0](https://github.com/psf/black/compare/23.9.1...24.8.0)
- [github.com/PyCQA/isort: 5.12.0 → 5.13.2](https://github.com/PyCQA/isort/compare/5.12.0...5.13.2)
- [github.com/codespell-project/codespell: v2.2.6 → v2.3.0](https://github.com/codespell-project/codespell/compare/v2.2.6...v2.3.0)
- [github.com/asottile/pyupgrade: v3.13.0 → v3.17.0](https://github.com/asottile/pyupgrade/compare/v3.13.0...v3.17.0)
- [github.com/PyCQA/bandit: 1.7.5 → 1.7.10](https://github.com/PyCQA/bandit/compare/1.7.5...1.7.10)
- [github.com/kynan/nbstripout: 0.6.1 → 0.7.1](https://github.com/kynan/nbstripout/compare/0.6.1...0.7.1)
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
---
.pre-commit-config.yaml | 14 +++++------
examples/nbs/02-TextClassification.ipynb | 22 ++++++++---------
examples/nbs/04-RayDataset.ipynb | 12 +++++-----
examples/nbs/05-model_fit.ipynb | 10 ++++----
examples/nbs/06-AutoModel_fit.ipynb | 30 ++++++++++++------------
gradsflow/data/common.py | 1 +
gradsflow/data/image.py | 1 +
gradsflow/models/base.py | 9 +++----
8 files changed, 49 insertions(+), 50 deletions(-)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 5d42c6cc..d8cd09ab 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -11,27 +11,27 @@ ci:
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v4.4.0
+ rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- repo: https://github.com/psf/black
- rev: 23.9.1
+ rev: 24.8.0
hooks:
- id: black
name: "Black: The uncompromising Python code formatter"
- repo: https://github.com/PyCQA/isort
- rev: 5.12.0
+ rev: 5.13.2
hooks:
- id: isort
name: "Sort Imports"
args: [ "--profile black" ]
- repo: https://github.com/codespell-project/codespell
- rev: v2.2.6
+ rev: v2.3.0
hooks:
- id: codespell
args:
@@ -41,13 +41,13 @@ repos:
- "*.bib,*.ipynb"
- repo: https://github.com/asottile/pyupgrade
- rev: v3.13.0
+ rev: v3.17.0
hooks:
- id: pyupgrade
args: [ --py36-plus ]
- repo: https://github.com/PyCQA/bandit
- rev: 1.7.5
+ rev: 1.7.10
hooks:
- id: bandit
language_version: python3
@@ -67,7 +67,7 @@ repos:
- repo: https://github.com/kynan/nbstripout
- rev: 0.6.1
+ rev: 0.7.1
hooks:
- id: nbstripout
args:
diff --git a/examples/nbs/02-TextClassification.ipynb b/examples/nbs/02-TextClassification.ipynb
index f80b4fa2..a8f06c1e 100644
--- a/examples/nbs/02-TextClassification.ipynb
+++ b/examples/nbs/02-TextClassification.ipynb
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
- "id": "52697382",
+ "id": "0",
"metadata": {
"id": "52697382"
},
@@ -13,7 +13,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "e130bd40",
+ "id": "1",
"metadata": {
"id": "e130bd40"
},
@@ -28,7 +28,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "592802fe",
+ "id": "2",
"metadata": {
"id": "592802fe"
},
@@ -42,7 +42,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "uTrRNUfn5wg4",
+ "id": "3",
"metadata": {
"id": "uTrRNUfn5wg4"
},
@@ -55,7 +55,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "bf38e2b8",
+ "id": "4",
"metadata": {
"id": "bf38e2b8"
},
@@ -70,7 +70,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "5fc8603f",
+ "id": "5",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
@@ -119,7 +119,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "pXjv4W2hSs20",
+ "id": "6",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
@@ -219,7 +219,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "9f5d0474",
+ "id": "7",
"metadata": {
"id": "9f5d0474",
"pycharm": {
@@ -251,7 +251,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "4a9c19a3",
+ "id": "8",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
@@ -508,7 +508,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "d0b96bd0-3949-4dd5-b6d9-4fa6ac213e30",
+ "id": "9",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
@@ -536,7 +536,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "6a95bc01-4291-49a8-bea7-c76ba64bf42a",
+ "id": "10",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
diff --git a/examples/nbs/04-RayDataset.ipynb b/examples/nbs/04-RayDataset.ipynb
index 4e9714b4..b6564c1f 100644
--- a/examples/nbs/04-RayDataset.ipynb
+++ b/examples/nbs/04-RayDataset.ipynb
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
- "id": "9a226830",
+ "id": "0",
"metadata": {
"pycharm": {
"name": "#%% md\n"
@@ -43,7 +43,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "1fffc779",
+ "id": "1",
"metadata": {
"pycharm": {
"name": "#%%\n"
@@ -59,7 +59,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "b94e30dd",
+ "id": "2",
"metadata": {
"pycharm": {
"name": "#%%\n"
@@ -77,7 +77,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "3822e6bb",
+ "id": "3",
"metadata": {
"pycharm": {
"name": "#%%\n"
@@ -96,7 +96,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "c53a4e2f",
+ "id": "4",
"metadata": {
"pycharm": {
"name": "#%%\n"
@@ -110,7 +110,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "31ac27eb",
+ "id": "5",
"metadata": {
"pycharm": {
"name": "#%%\n"
diff --git a/examples/nbs/05-model_fit.ipynb b/examples/nbs/05-model_fit.ipynb
index ef32702e..465968e6 100644
--- a/examples/nbs/05-model_fit.ipynb
+++ b/examples/nbs/05-model_fit.ipynb
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
- "id": "eb3a591f",
+ "id": "0",
"metadata": {},
"source": [
""
@@ -11,7 +11,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "62f766aa",
+ "id": "1",
"metadata": {},
"outputs": [],
"source": [
@@ -32,7 +32,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "5794bc62",
+ "id": "2",
"metadata": {},
"outputs": [
{
@@ -61,7 +61,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "fa61d539",
+ "id": "3",
"metadata": {},
"outputs": [
{
@@ -90,7 +90,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "c4be173e",
+ "id": "4",
"metadata": {},
"outputs": [
{
diff --git a/examples/nbs/06-AutoModel_fit.ipynb b/examples/nbs/06-AutoModel_fit.ipynb
index 7244c372..8ce77f8b 100644
--- a/examples/nbs/06-AutoModel_fit.ipynb
+++ b/examples/nbs/06-AutoModel_fit.ipynb
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
- "id": "6f5e7c30",
+ "id": "0",
"metadata": {},
"source": [
""
@@ -10,7 +10,7 @@
},
{
"cell_type": "markdown",
- "id": "29409c2e",
+ "id": "1",
"metadata": {},
"source": [
"This example shows how to search hyperparameters for a model with Tuner module."
@@ -19,7 +19,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "babe34df",
+ "id": "2",
"metadata": {},
"outputs": [],
"source": [
@@ -32,7 +32,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "b61db9fd",
+ "id": "3",
"metadata": {},
"outputs": [],
"source": [
@@ -43,7 +43,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "52430b02",
+ "id": "4",
"metadata": {},
"outputs": [],
"source": [
@@ -57,7 +57,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "067473d3",
+ "id": "5",
"metadata": {},
"outputs": [],
"source": [
@@ -75,7 +75,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "c46e0094",
+ "id": "6",
"metadata": {},
"outputs": [],
"source": [
@@ -85,7 +85,7 @@
},
{
"cell_type": "markdown",
- "id": "dd8d5d58",
+ "id": "7",
"metadata": {},
"source": [
"## Registering hyperparameters\n",
@@ -99,7 +99,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "f16828b3",
+ "id": "8",
"metadata": {},
"outputs": [
{
@@ -122,7 +122,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "8b4af23b",
+ "id": "9",
"metadata": {},
"outputs": [],
"source": [
@@ -139,7 +139,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "ef6926ed",
+ "id": "10",
"metadata": {},
"outputs": [
{
@@ -364,7 +364,7 @@
},
{
"cell_type": "markdown",
- "id": "85178f72",
+ "id": "11",
"metadata": {},
"source": [
"### The second way to register hyperparameters is to use Tuner module."
@@ -373,7 +373,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "ad2f4f8f",
+ "id": "12",
"metadata": {},
"outputs": [],
"source": [
@@ -388,7 +388,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "3b1f7c70",
+ "id": "13",
"metadata": {},
"outputs": [],
"source": [
@@ -400,7 +400,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "b3dccb5e",
+ "id": "14",
"metadata": {},
"outputs": [
{
diff --git a/gradsflow/data/common.py b/gradsflow/data/common.py
index 0d281a05..477cc25b 100644
--- a/gradsflow/data/common.py
+++ b/gradsflow/data/common.py
@@ -1,4 +1,5 @@
"""Provide some common functionalities/utilities for Datasets"""
+
# Copyright (c) 2021 GradsFlow. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/gradsflow/data/image.py b/gradsflow/data/image.py
index d19ea694..19df7d49 100644
--- a/gradsflow/data/image.py
+++ b/gradsflow/data/image.py
@@ -1,4 +1,5 @@
"""Data loader for image dataset"""
+
# Copyright (c) 2021 GradsFlow. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/gradsflow/models/base.py b/gradsflow/models/base.py
index 1022f0cd..de988e3c 100644
--- a/gradsflow/models/base.py
+++ b/gradsflow/models/base.py
@@ -92,16 +92,13 @@ def forward(self, x):
return self.learner(x)
# skipcp: PTC-W0049
- def backward(self, loss):
- ...
+ def backward(self, loss): ...
# skipcp: PTC-W0049
- def eval(self):
- ...
+ def eval(self): ...
# skipcp: PTC-W0049
- def train(self):
- ...
+ def train(self): ...
class BaseModel(Base):