-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
asdf: - add basic file/directory layout for asdf files - asdf schemas are located in `weldx/asdf/schemas/weldx.bam.de/weldx` - tag implementations are in `weldx/asdf/tags/weldx` - implement support for pint quantities - implement support for basic pandas time class - implement base welding classes from AWS/NIST "A Welding Data Dictionary" - add and implement ISO groove types (DIN EN ISO 9692-1:2013) - add basic jinja templates and functions for adding simple dataclass objects - setup package to include and install ASDF extensions and schemas (see setup.py, MANIFEST.in) - add basic tests for writing/reading all ASDF classes (these only run code without any real checks!) module: - add and populate `__init__.py` files - add setup.py package configuration for install - required packages - package metadata - asdf extension entry points - version support - update pandas, scipy, xarray and pint minimum versions (in conda env and setup.py) - add versioneer - update options in setup.cfg - update tool configurations - ignore `asdf`-module in deepsource run CI: - add local conda build workflow (no artifacts so far, testing only) - add asdf schema test workflow with local package install (schemas are excluded from default pytest run) - add debug isort workflow (can be used to check files that would be sorted, we can activate isort test with new options in release 5.0)
- Loading branch information
1 parent
329f8e3
commit e0e0cf3
Showing
74 changed files
with
7,835 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
weldx/_version.py export-subst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: conda build | ||
on: [push] | ||
|
||
jobs: | ||
test: | ||
name: conda build (local) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-18.04] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Include $CONDA in $PATH | ||
run: echo ::add-path::$CONDA/bin | ||
- name: Add conda-forge & print conda info | ||
run: | | ||
conda config --append channels conda-forge | ||
conda info -a | ||
- name: Create conda build environment | ||
run: conda env create -f ./conda.recipe/build_env.yml | ||
- name: Build from local conda recipe | ||
run: | | ||
source activate build_env | ||
conda build . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: pytest asdf | ||
on: [push] | ||
|
||
jobs: | ||
# pytest: | ||
# name: pytest asdf | ||
# runs-on: ${{ matrix.os }} | ||
# strategy: | ||
# matrix: | ||
# os: [ubuntu-18.04] | ||
# steps: | ||
# - uses: actions/checkout@v1 | ||
# - name: Include $CONDA in $PATH | ||
# run: echo ::add-path::$CONDA/bin | ||
# - name: Print conda info | ||
# run: conda info -a | ||
# - name: Create conda environment | ||
# run: conda env create -f ./environment.yml | ||
# - name: Conda develop install of source package for ASDF Schema links | ||
# run: | | ||
# conda install conda-build -n weldx | ||
# - name: Run tests with added asdf schema file location | ||
# run: | | ||
# source activate weldx | ||
# python setup.py install --user | ||
# pytest --asdf-tests --ignore=tests/ | ||
pytest: | ||
name: pytest asdf | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-18.04] | ||
py: [ '3.7', '3.8' ] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.py }} | ||
- name: pip installs | ||
run: | | ||
pip install pytest pytest-cov | ||
pip install . | ||
- name: run pytest | ||
run: | | ||
pytest --asdf-tests --ignore=tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
recursive-include weldx/asdf/schemas *.yaml | ||
include versioneer.py | ||
include weldx/_version.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
name: build_env | ||
channels: | ||
- defaults | ||
dependencies: | ||
- python=3.7 | ||
- setuptools | ||
- conda-build | ||
- conda-verify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{% set data = load_setup_py_data() %} | ||
|
||
package: | ||
name: weldx | ||
version: {{ data['version'] }} | ||
|
||
source: | ||
path: .. | ||
|
||
build: | ||
script: python setup.py install --single-version-externally-managed --record=record.txt | ||
number: 0 | ||
noarch: python | ||
|
||
requirements: | ||
build: | ||
- python | ||
- setuptools | ||
run: | ||
- python | ||
# dependencies are defined in setup.py | ||
{% for dep in data['install_requires'] %} | ||
- {{ dep.lower() }} | ||
{% endfor %} | ||
|
||
test: | ||
imports: | ||
- weldx | ||
|
||
about: | ||
home: www.bam.de/weldx | ||
license: BSD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
"""Run the AWS Data Dictionary debug example.""" | ||
|
||
import asdf | ||
import pprint | ||
|
||
from weldx.constants import WELDX_QUANTITY as Q_ | ||
|
||
from weldx.asdf.extension import WeldxExtension, WeldxAsdfExtension | ||
|
||
# welding process ----------------------------------------------------------------- | ||
from weldx.asdf.tags.weldx.aws.process.gas_component import GasComponent | ||
from weldx.asdf.tags.weldx.aws.process.shielding_gas_type import ShieldingGasType | ||
from weldx.asdf.tags.weldx.aws.process.shielding_gas_for_procedure import ( | ||
ShieldingGasForProcedure, | ||
) | ||
from weldx.asdf.tags.weldx.aws.process.arc_welding_process import ArcWeldingProcess | ||
|
||
# weld design ----------------------------------------------------------------- | ||
from weldx.asdf.tags.weldx.aws.design.joint_penetration import JointPenetration | ||
from weldx.asdf.tags.weldx.aws.design.weld_details import WeldDetails | ||
from weldx.asdf.tags.weldx.aws.design.connection import Connection | ||
from weldx.asdf.tags.weldx.aws.design.workpiece import Workpiece | ||
from weldx.asdf.tags.weldx.aws.design.sub_assembly import SubAssembly | ||
from weldx.asdf.tags.weldx.aws.design.weldment import Weldment | ||
from weldx.asdf.tags.weldx.aws.design.base_metal import BaseMetal | ||
from weldx.asdf.tags.weldx.core.iso_groove import get_groove | ||
|
||
|
||
# welding process ----------------------------------------------------------------- | ||
gas_comp = [ | ||
GasComponent("argon", Q_(82, "percent")), | ||
GasComponent("carbon dioxide", Q_(18, "percent")), | ||
] | ||
gas_type = ShieldingGasType(gas_component=gas_comp, common_name="SG") | ||
|
||
gas_for_procedure = ShieldingGasForProcedure( | ||
use_torch_shielding_gas=True, | ||
torch_shielding_gas=gas_type, | ||
torch_shielding_gas_flowrate=Q_(20, "l / min"), | ||
) | ||
|
||
arc_welding_process = ArcWeldingProcess("GMAW") | ||
process = { | ||
"arc_welding_process": arc_welding_process, | ||
"shielding_gas": gas_for_procedure, | ||
} | ||
|
||
# weld design ----------------------------------------------------------------- | ||
v_groove = get_groove( | ||
groove_type="VGroove", | ||
workpiece_thickness=Q_(9, "mm"), | ||
groove_angle=Q_(50, "deg"), | ||
root_face=Q_(4, "mm"), | ||
root_gap=Q_(2, "mm"), | ||
) | ||
|
||
joint_penetration = JointPenetration( | ||
complete_or_partial="completePenetration", root_penetration=Q_(1.0, "mm") | ||
) | ||
weld_details = WeldDetails( | ||
joint_design=v_groove, weld_sizes=Q_(320, "mm"), number_of_passes=1 | ||
) | ||
connection = Connection( | ||
joint_type="butt_joint", | ||
weld_type="singleVGroove", | ||
joint_penetration=joint_penetration, | ||
weld_details=weld_details, | ||
) | ||
workpieces = [Workpiece(geometry="V-Groove")] | ||
sub_assembly = [SubAssembly(workpiece=workpieces, connection=connection)] | ||
|
||
weldment = Weldment(sub_assembly) | ||
|
||
base_metal = BaseMetal("steel", "plate", Q_(10.3, "mm")) | ||
|
||
filename = "aws_demo.yaml" | ||
tree = dict(process=process, weldment=weldment, base_metal=base_metal) | ||
|
||
# Write the data to a new file | ||
with asdf.AsdfFile( | ||
tree, | ||
extensions=[WeldxExtension(), WeldxAsdfExtension()], | ||
ignore_version_mismatch=False, | ||
) as ff: | ||
ff.write_to(filename, all_array_storage="inline") | ||
|
||
# read back data from ASDF file | ||
with asdf.open( | ||
filename, copy_arrays=True, extensions=[WeldxExtension(), WeldxAsdfExtension()] | ||
) as af: | ||
data = af.tree | ||
pprint.pprint(data["process"]) | ||
pprint.pprint(data["weldment"].__dict__) | ||
pprint.pprint(data["base_metal"].__dict__) |
Oops, something went wrong.