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

v0.6.5 #865

Closed
wants to merge 9 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- python=3.10
- setuptools_scm
- pip
# jupyterlab setup
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
fetch-depth: 0 # Fetch all history for all tags and branches
- uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: '3.10'

- name: Cache pip
uses: actions/cache@v3
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
with:
environment-file: ./environment.yml
environment-name: weldx
cache-env: true
cache-env: false
extra-specs: |
python=${{ matrix.py }}
wheel
Expand All @@ -61,17 +61,17 @@ jobs:
run: micromamba activate weldx

- name: install cookiecutter
if: matrix.py == '3.9'
if: matrix.py == '3.10'
run: |
pip install cookiecutter

- name: create installable quality standard from repo
if: matrix.py == '3.9'
if: matrix.py == '3.10'
run: |
cookiecutter --no-input https://github.com/BAMWeldx/quality-standard-template

- name: install quality standard
if: matrix.py == '3.9'
if: matrix.py == '3.10'
run: |
pip install -e ./quality_standard_demo

Expand All @@ -87,32 +87,32 @@ jobs:
path: pytest.xml

- name: run pytest on notebooks (append coverage)
if: matrix.py == '3.9'
if: matrix.py == '3.10'
run: |
pytest -n 2 --dist loadfile --nbval --current-env --cov-append ./doc/src/tutorials/

- name: test with WeldxFile
if: matrix.py == '3.9'
if: matrix.py == '3.10'
run: |
pytest -n 2 --weldx-file-rw-buffer --weldx-file-rw-buffer-disp-header --cov-append ./weldx/tests/asdf_tests

- name: test quality standard
if: matrix.py == '3.9'
if: matrix.py == '3.10'
run: |
pytest --cov-append ./weldx/tests/asdf_tests/quality_standards_check.py


- name: test installable quality standard from template repository
if: matrix.py == '3.9'
if: matrix.py == '3.10'
run: |
pytest --cov-append ./weldx/tests/asdf_tests/installable_quality_standard_check.py

- name: coverage xml (combination is performed by pytest-cov)
if: matrix.py == '3.9'
if: matrix.py == '3.10'
run: coverage xml

- name: codecov.io
if: matrix.py == '3.9'
if: matrix.py == '3.10'
uses: codecov/[email protected]

compat:
Expand All @@ -126,7 +126,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest]
py: ['3.9']
py: ['3.10']
steps:
- uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
environment-name: weldx
cache-env: true
extra-specs: |
python=3.9
python=3.10
mypy
- name: activate env
run: micromamba activate weldx
Expand Down
2 changes: 1 addition & 1 deletion devtools/conda.recipe/build_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- python=3.10
- setuptools
- setuptools_scm
- conda-verify
Expand Down
2 changes: 1 addition & 1 deletion devtools/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- defaults
- conda-forge
dependencies:
- python=3.9
- python=3.10
- setuptools_scm
- numpy>=1.18
- pandas>=1.0
Expand Down
2 changes: 1 addition & 1 deletion doc/rtd_environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- python=3.10
- setuptools_scm
# weldx base dependencies
- numpy>=1.18
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ exclude_lines = [
]

[tool.mypy]
python_version = "3.9"
python_version = "3.10"
files = "weldx"
ignore_missing_imports = true # TODO: this is bad!
strict_optional = false
Expand Down
6 changes: 3 additions & 3 deletions weldx/asdf/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import io
import pathlib
import warnings
from collections.abc import Iterable, Mapping, MutableMapping, Set, ValuesView
from collections.abc import Hashable, Iterable, Mapping, MutableMapping, Set, ValuesView
from contextlib import contextmanager
from io import BytesIO, IOBase
from typing import IO, Any, Dict, Hashable, Optional, Union, get_args
from typing import IO, Any, Optional, Union, get_args

import asdf
import numpy as np
Expand Down Expand Up @@ -487,7 +487,7 @@ def software_history_entry(self, value: dict):
"version": version,
}
else:
if not isinstance(value, Dict):
if not isinstance(value, dict):
raise ValueError("expected a dictionary type")
try:
test = AsdfFile(tree=dict(software=Software(value)))
Expand Down
6 changes: 3 additions & 3 deletions weldx/asdf/util.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Utilities for asdf files."""
from __future__ import annotations

from collections.abc import Callable, Mapping, Set
from collections.abc import Callable, Hashable, Mapping, MutableMapping, Set
from io import BytesIO, TextIOBase
from pathlib import Path
from typing import Any, Hashable, MutableMapping, Union
from typing import Any, Union
from warnings import warn

import asdf
Expand Down Expand Up @@ -753,7 +753,7 @@ def mark_required(path, key, value):
def drop_meta(path, key, value):
"""Drop common metadata fields from the output."""
default = {"examples", "description", "tag", "$ref", "type"}
return key not in default | set(drop)
return key not in (default, set(drop))

def drop_properties(path, key, value):
"""Drop the 'properties' field."""
Expand Down
4 changes: 2 additions & 2 deletions weldx/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from __future__ import annotations

from pathlib import Path
from typing import List, Union
from typing import Union

import asdf
import pkg_resources
Expand Down Expand Up @@ -177,7 +177,7 @@ def load_installed_standards():
"""Load all standards that are installed to the active virtual environment."""
for entry_point in pkg_resources.iter_entry_points("weldx.standard"):
standards = entry_point.load()()
if not isinstance(standards, List):
if not isinstance(standards, list):
standards = [standards]
for standard in standards:
if not isinstance(standard, QualityStandard):
Expand Down
2 changes: 1 addition & 1 deletion weldx/core/generic_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ def _check_constraints_discrete(cls, data_array: xr.DataArray):
# check coordinate constraints
_units = cls._required_dimension_units
_vals = cls._required_dimension_coordinates
_keys = (set(_units.keys()) & set(data_array.dims)) | set(_vals.keys())
_keys = ((set(_units.keys()) & set(data_array.dims)), set(_vals.keys()))

ref: dict[str, dict] = {k: {} for k in _keys}
for k in ref.keys():
Expand Down
4 changes: 2 additions & 2 deletions weldx/core/math_expression.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Contains the MathematicalExpression class."""
from __future__ import annotations

from typing import Any, Tuple, Union
from typing import Any, Union

import pint
import sympy
Expand All @@ -10,7 +10,7 @@
from weldx import Q_

ExpressionParameterTypes = Union[
pint.Quantity, str, Tuple[pint.Quantity, str], xr.DataArray
pint.Quantity, str, tuple[pint.Quantity, str], xr.DataArray
]

__all__ = ["MathematicalExpression", "ExpressionParameterTypes"]
Expand Down
4 changes: 2 additions & 2 deletions weldx/tags/core/common_types.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from __future__ import annotations

import dataclasses
from collections.abc import Mapping
from collections.abc import Hashable, Mapping
from dataclasses import dataclass
from typing import Any, Hashable
from typing import Any

import numpy as np
import pint
Expand Down
8 changes: 4 additions & 4 deletions weldx/tests/test_time.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Test the `Time` class."""
from __future__ import annotations

from typing import List, Union
from typing import Union

import numpy as np
import pandas as pd
Expand All @@ -21,13 +21,13 @@
def _initialize_delta_type(cls_type, values, unit):
"""Initialize the passed time type."""
if cls_type is np.timedelta64:
if isinstance(values, List):
if isinstance(values, list):
return np.array(values, dtype=f"timedelta64[{unit}]")
return np.timedelta64(values, unit)
if cls_type is Time:
return Time(Q_(values, unit))
if cls_type is str:
if not isinstance(values, List):
if not isinstance(values, list):
return f"{values}{unit}"
return [f"{v}{unit}" for v in values]
return cls_type(values, unit)
Expand All @@ -36,7 +36,7 @@ def _initialize_delta_type(cls_type, values, unit):
def _initialize_datetime_type(cls_type, values):
"""Initialize the passed datetime type."""
if cls_type is np.datetime64:
if isinstance(values, List):
if isinstance(values, list):
return np.array(values, dtype="datetime64")
return np.datetime64(values)
if cls_type is str:
Expand Down
6 changes: 3 additions & 3 deletions weldx/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from abc import ABC, abstractmethod
from collections.abc import Sequence
from functools import reduce
from typing import List, Union
from typing import Union

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -784,14 +784,14 @@ def _union_instance(self, times: Sequence[types_time_like]) -> Time:
# list of types that are supported to be stored in Time._time
_data_base_types = (pd.Timedelta, pd.Timestamp, pd.DatetimeIndex, pd.TimedeltaIndex)

types_datetime_like = Union[DatetimeIndex, np.datetime64, List[str], Time]
types_datetime_like = Union[DatetimeIndex, np.datetime64, list[str], Time]
"""types that define ascending arrays of time stamps."""

types_timestamp_like = Union[Timestamp, str, Time]
"""types that define timestamps."""

types_timedelta_like = Union[
TimedeltaIndex, pint.Quantity, np.timedelta64, List[str], Time
TimedeltaIndex, pint.Quantity, np.timedelta64, list[str], Time
]
"""types that define ascending time delta arrays."""

Expand Down
4 changes: 2 additions & 2 deletions weldx/util/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import functools
import sys
import warnings
from collections.abc import Callable, Sequence, Set
from collections.abc import Callable, Collection, Hashable, Mapping, Sequence, Set
from functools import wraps
from importlib.util import find_spec
from inspect import getmembers, isfunction
from typing import ClassVar, Collection, Hashable, Mapping, Union
from typing import ClassVar, Union

import numpy as np
import pandas as pd
Expand Down