Skip to content

Commit 469caf6

Browse files
authored
revive (#191)
* update * remove loguru * format * fix ci * update * update * fix ci * update * update * fixes * update docs deps * fixes * fix versions
1 parent 6d8acd5 commit 469caf6

File tree

19 files changed

+59
-45
lines changed

19 files changed

+59
-45
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ jobs:
1313
strategy:
1414
matrix:
1515
os: [ ubuntu-latest, macos-latest ]
16-
python-version: [3.7, 3.8, 3.9]
16+
python-version: ["3.9", "3.10"]
1717
include:
1818
- os: ubuntu-latest
1919
path: ~/.cache/pip
2020
- os: macos-latest
2121
path: ~/Library/Caches/pip
2222
env:
2323
OS: ${{ matrix.os }}
24-
PYTHON: '3.8'
24+
PYTHON: '3.10'
2525

2626

2727
steps:

.github/workflows/publish-to-pypi.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ on: push
55
jobs:
66
build-n-publish:
77
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
8-
runs-on: ubuntu-18.04
8+
runs-on: ubuntu-latest
99

1010
steps:
1111
- uses: actions/checkout@master
12-
- name: Set up Python 3.9
12+
- name: Set up Python 3.10
1313
uses: actions/setup-python@v1
1414
with:
15-
python-version: 3.9
15+
python-version: "3.10"
1616

1717
- name: Install pypa/build
1818
run: >-

.pre-commit-config.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# See https://pre-commit.com for more information
22
# See https://pre-commit.com/hooks.html for more hooks
33
default_language_version:
4-
python: python3.8
4+
python: python3.10
55

66
ci:
77
autofix_prs: true
@@ -24,7 +24,7 @@ repos:
2424
name: "Black: The uncompromising Python code formatter"
2525

2626
- repo: https://github.com/PyCQA/isort
27-
rev: 5.11.4
27+
rev: 5.12.0
2828
hooks:
2929
- id: isort
3030
name: "Sort Imports"
@@ -65,10 +65,11 @@ repos:
6565
language: system
6666
pass_filenames: false
6767

68+
6869
- repo: https://github.com/kynan/nbstripout
6970
rev: 0.6.1
7071
hooks:
7172
- id: nbstripout
7273
args:
7374
- --max-size=500k
74-
- --strip-empty-cells
75+
- --drop-empty-cells

docs/requirements.txt

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
git+https://github.com/gradsflow/gradsflow@main
2-
mkdocs>=1.2.2
3-
mkdocs-material>=7.2.4
4-
mkdocs-material-extensions==1.0.1
5-
mkdocs-git-revision-date-localized-plugin==0.9.2
6-
mkdocs-macros-plugin==0.6.0
7-
mkdocs-autorefs>=0.2.1
8-
mkdocstrings>=0.15.2
1+
# git+https://github.com/gradsflow/gradsflow@main
2+
mkdocs==1.4.2
3+
mkdocstrings==0.20.0
4+
mkdocs-material==8.5.11
5+
mkdocstrings-python==0.8.3
6+
mkdocs-material-extensions==1.1.1
7+
mkdocs-git-revision-date-localized-plugin==1.1.0
8+
mkdocs-macros-plugin==0.7.0
9+
mkdocs-autorefs==0.4.1
10+
mkdocs-jupyter==0.22.0
911
tags-macros-plugin @ git+https://github.com/jldiaz/mkdocs-plugin-tags.git@d26e2f124e4f3471639d426459e281080988fe7a
10-
mkdocs-jupyter>=0.18.0
11-
mkdocs-meta-descriptions-plugin
12+
mkdocs-meta-descriptions-plugin==2.2.0
1213
jupyter_contrib_nbextensions
1314
comet_ml
1415
lightning-flash[image,text]>=0.5.1
1516
wandb
16-
notebook>=6.1.5 # not directly required, pinned by Snyk to avoid a vulnerability
17-
pygments>=2.7.4 # not directly required, pinned by Snyk to avoid a vulnerability
1817
tensorboard

gradsflow/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17+
import logging
1718
from os import environ as _environ
1819

19-
_environ["LOGURU_LEVEL"] = _environ.get("LOGURU_LEVEL") or _environ.get("LOG_LEVEL", "WARNING")
20-
2120
from gradsflow.autotasks.autoclassification.image import AutoImageClassifier
2221
from gradsflow.autotasks.autoclassification.text import AutoTextClassifier
2322
from gradsflow.autotasks.autosummarization import AutoSummarization
@@ -29,3 +28,4 @@
2928
from gradsflow.tuner.tuner import Tuner
3029

3130
__version__ = "0.0.8.post1"
31+
logging.basicConfig(level=_environ.get("LOG_LEVEL", "WARNING"))

gradsflow/autotasks/autoclassification/text/text.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@
1313
# limitations under the License.
1414

1515

16+
import logging
17+
1618
import torch
17-
from loguru import logger
1819

1920
from gradsflow.autotasks.engine.autoclassifier import AutoClassifier
2021

22+
logger = logging.getLogger(__name__)
23+
2124

2225
# noinspection PyTypeChecker
2326
class AutoTextClassifier(AutoClassifier):

gradsflow/autotasks/engine/automodel.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ def __init__(
7070
prune: bool = True,
7171
backend: Optional[str] = None,
7272
):
73-
7473
self.analysis = None
7574
self.prune = prune
7675
self.n_trials = n_trials
@@ -174,7 +173,6 @@ def hp_tune(
174173
return analysis
175174

176175
def _get_best_model(self, analysis):
177-
178176
best_model = self.build_model(self.analysis.best_config)
179177
best_ckpt_path = analysis.best_checkpoint
180178
best_ckpt_path = best_ckpt_path + "/filename"

gradsflow/autotasks/engine/backend.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ def _gf_objective(self, search_space: Dict, trainer_config: Dict, **_):
8181
def _lightning_objective(
8282
self, config: Dict, trainer_config: Dict, gpu: Optional[float] = 0, finetune: bool = False
8383
):
84-
8584
val_check_interval = 1.0
8685
if self.max_steps:
8786
val_check_interval = max(self.max_steps - 1, 1.0)

gradsflow/callbacks/gpu.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from loguru import logger
15+
16+
import logging
1617

1718
from gradsflow.callbacks.base import Callback
1819
from gradsflow.utility.imports import requires
1920

21+
logger = logging.getLogger(__name__)
22+
2023

2124
class EmissionTrackerCallback(Callback):
2225
"""

gradsflow/callbacks/logger.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,17 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import logging
1516
import os
1617
from pathlib import Path
1718

1819
import pandas as pd
19-
from loguru import logger
2020

2121
from gradsflow.callbacks.base import Callback
2222
from gradsflow.utility.common import to_item
2323

24+
logger = logging.getLogger(__name__)
25+
2426

2527
class CSVLogger(Callback):
2628
"""

0 commit comments

Comments
 (0)