Skip to content

Commit

Permalink
switch to ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
martin de la gorce committed May 11, 2024
1 parent 2076cc2 commit 6d27ee4
Show file tree
Hide file tree
Showing 37 changed files with 429 additions and 1,006 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@ jobs:
pip install -r requirements.txt
pip freeze
- name: Black
- name: Ruff format
run: |
pip install black
black --check --diff .
pip install ruff
ruff format --check .
- name: Lint with flake8
- name: Lint with Ruff
run: |
pip install flake8 pep8-naming flake8-bugbear flake8-builtins flake8-docstrings flake8-import-order
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --radon-max-cc 16
pip install ruff
ruff .
- name: Mypy
run: |
Expand Down
11 changes: 3 additions & 8 deletions create_latex_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
# up to date version of that script can found on
# https://github.com/martinResearch/markdownLatex

"""Script to render latex figure for each equation found in readme.md"""

"""Script to render latex figure for each equation found in readme.md."""

import os
import re
Expand All @@ -58,9 +57,7 @@
raise Exception("wrong number of arguments")


def formula_as_file(
formula: str, file: str, negate: bool = False, header: str = ""
) -> None:
def formula_as_file(formula: str, file: str, negate: bool = False, header: str = "") -> None:
laxtex_tmp_file = os.path.join(dirpath, "tmp_equation.tex")
pdf_tmp_file = os.path.join(dirpath, "tmp_equation.pdf")
with open(laxtex_tmp_file, "w") as latexfile:
Expand All @@ -72,9 +69,7 @@ def formula_as_file(
latexfile.write(f" {formula}")
latexfile.write("\n\\end{document} ")
os.system('pdflatex -output-directory="%s" %s' % (dirpath, laxtex_tmp_file))
if file.startswith("https://rawgithub.com") or file.startswith(
"https://raw.githack.com"
):
if file.startswith("https://rawgithub.com") or file.startswith("https://raw.githack.com"):
file = "./" + re.findall(r"""/master/(.*)""", file)[0]
if file.endswith("svg"):
os.system(f"pdf2svg {pdf_tmp_file} {file}")
Expand Down
5 changes: 2 additions & 3 deletions deodr/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# -*- coding: utf-8 -*-
"""deodr
Discontinuity-Edge-Overdraw Differentiable Rendering
"""DEODR (Discontinuity-Edge-Overdraw Differentiable Rendering).
If you use this library please cite
Model-based 3D Hand Pose Estimation from Monocular Video.
M. de la Gorce, N. Paragios and David Fleet. PAMI 2011
Martin de La Gorce. 2019.
"""

__version__ = "0.2.2"

__all__ = [
Expand Down
Loading

0 comments on commit 6d27ee4

Please sign in to comment.