Skip to content

Commit

Permalink
Updated for linting.
Browse files Browse the repository at this point in the history
  • Loading branch information
nandantumu committed Aug 22, 2023
1 parent 3bfc1d9 commit cac50b9
Show file tree
Hide file tree
Showing 27 changed files with 287 additions and 193 deletions.
2 changes: 2 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ flake8 = "*"
black = "*"
ipykernel = "*"
pytest = "*"
isort = "*"
autoflake = "*"

[requires]
python_version = "3.10"
Expand Down
72 changes: 48 additions & 24 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 31 additions & 38 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,88 +1,81 @@
import os
import sys

import sphinx_rtd_theme

source_suffix = '.rst'
source_encoding = 'utf-8-sig'
source_suffix = ".rst"
source_encoding = "utf-8-sig"

# -- Language ----------------------------------------------------------------
env_tags = os.getenv('SPHINX_TAGS')
env_tags = os.getenv("SPHINX_TAGS")
if env_tags != None:
for tag in env_tags.split(','):
print('Adding Sphinx tag: %s' % tag.strip())
for tag in env_tags.split(","):
print("Adding Sphinx tag: %s" % tag.strip())
tags.add(tag.strip())

language = os.getenv('READTHEDOCS_LANGUAGE', 'en')
is_i18n = tags.has('i18n')
language = os.getenv("READTHEDOCS_LANGUAGE", "en")
is_i18n = tags.has("i18n")

# -- Theme -------------------------------------------------------------------
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
html_theme = 'sphinx_rtd_theme'
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
if on_rtd:
using_rtd_theme = True
html_theme_options = {
# 'typekit_id': 'hiw1hhg',
# 'analytics_id': '',
# 'sticky_navigation': True # Set to False to disable the sticky nav while scrolling.
'logo_only': False, # if we have a html_logo below, this shows /only/ the logo with no title text
'collapse_navigation': False, # Collapse navigation (False makes it tree-like)
'prev_next_buttons_location': 'bottom',
"logo_only": False, # if we have a html_logo below, this shows /only/ the logo with no title text
"collapse_navigation": False, # Collapse navigation (False makes it tree-like)
"prev_next_buttons_location": "bottom",
# 'display_version': True, # Display the docs version
# 'navigation_depth': 4, # Depth of the headers shown in the navigation bar
}
html_context = {
"display_github": not is_i18n, # Integrate GitHub
"github_user": "f1tenth", # Username
"github_repo": "f1tenth_gym", # Repo name
"github_version": "exp_py", # Version
"conf_py_path": "/docs/", # Path in the checkout to the docs root
"display_github": not is_i18n, # Integrate GitHub
"github_user": "f1tenth", # Username
"github_repo": "f1tenth_gym", # Repo name
"github_version": "exp_py", # Version
"conf_py_path": "/docs/", # Path in the checkout to the docs root
}

html_favicon = 'assets/f1_stickers_02.png'
html_favicon = "assets/f1_stickers_02.png"

html_css_files = [
'css/custom.css'
]
html_css_files = ["css/custom.css"]

html_js_files = [
'css/custom.js'
]
html_logo = 'assets/f1tenth_gym.svg'
html_js_files = ["css/custom.js"]
html_logo = "assets/f1tenth_gym.svg"

# -- Project information -----------------------------------------------------

project = 'f1tenth_gym'
project = "f1tenth_gym"
copyright = "2021, Hongrui Zheng, Matthew O'Kelly, Aman Sinha"
author = 'Hongrui Zheng'
author = "Hongrui Zheng"

# The full version, including alpha/beta/rc tags
release = 'latest'
version = 'latest'
release = "latest"
version = "latest"


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [ "breathe", "sphinx_rtd_theme", "sphinx.ext.autosectionlabel"
]
extensions = ["breathe", "sphinx_rtd_theme", "sphinx.ext.autosectionlabel"]

# Breathe configuration
breathe_projects = {
"f1tenth_gym":"./xml"
}
breathe_projects = {"f1tenth_gym": "./xml"}

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]
4 changes: 2 additions & 2 deletions examples/random_trackgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
- shapely
- opencv-python
"""
import math
import pathlib

import cv2
import math
import matplotlib.pyplot as plt
import numpy as np
import shapely.geometry as shp
import matplotlib.pyplot as plt


def main(args):
Expand Down
5 changes: 1 addition & 4 deletions examples/waypoint_follow.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import time
import yaml

import gymnasium as gym
import numpy as np
from argparse import Namespace

from numba import njit

from pyglet.gl import GL_POINTS

"""
Expand Down
6 changes: 0 additions & 6 deletions gym/f110_gym/envs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
from f110_gym.envs.integrator import *
from f110_gym.envs.dynamic_models import *
from f110_gym.envs.f110_env import F110Env
from f110_gym.envs.laser_models import *
from f110_gym.envs.base_classes import *
from f110_gym.envs.collision_models import *
2 changes: 1 addition & 1 deletion gym/f110_gym/envs/action.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from abc import abstractmethod
from enum import Enum
from typing import Any, Tuple, Dict
from typing import Any, Dict, Tuple

import gymnasium as gym
import numpy as np
Expand Down
3 changes: 1 addition & 2 deletions gym/f110_gym/envs/base_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@
Author: Hongrui Zheng
"""
import numpy as np

from f110_gym.envs import DynamicModel
from f110_gym.envs.action import CarAction
from f110_gym.envs.collision_models import collision_multiple, get_vertices
from f110_gym.envs.integrator import EulerIntegrator, IntegratorType
from f110_gym.envs.laser_models import ScanSimulator2D, check_ttc_jit, ray_cast
from f110_gym.envs.collision_models import get_vertices, collision_multiple


class RaceCar(object):
Expand Down
3 changes: 2 additions & 1 deletion gym/f110_gym/envs/cubic_spline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
Code from Cubic spline planner
Author: Atsushi Sakai(@Atsushi_twi)
"""
import bisect
import math

import numpy as np
import bisect


class CubicSpline1D:
Expand Down
Loading

0 comments on commit cac50b9

Please sign in to comment.