Skip to content

Commit

Permalink
Merge branch 'master' into update_wx_shape_syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
CagtayFabry committed Sep 17, 2021
2 parents c5620c1 + 7065612 commit a0ac4f5
Show file tree
Hide file tree
Showing 168 changed files with 909 additions and 898 deletions.
2 changes: 1 addition & 1 deletion .binder/postBuild
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
jupyter labextension install --no-build @jupyter-widgets/jupyterlab-manager k3d@2.9.7 --debug
jupyter lab build --minimize=False --debug

python setup.py --version
python setup.py --version
2 changes: 1 addition & 1 deletion .deepsource.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ exclude_patterns = [
[[analyzers]]
name = "python"
enabled = true
runtime_version = "3.x.x"
runtime_version = "3.x.x"
4 changes: 2 additions & 2 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- name: run pytest
if: ((matrix.os == 'ubuntu-latest') && (matrix.py == '3.8')) || (github.event.pull_request.draft == false) || (github.ref == 'refs/heads/master')
run: |
pytest -n 2 --runslow --dist=loadfile
pytest -n 2 --runslow
echo "Exited with '$?'"
- name: run pytest on notebooks (append coverage)
Expand All @@ -82,7 +82,7 @@ jobs:
- name: test with WeldxFile
if: (matrix.os == 'ubuntu-latest') && (matrix.py == '3.8')
run: |
pytest -n2 --dist loadfile --weldx-file-rw-buffer --weldx-file-rw-buffer-disp-header --cov-append ./weldx/tests/asdf_tests
pytest -n 2 --weldx-file-rw-buffer --weldx-file-rw-buffer-disp-header --cov-append ./weldx/tests/asdf_tests
- name: coverage xml (combination is performed by pytest-cov)
if: (matrix.os == 'ubuntu-latest') && (matrix.py == '3.8')
Expand Down
32 changes: 12 additions & 20 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,6 @@ jobs:
run: |
flake8
isort:
name: isort
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: pip installs
run: pip install isort==5.*
- name: show isort diff
run: |
isort ./weldx/*.py --diff
- name: run isort
run: |
isort ./weldx/*.py -c
black:
runs-on: ubuntu-latest
steps:
Expand All @@ -82,3 +62,15 @@ jobs:
- name: run mypy
run: |
mypy --install-types --non-interactive .
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Lint
uses: pre-commit/action@v2.0.3
with:
extra_args: --all-files --show-diff-on-failure
2 changes: 1 addition & 1 deletion .pep8speaks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ message: # Customize the comment made by the bot
updated: # Messages when new commits are added to the PR
header: "Hello @{name}! Thanks for updating this PR. "
footer: "" # Why to comment the link to the style guide everytime? :)
no_errors: "There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: "
no_errors: "There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: "
36 changes: 36 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
autofix_prs: false
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
skip: []
submodules: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- id: check-yaml
exclude: devtools/conda.recipe/meta.yaml # doesn't play nice with jinja
# - id: no-commit-to-branch # only makes sense for local pre-commit hooks
- repo: https://github.com/psf/black
rev: 21.9b0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.9.3
hooks:
- id: isort
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
- repo: https://github.com/pycqa/pydocstyle
rev: 6.1.1
hooks:
- id: pydocstyle
1 change: 0 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ sphinx:
# image: testing
conda:
environment: doc/rtd_environment.yml

11 changes: 6 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@

### ASDF

- all schema version numbers set to ``0.1.0`` [[#535]](https://github.com/BAMWelDX/weldx/pull/535).
- add ``time/time`` schema to support `Time` class [[#463]](https://github.com/BAMWelDX/weldx/pull/463).
- rework ASDF extension to new asdf 2.8 API [[#467]](https://github.com/BAMWelDX/weldx/pull/467)
- move schema files to ``weldx/schemas``
Expand All @@ -80,21 +81,21 @@
- move tag module to ``weldx/tags``
- refactor all asdf uris to new ``asdf://`` naming convention,
see https://asdf.readthedocs.io/en/latest/asdf/extending/uris.html#entities-identified-by-uri
- replaced all referenced weldx tag versions in schemas with ``1.*``
- replaced all referenced weldx tag versions in schemas with ``0.1.*``
- refactor ``asdf://weldx.bam.de/weldx/schemas/datamodels/single_pass_weld-1.0.0.schema``
to ``asdf://weldx.bam.de/weldx/schemas/datamodels/single_pass_weld-1.0.0`` and enable schema test
to ``asdf://weldx.bam.de/weldx/schemas/datamodels/single_pass_weld-0.1.0`` and enable schema test
- add legacy class for validators support in ``weldx.asdf._extension.py``
- asdf utility functions `weldx.asdf.util.uri_match`, `weldx.asdf.util.get_converter_for_tag`
and `weldx.asdf.util.get_weldx_extension`
- add ``devtools/scripts/update_manifest.py`` to auto update manifest from extension metadata
- custom shape validation must now be implemented via staticmethod ``WeldxConverter.shape_from_tagged``
- provide legacy schema support
in ``weldx/schemas/weldx.bam.de/legacy`` [[#533]](https://github.com/BAMWelDX/weldx/pull/533)
- rewrote `asdf://weldx.bam.de/weldx/schemas/core/transformations/coordinate_system_hierarchy-1.0.0` schema for
- rewrote `asdf://weldx.bam.de/weldx/schemas/core/transformations/coordinate_system_hierarchy` schema for
the `CoordinateSystemManager`. It uses the digraph schemas to serialize the coordinate system structure.
[[#497]](https://github.com/BAMWelDX/weldx/pull/497)
- add ``asdf://weldx.bam.de/weldx/schemas/unit/quantity-1.0.0``
and ``asdf://weldx.bam.de/weldx/schemas/unit/unit-1.0.0`` schemas [[#522]](https://github.com/BAMWelDX/weldx/pull/522)
- add ``asdf://weldx.bam.de/weldx/schemas/unit/quantity``
and ``asdf://weldx.bam.de/weldx/schemas/unit/unit`` schemas [[#522]](https://github.com/BAMWelDX/weldx/pull/522)

### deprecations

Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ prune devtools
prune doc
prune tutorials

global-exclude .*
global-exclude .*
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ This research is funded by the Federal Ministry of Education and Research of Ger
### Code Status

[![static analysis](https://github.com/BAMWelDX/weldx/workflows/static%20analysis/badge.svg?branch=master)](https://github.com/BAMWelDX/weldx/actions?query=workflow%3A%22static+analysis%22+branch%3Amaster)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/BAMWelDX/weldx/master.svg)](https://results.pre-commit.ci/latest/github/BAMWelDX/weldx/master)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/5e7ede6d978249a781e5c580ed1c813f)](https://www.codacy.com/gh/BAMWelDX/weldx?utm_source=github.com&utm_medium=referral&utm_content=BAMWelDX/weldx&utm_campaign=Badge_Grade)
[![codecov](https://codecov.io/gh/BAMWelDX/weldx/branch/master/graph/badge.svg)](https://codecov.io/gh/BAMWelDX/weldx)
[![DeepSource](https://static.deepsource.io/deepsource-badge-light-mini.svg)](https://deepsource.io/gh/BAMWelDX/weldx/?ref=repository-badge)
Expand Down
1 change: 0 additions & 1 deletion devtools/conda.recipe/build_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ dependencies:
- boa
- anaconda-client
- numpydoc>=0.5

1 change: 0 additions & 1 deletion devtools/conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,3 @@ extra:
- marscher
- vhirtham
- CagtayFabry

3 changes: 1 addition & 2 deletions devtools/doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ FILES=
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILD_DIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(DOC)
ALLSPHINXOPTS = -d $(BUILD_DIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(DOC)
.PHONY: help clean html

#------------------------------------------------------------------------------
Expand Down Expand Up @@ -45,4 +45,3 @@ latex:

html_check:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) build/html $(FILES)

2 changes: 1 addition & 1 deletion devtools/scripts/update_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def update_manifest(
search_dir: str = "../../weldx/schemas",
out: str = "../../weldx/manifests/weldx-1.0.0.yaml",
out: str = "../../weldx/manifests/weldx-0.1.0.yaml",
):
"""Create manifest file from existing schemas."""
# read existing manifest
Expand Down
1 change: 0 additions & 1 deletion doc/_templates/class-template.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@
{%- endfor %}
{% endif %}
{% endblock %}

4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ def _prevent_sphinx_circular_imports_bug():
:format: html
.. nbinfo::
Run the interactive online version of this notebook (takes 1-2 minutes to load):
Run the interactive online version of this notebook (takes 1-2 minutes to load):
:raw-html:`<a href="https://mybinder.org/v2/gh/BAMWelDX/weldx/master?urlpath=lab/tree/{{ docname }}"><img alt="Binder badge" src="https://mybinder.org/badge_logo.svg" style="vertical-align:text-bottom"></a>`
"""
Expand Down
6 changes: 3 additions & 3 deletions doc/schemas/aws.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ The ``AWS`` directory contains example implementations for shielding gas descrip

.. asdf-autoschemas::

aws/process/shielding_gas_for_procedure-1.0.0
aws/process/shielding_gas_type-1.0.0
aws/process/gas_component-1.0.0
aws/process/shielding_gas_for_procedure-0.1.0
aws/process/shielding_gas_type-0.1.0
aws/process/gas_component-0.1.0
14 changes: 7 additions & 7 deletions doc/schemas/core.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ The ``core`` directory contains schema implementations for the base classes.

.. asdf-autoschemas::

core/mathematical_expression-1.0.0
core/time_series-1.0.0
core/variable-1.0.0
core/dimension-1.0.0
core/data_array-1.0.0
core/dataset-1.0.0
core/file-1.0.0
core/mathematical_expression-0.1.0
core/time_series-0.1.0
core/variable-0.1.0
core/dimension-0.1.0
core/data_array-0.1.0
core/dataset-0.1.0
core/file-0.1.0

Transformations
===============
Expand Down
2 changes: 1 addition & 1 deletion doc/schemas/generic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ The ``generic`` directory contains basic schemas.

.. asdf-autoschemas::

uuid-1.0.0
uuid-0.1.0
2 changes: 1 addition & 1 deletion doc/schemas/groove.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Common Terms

.. asdf-autoschemas::

groove/terms-1.0.0
groove/terms-0.1.0

DIN EN ISO 9692-1
#################
Expand Down
6 changes: 3 additions & 3 deletions doc/schemas/process.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ The ``Process`` directory contains schema implementations for the base classes.

.. asdf-autoschemas::

process/generic-1.0.0
process/GMAW-1.0.0
process/terms-1.0.0
process/generic-0.1.0
process/GMAW-0.1.0
process/terms-0.1.0
1 change: 0 additions & 1 deletion doc/standard.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ The WelDX ASDF Extension implements some additional functionalities like unit an
standard/shape-validation
standard/unit-validation
standard/welding-processes

5 changes: 3 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ exclude =
[pydocstyle]
# convention numpy is currently equivalent to ignoring 'D107', 'D203', 'D212', 'D213', 'D402', 'D413'
convention = numpy
match = (?!__)(?!_version)(?!conftest).*\.py
match_dir = [^\.][^\docs][^\tags].*
# match options need to be in "" for pre-commit
match = "(?!__)(?!_version)(?!conftest).*\.py"
match_dir = "[^\.][^\docs][^\tags].*"

[tool:pytest]
addopts = --tb=short --color=yes -rsw --cov=weldx --cov-report=term-missing:skip-covered --doctest-modules
Expand Down
2 changes: 1 addition & 1 deletion tutorials/weldxfile.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@
"metadata": {},
"outputs": [],
"source": [
"schema = get_schema_path(\"single_pass_weld-1.0.0\")\n",
"schema = get_schema_path(\"single_pass_weld-0.1.0\")\n",
"schema"
]
},
Expand Down
2 changes: 1 addition & 1 deletion weldx/asdf/_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class WeldxLegacyValidatorType(CustomType):
organization = "weldx.bam.de"
standard = "weldx"
name = "legacy/validators"
version = "1.0.0"
version = "0.1.0"
types = []
validators = {
"wx_property_tag": wx_property_tag_validator,
Expand Down
2 changes: 1 addition & 1 deletion weldx/asdf/cli/welding_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def single_pass_weld_example(
wx_metadata={"welder": "A.W. Elder"},
)

model_path = get_schema_path("single_pass_weld-1.0.0.yaml")
model_path = get_schema_path("single_pass_weld-0.1.0.yaml")

# pre-validate?
weldx.asdf.util.write_read_buffer(
Expand Down
2 changes: 1 addition & 1 deletion weldx/asdf/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
WELDX_SCHEMA_URI_BASE = "asdf://weldx.bam.de/weldx/schemas/"
WELDX_EXTENSION_URI_BASE = "asdf://weldx.bam.de/weldx/extensions/"

WELDX_EXTENSION_VERSION = "1.0.0"
WELDX_EXTENSION_VERSION = "0.1.0"
WELDX_EXTENSION_URI = f"{WELDX_EXTENSION_URI_BASE}weldx-{WELDX_EXTENSION_VERSION}"
3 changes: 1 addition & 2 deletions weldx/asdf/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
from asdf.util import get_file_type
from jsonschema import ValidationError

from weldx.asdf.util import get_schema_path, get_yaml_header, view_tree
from weldx.types import SupportsFileReadWrite, types_file_like, types_path_and_file_like
from weldx.util import inherit_docstrings

from weldx.asdf.util import get_schema_path, get_yaml_header, view_tree

__all__ = [
"WeldxFile",
]
Expand Down
5 changes: 3 additions & 2 deletions weldx/asdf/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"WxSyntaxError",
]

_new_tag_regex = re.compile(r"asdf://weldx.bam.de/weldx/tags/(.*)-(\d+.\d+.\d+|1.\*)")
_new_tag_regex = re.compile(r"asdf://weldx.bam.de/weldx/tags/(.*)-(\d+.\d+.\d+|0.1.\*)")


class WxSyntaxError(Exception):
Expand Down Expand Up @@ -81,7 +81,7 @@ def __new__(mcs, name, bases, attrs):
setattr(
cls,
"tags",
[format_tag(name, "1.*")],
[format_tag(name, "0.1.*")],
)

# wrap original to/from_yaml_tree method to include metadata attributes
Expand Down Expand Up @@ -127,4 +127,5 @@ def format_tag(tag_name, version=None, organization="weldx.bam.de", standard="we

def _legacy_tag_from_new_tag(tag: str):
name, version = _new_tag_regex.search(tag).groups()
version = "1.0.0" # legacy_tag version
return f"tag:weldx.bam.de:weldx/{name}-{version}"
2 changes: 1 addition & 1 deletion weldx/asdf/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ def get_highest_tag_version(
--------
>>> from weldx.asdf.util import get_highest_tag_version
>>> get_highest_tag_version("asdf://weldx.bam.de/weldx/tags/uuid-*")
'asdf://weldx.bam.de/weldx/tags/uuid-1.0.0'
'asdf://weldx.bam.de/weldx/tags/uuid-0.1.0'
"""
if ctx is None:
Expand Down
Loading

0 comments on commit a0ac4f5

Please sign in to comment.