Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #912

Merged
merged 3 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ repos:
- id: pyupgrade
args: [--py39-plus]
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.1.1
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
rev: v0.2.0
hooks:
- id: ruff
args:
- --quiet
- --fix
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.15
rev: v0.16
hooks:
- id: validate-pyproject
# ----- Jupyter Notebooks -----
Expand Down
1 change: 1 addition & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""PyTest configuration."""

import pytest

collect_ignore_glob = [
Expand Down
1 change: 1 addition & 0 deletions devtools/scripts/clean_notebooks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Clean up jupyter notebooks in main directory."""

from __future__ import annotations

import json
Expand Down
1 change: 1 addition & 0 deletions devtools/scripts/update_manifest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Update the manifest file with schema files found in this directory."""

from pathlib import Path

import yaml
Expand Down
1 change: 1 addition & 0 deletions doc/src/tutorials/util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Common util functions used in weldx tutorials."""

from pathlib import Path

tutorials_dir = Path(__file__).parent.absolute()
Expand Down
1 change: 1 addition & 0 deletions weldx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
asdf.validators

"""

# isort:skip_file
import warnings

Expand Down
1 change: 1 addition & 0 deletions weldx/asdf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This submodule contains ASDF related weldx extensions and schemas."""

# isort:skip_file

from weldx import tags # implement tags before the asdf extensions here just to be safe
Expand Down
1 change: 1 addition & 0 deletions weldx/asdf/cli/welding_schema.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""single_pass_weld schema."""

from __future__ import annotations

import sys
Expand Down
1 change: 1 addition & 0 deletions weldx/asdf/extension.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""ASDF-extensions for weldx types."""

from __future__ import annotations

from asdf.extension import ManifestExtension
Expand Down
4 changes: 2 additions & 2 deletions weldx/asdf/file.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""`WeldxFile` wraps creation and updating of ASDF files and underlying files."""

from __future__ import annotations

import copy
Expand Down Expand Up @@ -211,8 +212,7 @@ def __init__(
write_kwargs: Mapping = None,
tree: Mapping = None,
sync: bool = True,
custom_schema: None
| (
custom_schema: None | (
types_path_like,
tuple[None, types_path_like],
) = None,
Expand Down
1 change: 1 addition & 0 deletions weldx/asdf/util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities for asdf files."""

from __future__ import annotations

from collections.abc import Callable, Hashable, Mapping, MutableMapping, Set
Expand Down
1 change: 1 addition & 0 deletions weldx/asdf/validators.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""ASDF-validators for weldx types."""

from __future__ import annotations

import re
Expand Down
1 change: 1 addition & 0 deletions weldx/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Classes and functions to configure the WelDX package."""

from __future__ import annotations

from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions weldx/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Define constants for global library use."""

from pathlib import Path as _Path

import pint
Expand Down
1 change: 1 addition & 0 deletions weldx/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Collection of common classes and functions."""

# isort:skip_file
from weldx.core.math_expression import MathematicalExpression
from weldx.core.generic_series import GenericSeries
Expand Down
1 change: 1 addition & 0 deletions weldx/core/generic_series.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains GenericSeries class."""

from __future__ import annotations

from collections.abc import Callable, Mapping
Expand Down
1 change: 1 addition & 0 deletions weldx/core/math_expression.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains the MathematicalExpression class."""

from __future__ import annotations

from typing import Any, Union
Expand Down
1 change: 1 addition & 0 deletions weldx/core/spatial_series.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains the SpatialSeries class."""

from __future__ import annotations

import pint
Expand Down
1 change: 1 addition & 0 deletions weldx/core/time_series.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains TimeSeries class."""

from __future__ import annotations

from typing import TYPE_CHECKING, Any
Expand Down
1 change: 1 addition & 0 deletions weldx/geometry.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Provides classes to define lines and surfaces."""

from __future__ import annotations

import copy
Expand Down
1 change: 1 addition & 0 deletions weldx/tags/base_types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module providing ASDF implementations for basic python types."""

from uuid import UUID

from asdf.asdf import SerializationContext
Expand Down
1 change: 1 addition & 0 deletions weldx/tags/core/data_array.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Serialization for xarray.DataArray."""

from __future__ import annotations

import pint
Expand Down
1 change: 1 addition & 0 deletions weldx/tags/core/file.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains classes for the asdf serialization of an external file."""

from copy import deepcopy

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions weldx/tags/core/media_file.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains classes for the asdf serialization of media files."""

import pathlib

from weldx.asdf.types import WeldxConverter
Expand Down
1 change: 1 addition & 0 deletions weldx/tags/core/time_series.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains the serialization class for the weldx.core.TimeSeries."""

from __future__ import annotations

import pint
Expand Down
1 change: 1 addition & 0 deletions weldx/tests/asdf_tests/test_asdf_aws_schema.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test ASDF serialization of AWS schema definitions."""

import pytest

from weldx.asdf.util import write_read_buffer_context
Expand Down
1 change: 1 addition & 0 deletions weldx/tests/asdf_tests/test_asdf_base_types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests asdf implementations of python base types."""

import uuid

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions weldx/tests/asdf_tests/test_asdf_core.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests asdf implementations of core module."""

from pathlib import Path
from tempfile import TemporaryDirectory

Expand Down
1 change: 1 addition & 0 deletions weldx/tests/asdf_tests/test_asdf_graph.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test graph serializations."""

import unittest
from uuid import uuid4

Expand Down
1 change: 1 addition & 0 deletions weldx/tests/asdf_tests/test_asdf_groove.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test all ASDF groove implementations."""

import pytest
from decorator import contextmanager

Expand Down
1 change: 1 addition & 0 deletions weldx/tests/asdf_tests/test_asdf_time.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test time schema implementation."""

import numpy as np
import pandas as pd
import pytest
Expand Down
1 change: 1 addition & 0 deletions weldx/tests/asdf_tests/test_asdf_util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""tests for asdf utility functions."""

from __future__ import annotations

import io
Expand Down
1 change: 1 addition & 0 deletions weldx/tests/asdf_tests/test_asdf_validators.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test custom weldx ASDF validator functions."""

import numpy as np
import pandas as pd
import pytest
Expand Down
1 change: 1 addition & 0 deletions weldx/tests/asdf_tests/test_media_file.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for MediaFile."""

import numpy as np
import pytest
import xarray as xr
Expand Down
1 change: 1 addition & 0 deletions weldx/tests/asdf_tests/test_weldx_file.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the WeldxFile class."""

import itertools
import os
import pathlib
Expand Down
1 change: 1 addition & 0 deletions weldx/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""pytest configuration."""

import pytest

from weldx.asdf.cli.welding_schema import single_pass_weld_example
Expand Down
1 change: 1 addition & 0 deletions weldx/tests/test_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test the `config` module."""

from pathlib import Path

import asdf
Expand Down
1 change: 1 addition & 0 deletions weldx/tests/test_core.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests of the core package."""

import warnings

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions weldx/tests/test_geometry.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests the geometry package."""

from __future__ import annotations

import copy
Expand Down
1 change: 1 addition & 0 deletions weldx/tests/test_measurement.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test the measurement package."""

from __future__ import annotations

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions weldx/tests/test_time.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test the `Time` class."""

from __future__ import annotations

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions weldx/tests/test_utility.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test the internal utility functions."""

from __future__ import annotations

import copy
Expand Down
1 change: 1 addition & 0 deletions weldx/tests/test_visualization.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Perform some checks regarding the import redirection if weldx_widgets is missing."""

from unittest.mock import patch

import pytest
Expand Down
1 change: 1 addition & 0 deletions weldx/tests/test_welding_util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test welding util functions."""

import pint
import pytest

Expand Down
1 change: 1 addition & 0 deletions weldx/tests/transformations/test_cs_manager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test the `CoordinateSystemManager` class."""

from __future__ import annotations

from copy import deepcopy
Expand Down
1 change: 1 addition & 0 deletions weldx/tests/transformations/test_local_cs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test the `LocalCoordinateSystem` class."""

from __future__ import annotations

import warnings
Expand Down
1 change: 1 addition & 0 deletions weldx/time.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains classes and functions related to time."""

from __future__ import annotations

from abc import ABC, abstractmethod
Expand Down
1 change: 1 addition & 0 deletions weldx/transformations/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains methods and classes for coordinate transformations."""

from .cs_manager import CoordinateSystemManager
from .local_cs import LocalCoordinateSystem
from .rotation import WXRotation
Expand Down
1 change: 1 addition & 0 deletions weldx/transformations/cs_manager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains methods and classes for coordinate transformations."""

from __future__ import annotations

import itertools
Expand Down
1 change: 1 addition & 0 deletions weldx/transformations/rotation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains tools to handle rotations."""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions weldx/transformations/types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""shared type definitions."""

from typing import Union

import numpy.typing as npt
Expand Down
1 change: 1 addition & 0 deletions weldx/types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Common type definitions."""

import pathlib
from io import IOBase
from typing import Protocol, Union, runtime_checkable
Expand Down
1 change: 1 addition & 0 deletions weldx/util/external_file.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""External file utilities."""

import mimetypes
import socket
from dataclasses import dataclass
Expand Down
1 change: 1 addition & 0 deletions weldx/util/media_file.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Media file."""

from __future__ import annotations

from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions weldx/util/util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains general (mostly internal) utility functions."""

from __future__ import annotations

import functools
Expand Down
8 changes: 5 additions & 3 deletions weldx/util/xarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,11 @@ def _coordinates_from_quantities(
) -> dict[str, tuple[str, np.ndarray, dict[str, pint.Unit]]]:
"""Create a dict with unit information that can be passed as coords for xarray."""
return {
k: (k, v.m, {UNITS_KEY: v.u}) # type: ignore[dict-item]
if isinstance(v, pint.Quantity)
else v
k: (
(k, v.m, {UNITS_KEY: v.u}) # type: ignore[dict-item]
if isinstance(v, pint.Quantity)
else v
)
for k, v in q_dict.items()
}

Expand Down
14 changes: 4 additions & 10 deletions weldx/visualization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,11 @@ def __init__(self, *args, **kwargs):
CoordinateSystemManagerVisualizerK3D = _Hint
SpatialDataVisualizer = _Hint

axes_equal = (
draw_coordinate_system_matplotlib
) = (
new_3d_figure_and_axes
) = (
axes_equal = draw_coordinate_system_matplotlib = new_3d_figure_and_axes = (
plot_coordinate_system_manager_matplotlib
) = (
plot_coordinate_systems
) = (
plot_local_coordinate_system_matplotlib
) = plot_spatial_data_matplotlib = _warn
) = plot_coordinate_systems = plot_local_coordinate_system_matplotlib = (
plot_spatial_data_matplotlib
) = _warn
else:
# something else is missing, pass the exception.
raise
Expand Down
Loading
Loading