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

Update multi-pass-weld schema description #781

Merged
merged 11 commits into from
Jul 19, 2022
Merged

Conversation

vhirtham
Copy link
Collaborator

@vhirtham vhirtham commented Jul 8, 2022

Changes

Update the multi-pass-weld schema description

Related Issues

Closes #748

Checks

  • updated CHANGELOG.rst
  • updated tests
  • updated doc/
  • update example/tutorial notebooks
  • update manifest file

@vhirtham vhirtham added documentation Improvements or additions to documentation ASDF everything ASDF related (python + schemas) labels Jul 8, 2022
@vhirtham vhirtham self-assigned this Jul 8, 2022
@vhirtham
Copy link
Collaborator Author

vhirtham commented Jul 8, 2022

I have created the following script for the example and added its output to the schema file as an example:

from weldx import Q_, LocalCoordinateSystem, TimeSeries, WeldxFile

data = [
    [
        [
            [
                dict(
                    TCP=LocalCoordinateSystem(
                        coordinates=Q_([10, 0, 0], "mm"),
                    ),
                    welding_voltage=TimeSeries(Q_(10, "V")),
                )
            ],
            [
                dict(
                    TCP=LocalCoordinateSystem(
                        coordinates=Q_([20, 0, 0], "mm"),
                    ),
                    welding_voltage=TimeSeries(Q_(20, "V")),
                )
            ],
        ]
    ],
    [
        [
            [
                dict(
                    TCP=LocalCoordinateSystem(
                        coordinates=Q_([30, 0, 0], "mm"),
                    ),
                    welding_voltage=TimeSeries(Q_(30, "V")),
                )
            ],
        ]
    ],
]
tree = dict(weld_seam=data)

wxf = WeldxFile(tree=tree, custom_schema="multi_pass_weld-0.1.0", mode="rw")
wxf.header()

@codecov
Copy link

codecov bot commented Jul 8, 2022

Codecov Report

Merging #781 (5246cf1) into master (c218595) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #781   +/-   ##
=======================================
  Coverage   96.77%   96.77%           
=======================================
  Files          88       88           
  Lines        6017     6017           
=======================================
  Hits         5823     5823           
  Misses        194      194           

@github-actions
Copy link

github-actions bot commented Jul 8, 2022

Unit Test Results

2 153 tests  ±0   2 153 ✔️ ±0   2m 28s ⏱️ -24s
       1 suites ±0          0 💤 ±0 
       1 files   ±0          0 ±0 

Results for commit 9f35b7e. ± Comparison against base commit 2af3da3.

♻️ This comment has been updated with latest results.

@vhirtham vhirtham marked this pull request as ready for review July 11, 2022 09:58
@CagtayFabry
Copy link
Member

I have created the following script for the example and added its output to the schema file as an example:

from weldx import Q_, LocalCoordinateSystem, TimeSeries, WeldxFile

data = [
    [
        [
            [
                dict(
                    TCP=LocalCoordinateSystem(
                        coordinates=Q_([10, 0, 0], "mm"),
                    ),
                    welding_voltage=TimeSeries(Q_(10, "V")),
                )
            ],
            [
                dict(
                    TCP=LocalCoordinateSystem(
                        coordinates=Q_([20, 0, 0], "mm"),
                    ),
                    welding_voltage=TimeSeries(Q_(20, "V")),
                )
            ],
        ]
    ],
    [
        [
            [
                dict(
                    TCP=LocalCoordinateSystem(
                        coordinates=Q_([30, 0, 0], "mm"),
                    ),
                    welding_voltage=TimeSeries(Q_(30, "V")),
                )
            ],
        ]
    ],
]
tree = dict(weld_seam=data)

wxf = WeldxFile(tree=tree, custom_schema="multi_pass_weld-0.1.0", mode="rw")
wxf.header()

Good to have an example!
We should restrict the schema to not allow LCS entries with only a single point since that doesn't make sense for the applications.
We don't need to restrict it to only 2 points like in the single pass case but "2 or more" should be suitable here.

Something like this in the example

from weldx import Q_, LocalCoordinateSystem, TimeSeries, WeldxFile

time = ["0s", "5s"]

A = dict(
    TCP=LocalCoordinateSystem(
        coordinates=Q_([[0, 0, 0], [50, 0, 0]], "mm"),
        time=time,
    ),
    welding_voltage=TimeSeries(Q_(10, "V")),
)

B = dict(
    TCP=LocalCoordinateSystem(
        coordinates=Q_([[0, 0, 10], [50, 0, 10]], "mm"),
        time=time,
    ),
    welding_voltage=TimeSeries(Q_(20, "V")),
)

C = dict(
    TCP=LocalCoordinateSystem(
        coordinates=Q_([[0, 0, 10], [50, 0, 10]], "mm"),
        time=time,
    ),
    welding_voltage=TimeSeries(Q_(30, "V")),
)

data = [[[[A], [B]]], [[[C]]]]
tree = dict(weld_seam=data)

wxf = WeldxFile(tree=tree, custom_schema="multi_pass_weld-0.1.0", mode="rw")
wxf.header()

@CagtayFabry
Copy link
Member

another thing that might help with the deeply nested lists:
we could also allow the higher level sections like weld_layer to be either a list of the next level (like now) or be a single $ref: "./terms-0.1.0#/weldment", in which case it would get extended down to the lowest level automatically upon reading the schema

So if we have 1 seam with 3 layers each with only one bead and each bead only has a single weldment this would be enough:
data = [[A], [B], [C]]

@github-actions
Copy link

github-actions bot commented Jul 19, 2022

Test Results

2 153 tests  ±0   2 153 ✔️ ±0   2m 33s ⏱️ +3s
       1 suites ±0          0 💤 ±0 
       1 files   ±0          0 ±0 

Results for commit 5246cf1. ± Comparison against base commit c218595.

♻️ This comment has been updated with latest results.

@vhirtham vhirtham merged commit 65753d7 into BAMWelDX:master Jul 19, 2022
@vhirtham vhirtham deleted the mpw_doc branch July 19, 2022 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ASDF everything ASDF related (python + schemas) documentation Improvements or additions to documentation no-changelog-entry-needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update multi_pass_weld schema description and example
2 participants