Skip to content

Commit

Permalink
style: fix formatting and linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
amitkparekh committed Aug 26, 2024
1 parent bce3ddf commit 862b7d4
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 11 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ src = ["src"]
docstring-code-format = true

[tool.ruff.lint]
ignore-init-module-imports = true
# Enable every possible rule
select = ["ALL"]
ignore = [
Expand Down
4 changes: 2 additions & 2 deletions src/cogelot/app/overfit_model_explore.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ def load_datamodule(
return datamodule


def simplify_target_actions(actions: Any) -> dict[str, dict[str, torch.Tensor]]: # noqa: ARG001
def simplify_target_actions(actions: Any) -> dict[str, dict[str, torch.Tensor]]:

Check failure on line 53 in src/cogelot/app/overfit_model_explore.py

View workflow job for this annotation

GitHub Actions / based_pyright

"actions" is not accessed (reportUnusedParameter)
"""Simplify the target actions."""
raise NotImplementedError


def simplify_predicted_actions(actions: Any) -> dict[str, dict[str, torch.Tensor]]: # noqa: ARG001
def simplify_predicted_actions(actions: Any) -> dict[str, dict[str, torch.Tensor]]:

Check failure on line 58 in src/cogelot/app/overfit_model_explore.py

View workflow job for this annotation

GitHub Actions / based_pyright

"actions" is not accessed (reportUnusedParameter)
"""Simplify the predicted actions."""
raise NotImplementedError

Expand Down
4 changes: 2 additions & 2 deletions src/cogelot/common/system_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ def verify_ffmpeg_is_available() -> None:
"""Verify ffmpeg is available."""
is_available = False
with suppress(FileNotFoundError):
outcome = subprocess.run(
["ffmpeg", "-version"], # noqa: S603 S607
outcome = subprocess.run( # noqa: S603
["ffmpeg", "-version"], # noqa: S607
capture_output=True,
check=False,
)
Expand Down
2 changes: 1 addition & 1 deletion src/cogelot/data/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def load_instance_from_path(
"""Load the instance from the pickled path."""
try:
return instance.model_validate(load_from_path_fn(path)).model_dump()
except Exception as err:
except Exception as err: # noqa: BLE001
logger.exception(f"Something went wrong with {path}")
raise err from None

Expand Down
3 changes: 1 addition & 2 deletions src/vima_bench/tasks/utils/misc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import torch
from transforms3d import euler


# -----------------------------------------------------------------------------
# HEIGHTMAP UTILS
# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -335,7 +334,7 @@ def preprocess(img, dist="transporter"):
depth_std = transporter_depth_std

# convert to pytorch tensor (if required)
if type(img) == torch.Tensor:
if type(img) is torch.Tensor:

def cast_shape(stat, img):
tensor = torch.from_numpy(np.array(stat)).to(device=img.device, dtype=img.dtype)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def test_experiment_can_instantiate_from_config(hydra_config: DictConfig) -> Non
assert instantiated_module is not None


@pytest.mark.trylast()
@pytest.mark.trylast
def test_experiment_can_fast_dev_run(
hydra_config: DictConfig, vima_dataloader: DataLoader[list[PreprocessedInstance]]
) -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@


@pytest.mark.env("cuda")
@pytest.mark.tryfirst()
@pytest.mark.tryfirst
def test_cuda_is_available() -> None:
assert torch.cuda.is_available() is True
2 changes: 1 addition & 1 deletion tests/test_instance_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_reword_transform_works(vima_instance: VIMAInstance) -> None:
assert new_instance.prompt != vima_instance.prompt


@pytest.mark.skip()
@pytest.mark.skip
def test_count_all_reword_transforms(vima_instance: VIMAInstance) -> None:
reword_transform = RewordPromptTransform()
all_possible_templates = reword_transform.generate_all_possible_prompts(vima_instance)
Expand Down

0 comments on commit 862b7d4

Please sign in to comment.