diff --git a/.deepsource.toml b/.deepsource.toml index fa96a1eed..e87cb8ac4 100644 --- a/.deepsource.toml +++ b/.deepsource.toml @@ -17,3 +17,7 @@ exclude_patterns = [ name = "python" enabled = true runtime_version = "3.x.x" + +[analyzers.meta] +# skip magic and private objects: https://discuss.deepsource.io/t/docstrings-for-private-classes-methods/259/2 +skip_doc_coverage = ["magic", "nonpublic"] diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 3f89d91ea..e140ca486 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -8,7 +8,7 @@ Closes # (add issue numbers) ## Checks -- [ ] updated CHANGELOG.md +- [ ] updated CHANGELOG.rst - [ ] updated tests - [ ] updated doc/ - [ ] update example/tutorial notebooks diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index cd71764b5..000000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,575 +0,0 @@ -# Release Notes - -## 0.5.0 (unreleased) - -### added - -- added "units" (exact) and "dimensionality" (dimensionality compatible) checking options - to `util.xr_check_coords` [[#442]](https://github.com/BAMWelDX/weldx/pull/442) -- `Time` class that can be initialized from several other time types and provides time related utility functions - [[#433]](https://github.com/BAMWelDX/weldx/pull/433) -- `TimeSeries` now supports setting a `reference_time` absolute time values for - interpolation [[#440]](https://github.com/BAMWelDX/weldx/pull/440) -- `LocalCoordinateSystem.from_axis_vectors` - and `CoordinateSystemManager.create_cs_from_axis_vectors` [[#472]](https://github.com/BAMWelDX/weldx/pulls/472) -- added PyTest flags to use ``WeldxFile`` internally in ``asdf.util.read_buffer`` and ``asdf.util.write_buffer`` - [[#469]](https://github.com/BAMWelDX/weldx/pull/469). -- added classes and functions at the top-level of the package to the documentation - [[#437]](https://github.com/BAMWelDX/weldx/pulls/437). -- added `weldx.asdf.util.get_highest_tag_version` utility function [[#523]](https://github.com/BAMWelDX/weldx/pull/523). -- `Geometry.write_to_file` function that allows to export the geometry to simple point and triangle based file formats - like `.stl` or `.ply` [[#536]](https://github.com/BAMWelDX/weldx/pulls/536). - -### removed - -- removed functions now covered by `Time`: ``pandas_time_delta_to_quantity``, ``to_pandas_time_index`` - , ``get_time_union`` [[#448]](https://github.com/BAMWelDX/weldx/pull/448) -- removed custom ``wx_tag`` validator [[#461]](https://github.com/BAMWelDX/weldx/pull/461) -- attrdict dependency replaced with a custom implementation of recursive dicts - [[#470]](https://github.com/BAMWelDX/weldx/pulls/470). -- `from_xyz`, `from_xy_and_orientation`, `from_yz_and_orientation` and `from_xz_and_orientation` - from `LocalCoordinateSystem`. Use `from_axis_vectors` instead. [[#472]](https://github.com/BAMWelDX/weldx/pulls/472) -- `create_cs_from_xyz`, `create_cs_from_xy_and_orientation`, `create_cs_from_yz_and_orientation` and - `create_cs_from_xz_and_orientation` from `CoordinateSystemManager`. Use `create_cs_from_axis_vectors` - instead. [[#472]](https://github.com/BAMWelDX/weldx/pulls/472) -- `is_column_in_matrix`, `is_row_in_matrix`, `to_float_array`, `to_list`, `matrix_is_close`, `vector_is_close` - and `triangulate_geometry` from `weldx.util` [[#490]](https://github.com/BAMWelDX/weldx/pull/490) -- remove the ``:`` syntax from ``wx_shape`` validation [[#537]](https://github.com/BAMWelDX/weldx/pull/537) - -### changes - -- move `sine` utility function to `weldx.welding.util` [[#439]](https://github.com/BAMWelDX/weldx/pull/439) -- `LocalCoordinateSystem` and `CoordinateSystemManager` function parameters related to time now support all types that - are also supported by the new `Time` class [[#448]](https://github.com/BAMWelDX/weldx/pull/448) -- `LocalCoordinateSystem.interp_time` returns static systems if only a single time value is passed or if there is no - overlap between the interpolation time range and the coordinate systems time range. This also affects the results of - some `CoordinateSystemManager` methods (``get_cs`` - , ``interp_time``) [[#476]](https://github.com/BAMWelDX/weldx/pull/476) -- `WeldxAccessor.time_ref` setter now raises a `TypeError` if `None` is passed to it - [[#489]](https://github.com/BAMWelDX/weldx/pull/489) -- move xarray related utility functions into `weldx.util.xarray` and all other ones into `weldx.util.util`. Content from - both submodules can still be accessed using `weldx.util` [[#490]](https://github.com/BAMWelDX/weldx/pull/490) -- xarray implementations for the `LocalCoordinateSystem` now operate on time as a dimension instead of - coordinates [[#486]](https://github.com/BAMWelDX/weldx/pull/486) -- `WeldxFile.copy` now creates a copy to a (optional) file. Before it just returned a dictionary - [[#504]](https://github.com/BAMWelDX/weldx/pull/504). -- changed the default ``pint.Unit`` formatting to short - notation ``:~`` [[#519]](https://github.com/BAMWelDX/weldx/pull/519). -- support most ``pandas.Index`` methods on `Time` instances [[#503]](https://github.com/BAMWelDX/weldx/pull/503). - -### fixes - -- `WeldxFile.show_asdf_header` prints output on console, before it only returned the header as parsed dict and string - representation. Also tweaked efficiency by not writing binary - blocks [[#459]](https://github.com/BAMWelDX/weldx/pull/459), [[#469]](https://github.com/BAMWelDX/weldx/pull/469). -- Merging and unmerging multiple `CoordinateSystemManager` instances now correctly preserves all attached data. - [[#494]](https://github.com/BAMWelDX/weldx/pull/494). -- `compare_nested` can compare sets [[#496]](https://github.com/BAMWelDX/weldx/pull/496) -- `WeldxFile` cleans old memory blocks during file updates [[#539]](https://github.com/BAMWelDX/weldx/pull/539). -- `WeldxFile` respects `mode` argument also for BytesIO and file - handles [[#539]](https://github.com/BAMWelDX/weldx/pull/539). - -### documentation - -- added installation guide with complete environment setup (Jupyterlab with extensions) and possible problems and - solutions [[#450]](https://github.com/BAMWelDX/weldx/pull/450) -- split API documentation into user classes/functions and a full API reference - [[#469]](https://github.com/BAMWelDX/weldx/pull/469). - -### 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`` - - create extension manifest in ``weldx/manifests``. The manifest also contains tag mappings for legacy tag names for - backwards compatibility. - - 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 ``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-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` 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`` - and ``asdf://weldx.bam.de/weldx/schemas/unit/unit`` schemas [[#522]](https://github.com/BAMWelDX/weldx/pull/522). -- use ``asdf://weldx.bam.de/weldx/schemas/unit/quantity`` instead - of ``tag:stsci.edu:asdf/unit/quantity-1.1.0`` [[#542]](https://github.com/BAMWelDX/weldx/pull/542). -- changed ``time/timedelta`` and ``time/timestamp`` to be ``type: string`` instead - of ``object`` ``tag:stsci.edu:asdf/unit/quantity-1.1.0`` [[#541]](https://github.com/BAMWelDX/weldx/pull/541). -- refactor properties named ``unit`` to ``units`` and use ``unit/unit`` - tag [[#551]](https://github.com/BAMWelDX/weldx/pull/551). - -### deprecations - -### dependencies - -## 0.4.1 (20.07.2021) - -### added - -- `closed_mesh` parameter to `Geometry.spatial_data` - and `SpatialData.from_geometry_raster` [[#414]](https://github.com/BAMWelDX/weldx/pull/414) -- `TimeSeries.plot` and `Signal.plot` [[#420]](https://github.com/BAMWelDX/weldx/pull/420) -- abstract base class `TimeDependent` [[#460]](https://github.com/BAMWelDX/weldx/pull/460) - -### changes - -- `TimeSeries.__init__` accepts `xarray.DataArray` as `data` - parameter [[#429]](https://github.com/BAMWelDX/weldx/pull/429) -- The `LocalCoordinateSystem.time` and `TimeSeries.time` now return an instance of `Time` - [[#464]](https://github.com/BAMWelDX/weldx/pull/464) -- Fix wrong and incomplete type-hints [[#435]](https://github.com/BAMWelDX/weldx/pull/435) - -### ASDF - -- sort `List[str]` before serialization of most `weldx` classes to avoid random reordering in the same file and enforce - consistency. [[#430]](https://github.com/BAMWelDX/weldx/pull/430) - -### deprecations - -- `lcs_coords_from_ts` will be removed in version 0.5.0 [[#426]](https://github.com/BAMWelDX/weldx/pull/426) - -## 0.4.0 (13.07.2021) - -Release `0.4.0` brings many new major features to `weldx` - -### Highlights - -- [Quality Standards](https://weldx.readthedocs.io/en/latest/tutorials/quality_standards.html): - Users can now create and integrate their own quality standards by defining new ASDF schema definitions and loading - them into weldx. It is possible to add new definitions or modify existing schemas to create your own flavour of the - weldx standard. -- [WeldxFile](https://weldx.readthedocs.io/en/latest/tutorials/weldxfile.html): - Create/Load/Modify asdf files directly using ``WeldxFile`` with many helpful utility functions included. -- [TimeSeries support](https://weldx.readthedocs.io/en/latest/tutorials/welding_example_02_weaving.html#add-a-sine-wave-to-the-TCP-movement) - for ``LocalCoordinateSystem``: - It is now possible to define a time-dependent ``LocalCoordinateSystem`` with a simple function by passing - a ``TimeSeries`` - object with a ``MathematicalExpression`` as ``coordinates``. For an example, click the link above. -- [MeasurementChain](https://weldx.readthedocs.io/en/latest/tutorials/measurement_chain.html) \ - The ``MeasurementChain`` has been reworked to be easier and more flexible to use. - -full changelog below: - -### added - -- add support for quality standards. Further information can be found in the corresponding new tutorial. - [[#211]](https://github.com/BAMWelDX/weldx/pull/211) -- added `asdf.util.get_schema_path` helper function [[#325]](https://github.com/BAMWelDX/weldx/pull/325) -- added `util.compare_nested` to check equality of two nested data - structures. [[#328]](https://github.com/BAMWelDX/weldx/pull/328) -- added `WeldxFile` wrapper to handle asdf files with history and schemas more - easily. [[#341]](https://github.com/BAMWelDX/weldx/pull/341). -- add `"step"` as additional method to `util.xr_interp_like` [[#363]](https://github.com/BAMWelDX/weldx/pull/363) -- add `util.compare_nested_eq` decorator for dataclasses with array-like - fields [[#378]](https://github.com/BAMWelDX/weldx/pull/378) -- adds a `dataclass_serialization_class` utility function that automatically generates the asdf serialization class for - python dataclasses. [[#380]](https://github.com/BAMWelDX/weldx/pull/380) -- Added method to set the interpolation method to the `TimeSeries` [[#353]](https://github.com/BAMWelDX/weldx/pull/353) -- Add `is_discrete` and `is_expression` properties to `TimeSeries` [[#366]](https://github.com/BAMWelDX/weldx/pull/366) -- Add `MeasurementChain.output_signal` property that returns the output signal of the `MeasurementChain` - [[#394]](https://github.com/BAMWelDX/weldx/pull/394) - -### changes - -- `WXRotation.from_euler()` now accepts a `pint.Quantity` as input. [[#318]](https://github.com/BAMWelDX/weldx/pull/318) -- move tests folder to `weldx/tests` [[#323]](https://github.com/BAMWelDX/weldx/pull/323) -- `get_yaml_header` received a new option parse, which optionally returns the parsed YAML header - as `asdf.tagged.TaggedDict`. [[#338]](https://github.com/BAMWelDX/weldx/pull/338) -- refactor `asdf_json_repr` into `view_tree` [[#339]](https://github.com/BAMWelDX/weldx/pull/339) -- `TimeSeries.interp_time` [[#353]](https://github.com/BAMWelDX/weldx/pull/353) - - now returns a new `TimeSeries` instead of a `xarray.DataArray` - - if the data has already been interpolated before, a warning is emitted - - `TimeSeries` supports now all interpolation methods supported by xarray -- The `MeasurementChain` is now internally based on a `networkx.DiGraph`. New functions are also added to the class to - simplify its usage. [[#326]](https://github.com/BAMWelDX/weldx/pull/326) - The following additional changes were applied during the update of the `MeasurementChain`: - - renamed `DataTransformation` class to `SignalTransformation` - - renamed `Source` to `SignalSource` - - Added additional functionality to `Signal`, `SignalTransformation` and `GenericEquipment` - - Removed `Data` class - - Updated asdf schemas of all modified classes and the ones that contained references to those classes -- allow input of string quantities in `MathematicalExpression` parameters and a few other - places [[#402]](https://github.com/BAMWelDX/weldx/pull/402) [[#416]](https://github.com/BAMWelDX/weldx/pull/416) -- `LocalCoordinateSystem.__init__` now accepts a `TimeSeries` as input. All methods of the `CoordinateSystemManager` - also support this new behavior [[#366]](https://github.com/BAMWelDX/weldx/pull/366) -- During the creation of a `WeldxFile` the path of a passed custom schema is resolved automatically - [[#412]](https://github.com/BAMWelDX/weldx/pull/412). - -### documentation - -- Add new tutorial about the `MeasurementChain` [[#326]](https://github.com/BAMWelDX/weldx/pull/326) -- Updated the measurement tutorial [[#326]](https://github.com/BAMWelDX/weldx/pull/326) - -### ASDF - -- fix inline array serialization for new 64bit inline limit [[#218]](https://github.com/BAMWelDX/weldx/pull/218) -- add `yaml_tag_handles` to `WeldxExtension` [[#218]](https://github.com/BAMWelDX/weldx/pull/218) -- add `uuid-1.0.0.yaml` schema as basic version 4 UUID - implementation [[#330]](https://github.com/BAMWelDX/weldx/pull/330) -- add `core/graph/di_node`, `core/graph/di_edge` & `core/graph/di_graph` for implementing a - generic `networkx.DiGraph` [[#330]](https://github.com/BAMWelDX/weldx/pull/330) -- compatibility with ASDF-2.8 [[#355]](https://github.com/BAMWelDX/weldx/pull/355) -- data attached to an instance of the `CoordinateSystemManger` is now also stored in a WelDX file - [[#364]](https://github.com/BAMWelDX/weldx/pull/339) -- replace references to base asdf tags with `-1.*` version wildcard [[#373]](https://github.com/BAMWelDX/weldx/pull/373) -- update `single-pass-weldx.1.0.0.schema` to allow groove types by - wildcard [[#373]](https://github.com/BAMWelDX/weldx/pull/373) -- fix attributes serialization of DataSet children [[#384]](https://github.com/BAMWelDX/weldx/pull/384). -- update `wx_shape` syntax in `local_coordinate_system-1.0.0` [[#366]](https://github.com/BAMWelDX/weldx/pull/366) -- add custom `wx_shape` validation to `variable-1.0.0` [[#366]](https://github.com/BAMWelDX/weldx/pull/366) -- remove outdated `TimeSeries` shape validation code [[#399]](https://github.com/BAMWelDX/weldx/pull/399) -- use asdf tag validation pattern for `wx_property_tag` [[#410]](https://github.com/BAMWelDX/weldx/pull/410) -- update `MathematicalExpression` schema [[#410]](https://github.com/BAMWelDX/weldx/pull/410) - -### fixes - -- added check for symmetric key difference for mappings - with `util.compare_nested` [[#377]](https://github.com/BAMWelDX/weldx/pull/377) - -### deprecations - -- deprecate `wx_tag` validator (use default asdf uri pattern - matching) [[#410]](https://github.com/BAMWelDX/weldx/pull/410) - -## 0.3.3 (30.03.2021) - -This is a bugfix release to correctly include the asdf schema files in conda -builds. [[#314]](https://github.com/BAMWelDX/weldx/pull/314) - -### ASDF - -- fix required welding wire metadata in `single-pass-weldx.1.0.0.schema` - [[#316]](https://github.com/BAMWelDX/weldx/pull/316) - -## 0.3.2 (29.03.2021) - -### added - -- `weldx.util.deprecated` decorator [[#295]](https://github.com/BAMWelDX/weldx/pull/295) - -### removed - -- `rotation_matrix_x`, `rotation_matrix_y` and `rotation_matrix_z` - [[#317]](https://github.com/BAMWelDX/weldx/pull/317) - -### dependencies - -- restrict `scipy!=1.6.0,scipy!=1.6.1` [[#300]](https://github.com/BAMWelDX/weldx/pull/300) - -### ASDF - -- add validators to `rotation-1.0.0.yaml` - & `gas_component-1.0.0.yaml` [[#303]](https://github.com/BAMWelDX/weldx/pull/303) -- update descriptions in `single-pass-weldx.1.0.0.schema` [[#308]](https://github.com/BAMWelDX/weldx/pull/308) - -### fixes - -- prevent creation of `IsoBaseGroove` with negative parameters [[#306]](https://github.com/BAMWelDX/weldx/pull/306) - -## 0.3.1 (21.03.2021) - -### added - -- plot function for `MeasurementChain` [[#288]](https://github.com/BAMWelDX/weldx/pull/288) - -### ASDF - -- remove the `additionalProperties` restriction - from `single_pass_weld-1.0.0.schema.yaml` [[#283]](https://github.com/BAMWelDX/weldx/pull/283) -- allow scalar `integer` value in `anyOf` of `time_series-1.0.0.yaml` to - fix [#282](https://github.com/BAMWelDX/weldx/pull/282) [[#286]](https://github.com/BAMWelDX/weldx/pull/286) -- add examples to schema files [[#274]](https://github.com/BAMWelDX/weldx/pull/274) - -### changes - -- `plot_graph` of the CSM now renders static and time-dependent edges differently - [[#291]](https://github.com/BAMWelDX/weldx/pull/291) -- use `pint` compatible array syntax in `IsoBaseGroove.to_profile()` - methods [[#189]](https://github.com/BAMWelDX/weldx/pull/189) -- CSM and LCS plot function get a `scale_vectors` parameter. It scales the plotted coordinate system vectors when using - matplotlib as backend [[#293]](https://github.com/BAMWelDX/weldx/pull/293) - -### fixes - -- A warning is now emitted if a `LocalCoordinateSystem` drops a provided time during construction. This usually happens - if the coordinates and orientation only contain a single data point. - [[#285]](https://github.com/BAMWelDX/weldx/pull/285) - -## 0.3.0 (12.03.2021) - -### added - -- add `weldx.transformations.CoordinateSystemManager.relabel` - function [[#219]](https://github.com/BAMWelDX/weldx/pull/219) -- add `SpatialDate` class for storing 3D point data with optional - triangulation [[#234]](https://github.com/BAMWelDX/weldx/pull/234) -- add `plot` function to `SpatialData`[[#251]](https://github.com/BAMWelDX/weldx/pull/251) -- add `plot` function to visualize `LocalCoordinateSystem` and `CoordinateSystemManager` instances in 3d space - [[#231]](https://github.com/BAMWelDX/weldx/pull/231) -- add `weldx.welding.groove.iso_9692_1.IsoBaseGroove.cross_sect_area` property to compute cross sectional area between - the workpieces [[#248]](https://github.com/BAMWelDX/weldx/pull/248). -- add `weldx.welding.util.compute_welding_speed` function [[#248]](https://github.com/BAMWelDX/weldx/pull/248). - -### ASDF - -- Add possibility to store meta data and content of an external file in an ASDF - file [[#215]](https://github.com/BAMWelDX/weldx/pull/215) - - Python class: `weldx.asdf.ExternalFile` - - Schema: `core/file-1.0.0.yaml` -- Added support for serializing generic metadata and userdata attributes for weldx - classes. [[#209]](https://github.com/BAMWelDX/weldx/pull/209) - - the provisional attribute names are `wx_metadata` and `wx_user` -- `None` values are removed from the asdf tree for all `weldx` - classes. [[#212]](https://github.com/BAMWelDX/weldx/pull/212) -- add `datamodels` directory and example `http://weldx.bam.de/schemas/weldx/datamodels/single_pass_weld-1.0.0.schema` - schema [[#190]](https://github.com/BAMWelDX/weldx/pull/190) - - schemas in the `datamodels` directory do not define any tags and can be referenced in other schemas and - as `custom_schema` when reading/writing `ASDF`-files - - the `single_pass_weld-1.0.0.schema` is an example schema for a simple, linear, single pass GMAW application - - add `core/geometry/point_cloud-1.0.0.yaml` schema [[#234]](https://github.com/BAMWelDX/weldx/pull/234) -- add file schema describing a simple linear welding - application `datamodels/single_pass_weld-1.0.0.schema` [[#256]](https://github.com/BAMWelDX/weldx/pull/256) - -### documentation - -- Simplify tutorial code and enhance plots by using newly implemented plot functions - [[#231]](https://github.com/BAMWelDX/weldx/pull/231) [[#251]](https://github.com/BAMWelDX/weldx/pull/251) -- add AWS shielding gas descriptions to documentation [[#270]](https://github.com/BAMWelDX/weldx/pull/270) - -### changes - -- pass variable names as tuple to `sympy.lambdify` in `MathematicalExpression` to prevent sympy - deprecation [[#214]](https://github.com/BAMWelDX/weldx/pull/214) -- set `conda-forge` as primary channel in `environment.yaml` - and `build_env.yaml` [[#214]](https://github.com/BAMWelDX/weldx/pull/214) -- set minimum Python version to 3.7 [[#220]](https://github.com/BAMWelDX/weldx/pull/220) -- `geometry.Profile.rasterize` can return list of rasterized shapes instead of flat ndarray (with - setting `stack=False`) [[#223]](https://github.com/BAMWelDX/weldx/pull/223) -- `geometry.Profile.plot` plots individual line objects for each shape (instead of a single line - object) [[#223]](https://github.com/BAMWelDX/weldx/pull/223) -- remove jinja templates and related code [[#228]](https://github.com/BAMWelDX/weldx/pull/228) -- add `stack` option to most `geometry` classes for rasterization [[#234]](https://github.com/BAMWelDX/weldx/pull/234) -- The graph of a `CoordinateSystemManager` is now plotted with `plot_graph` instead of `plot`. - [[#231]](https://github.com/BAMWelDX/weldx/pull/231) -- add custom `wx_shape` validation for `TimeSeries` and `Quantity` [[#256]](https://github.com/BAMWelDX/weldx/pull/256) -- refactor the `transformations` and `visualization` module into smaller - files [[#247]](https://github.com/BAMWelDX/weldx/pull/247) -- refactor `weldx.utility` into `weldx.util` [[#247]](https://github.com/BAMWelDX/weldx/pull/247) -- refactor `weldx.asdf.utils` into `weldx.asdf.util` [[#247]](https://github.com/BAMWelDX/weldx/pull/247) -- it is now allowed to merge a time-dependent `timedelta` subsystem into another `CSM` instance if the parent instance - has set an explicit reference time [[#268]](https://github.com/BAMWelDX/weldx/pull/268) - -### fixes - -- don't inline time dependent `LCS.coordinates` [[#222]](https://github.com/BAMWelDX/weldx/pull/222) -- fix "datetime64" passing for "timedelta64" in `xr_check_coords` [[#221]](https://github.com/BAMWelDX/weldx/pull/221) -- fix `time_ref_restore` not working correctly if no `time_ref` was - set [[#221]](https://github.com/BAMWelDX/weldx/pull/221) -- fix deprecated signature in `WXRotation` [[#224]](https://github.com/BAMWelDX/weldx/pull/224) -- fix a bug with singleton dimensions in xarray - interpolation/matmul [[#243]](https://github.com/BAMWelDX/weldx/pull/243) -- update some documentation formatting and links [[#247]](https://github.com/BAMWelDX/weldx/pull/247) -- fix `wx_shape` validation for scalar `Quantity` and `TimeSeries` - objects [[#256]](https://github.com/BAMWelDX/weldx/pull/256) -- fix a case where `CSM.time_union()` would return with mixed `DateTimeIndex` and `TimeDeltaIndex` - types [[#268]](https://github.com/BAMWelDX/weldx/pull/268) - -### dependencies - -- Add [PyFilesystem](https://docs.pyfilesystem.org/en/latest/)(`fs`) as new dependency -- Add [k3d](https://github.com/K3D-tools/K3D-jupyter) as new dependency -- restrict `scipy<1.6` - pending [ASDF #916](https://github.com/asdf-format/asdf/issues/916) [[#224]](https://github.com/BAMWelDX/weldx/pull/224) -- set minimum Python version to - 3.8 [[#229]](https://github.com/BAMWelDX/weldx/pull/229)[[#255]](https://github.com/BAMWelDX/weldx/pull/255) -- only import some packages upon first use [[#247]](https://github.com/BAMWelDX/weldx/pull/247) -- Add [meshio](https://pypi.org/project/meshio/) as new dependency [#265](https://github.com/BAMWelDX/weldx/pull/265) - -## 0.2.2 (30.11.2020) - -### added - -- Added `weldx.utility.ureg_check_class` class decorator to enable `pint` dimensionality checks with `@dataclass` - . [[#179]](https://github.com/BAMWelDX/weldx/pull/179) -- Made coordinates and orientations optional for LCS schema. Missing values are interpreted as unity - translation/rotation. An empty LCS object represents a unity transformation - step. [[#177]](https://github.com/BAMWelDX/weldx/pull/177) -- added `weldx.utility.lcs_coords_from_ts` function [[#199]](https://github.com/BAMWelDX/weldx/pull/199) -- add a tutorial with advanced use case for combining groove interpolation with different TCP movements and distance - calculations [[#199]](https://github.com/BAMWelDX/weldx/pull/199) - -### changes - -- refactor welding groove classes [[#181]](https://github.com/BAMWelDX/weldx/pull/181) - - refactor groove codebase to make use of subclasses and classnames for more generic functions - - add `_meta` attribute to subclasses that map class attributes (dataclass parameters) to common names - - rework `get_groove` to make use of new class layout and parse function arguments -- create `weldx.welding` module (contains GMAW processes and groove - definitions) [[#181]](https://github.com/BAMWelDX/weldx/pull/181) -- move `GmawProcessTypeAsdf` to `asdf.tags` folder [[#181]](https://github.com/BAMWelDX/weldx/pull/181) -- reorder module imports in `weldx.__init__` [[#181]](https://github.com/BAMWelDX/weldx/pull/181) -- support timedelta dtypes in ASDF `data_array/variable` [[#191]](https://github.com/BAMWelDX/weldx/pull/191) -- add `set_axes_equal` option to some geometry plot functions (now defaults - to `False`) [[#199]](https://github.com/BAMWelDX/weldx/pull/199) -- make `utility.sine` public function [[#199]](https://github.com/BAMWelDX/weldx/pull/199) -- switch to setuptools_scm versioning and move package metadata to - setup.cfg [[#206]](https://github.com/BAMWelDX/weldx/pull/206) - -### ASDF - -- refactor ISO 9692-1 groove schema definitions and classes [[#181]](https://github.com/BAMWelDX/weldx/pull/181) - - move base schema definitions in file `terms-1.0.0.yaml` to `weldx/groove` - - split old schema into multiple files (1 per groove type) and create folder `iso_9692_1_2013_12` - -## 0.2.1 (26.10.2020) - -### changes - -- Documentation - - Documentation is [published on readthedocs](https://weldx.readthedocs.io/en/latest/) - - API documentation is now available - - New tutorial about 3 dimensional geometries [[#105]](https://github.com/BAMWelDX/weldx/pull/105) -- `CoordinateSystemManager` - - supports multiple time formats and can get a reference time [[#162]](https://github.com/BAMWelDX/weldx/pull/162) - - each instance can be named - - gets a `plot` function to visualize the graph - - coordinate systems can be updated using `add_cs` - - supports deletion of coordinate systems - - instances can now be merged and unmerged -- `LocalCoordinateSystem` - - `LocalCoordinateSystem` now accepts `pd.TimedeltaIndex` and `pint.Quantity` as `time` inputs when provided with a - reference `pd.Timestamp` as `time_ref` [[#97]](https://github.com/BAMWelDX/weldx/pull/97) - - `LocalCoordinateSystem` now accepts `Rotation`-Objects - as `orientation` [[#97]](https://github.com/BAMWelDX/weldx/pull/97) - - Internal structure of `LocalCoordinateSystem` is now based on `pd.TimedeltaIndex` and a reference `pd.Timestamp` - instead of `pd.DatetimeIndex`. As a consequence, providing a reference timestamp is now - optional. [[#126]](https://github.com/BAMWelDX/weldx/pull/126) -- `weldx.utility.xr_interp_like` now accepts non-iterable scalar inputs for - interpolation [[#97]](https://github.com/BAMWelDX/weldx/pull/97) -- add `pint` compatibility to some `geometry` classes (**experimental**) - - when passing quantities to constructors (and some functions), values get converted to default unit `mm` and passed - on as magnitude - - old behavior is preserved -- add `weldx.utility.xr_check_coords` function to check coordinates of xarray object against dtype and value - restrictions [[#125]](https://github.com/BAMWelDX/weldx/pull/125) -- add `weldx.utility._sine` to easily create sine TimeSeries [[#168]](https://github.com/BAMWelDX/weldx/pull/168) -- enable `force_ndarray_like=True` as default option when creating the - global `pint.UnitRegistry` [[#167]](https://github.com/BAMWelDX/weldx/pull/167) -- `ut.xr_interp_like` keeps variable and coordinate attributes from original - DataArray [[#174]](https://github.com/BAMWelDX/weldx/pull/174) -- rework `ut.to_pandas_time_index` to accept many different formats (LCS, - DataArray) [[#174]](https://github.com/BAMWelDX/weldx/pull/174) -- add utility functions for handling time coordinates to "weldx" - accessor [[#174]](https://github.com/BAMWelDX/weldx/pull/174) - -### ASDF extension & schemas - -- add `WxSyntaxError` exception for custom weldx ASDF syntax errors [[#99]](https://github.com/BAMWelDX/weldx/pull/99) -- add custom `wx_tag` validation and update `wx_property_tag` to allow new - syntax [[#99]](https://github.com/BAMWelDX/weldx/pull/99) \ - the following syntax can be used: - ```yaml - wx_tag: http://stsci.edu/schemas/asdf/core/software-* # allow every version - wx_tag: http://stsci.edu/schemas/asdf/core/software-1 # fix major version - wx_tag: http://stsci.edu/schemas/asdf/core/software-1.2 # fix minor version - wx_tag: http://stsci.edu/schemas/asdf/core/software-1.2.3 # fix patchversion - ``` -- add basic schema layout and `GmawProcess` class for arc welding process - implementation [[#104]](https://github.com/BAMWelDX/weldx/pull/104) -- add example notebook and documentation for arc welding process [[#104]](https://github.com/BAMWelDX/weldx/pull/104) -- allow optional properties for validation with `wx_shape` by putting the name in brackets - like `(optional_prop)`[[#176]](https://github.com/BAMWelDX/weldx/pull/176) - -### fixes - -- fix propagating the `name` attribute when reading an ndarray `TimeSeries` object back from ASDF - files [[#104]](https://github.com/BAMWelDX/weldx/pull/104) -- fix `pint` regression in `TimeSeries` when mixing integer and float - values [[#121]](https://github.com/BAMWelDX/weldx/pull/121) - -## 0.2.0 (30.07.2020) - -### ASDF - -- add `wx_unit` and `wx_shape` validators -- add `doc/shape-validation.md` documentation for `wx_shape` [[#75]](https://github.com/BAMWelDX/weldx/pull/75) -- add `doc/unit-validation.md` documentation for `wx_unit` -- add unit validation to `iso_groove-1.0.0.yaml` -- fixed const/enum constraints and properties in `iso_groove-1.0.0.yaml` -- add NetCDF inspired common types (`Dimension`,`Variable`) with corresponding asdf serialization classes -- add asdf serialization classes and schemas for `xarray.DataArray`, - `xarray.Dataset`, `weldx.transformations.LocalCoordinateSystem` and - `weldx.transformations.CoordinateSystemManager`. -- add test for `xarray.DataArray`, `xarray.Dataset`, `weldx.transformations.LocalCoordinateSystem` and - `weldx.transformations.CoordinateSystemManager` serialization. -- allow using `pint.Quantity` coordinates - in `weldx.transformations.LocalCoordinateSystem` [[#70]](https://github.com/BAMWelDX/weldx/pull/70) -- add measurement related ASDF serialization classes: [[#70]](https://github.com/BAMWelDX/weldx/pull/70) - - `equipment/generic_equipment-1.0.0` - - `measurement/data-1.0.0` - - `data_transformation-1.0.0` - - `measurement/error-1.0.0` - - `measurement/measurement-1.0.0` - - `measurement/measurement_chain-1.0.0` - - `measurement/signal-1.0.0` - - `measurement/source-1.0.0` -- add example notebook for measurement chains in tutorials [[#70]](https://github.com/BAMWelDX/weldx/pull/70) -- add support for `sympy` expressions with `weldx.core.MathematicalExpression` and ASDF serialization - in `core/mathematical_expression-1.0.0` [[#70]](https://github.com/BAMWelDX/weldx/pull/70) - , [[#76]](https://github.com/BAMWelDX/weldx/pull/76) -- add class to describe time series - `weldx.core.TimeSeries` [[#76]](https://github.com/BAMWelDX/weldx/pull/76) -- add `wx_property_tag` validator [[#72]](https://github.com/BAMWelDX/weldx/pull/72) - - the `wx_property_tag` validator restricts **all** properties of an object to a single tag. For example the following - object can have any number of properties but all must be of type `tag:weldx.bam.de:weldx/time/timestamp-1.0.0` - ```yaml - type: object - additionalProperties: true # must be true to allow any property - wx_property_tag: "tag:weldx.bam.de:weldx/time/timestamp-1.0.0" - ``` - It can be used as a "named" mapping replacement instead of YAML `arrays`. -- add `core/transformation/rotation-1.0.0` schema that implements `scipy.spatial.transform.Rotation` - and `transformations.WXRotation` class to create custom tagged `Rotation` instances for custom - serialization. [[#79]](https://github.com/BAMWelDX/weldx/pull/79) -- update requirements to `asdf>=2.7` [[#83]](https://github.com/BAMWelDX/weldx/pull/83) -- update `anyOf` to `oneOf` in ASDF schemas [[#83]](https://github.com/BAMWelDX/weldx/pull/83) -- add `__eq__` functions to `LocalCoordinateSystem` - and `CoordinateSystemManager` [[#87]](https://github.com/BAMWelDX/weldx/pull/87) - -## 0.1.0 (05.05.2020) - -### 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 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 diff --git a/CHANGELOG.rst b/CHANGELOG.rst new file mode 100644 index 000000000..c3c4c44e2 --- /dev/null +++ b/CHANGELOG.rst @@ -0,0 +1,937 @@ +Release Notes +============= + +0.5.0 (unreleased) +------------------ + +added +~~~~~ + +- added “units” (exact) and “dimensionality” (dimensionality + compatible) checking options to `util.xr_check_coords` + `[#442] `__ +- `Time` class that can be initialized from several other time types + and provides time related utility functions + `[#433] `__ +- `TimeSeries` now supports setting a ``reference_time`` absolute + time values for interpolation + `[#440] `__ +- `LocalCoordinateSystem.from_axis_vectors` and + `CoordinateSystemManager.create_cs_from_axis_vectors` + `[#472] `__ +- added PyTest flags to use `WeldxFile` internally in + `asdf.util.read_buffer` and `asdf.util.write_buffer` + `[#469] `__. +- added classes and functions at the top-level of the package to the + documentation + `[#437] `__. +- added `weldx.asdf.util.get_highest_tag_version` utility function + `[#523] `__. + +removed +~~~~~~~ + +- removed functions now covered by `Time`: + ``pandas_time_delta_to_quantity``, ``to_pandas_time_index``, + ``get_time_union`` + `[#448] `__ +- removed custom ``wx_tag`` validator + `[#461] `__ +- attrdict dependency replaced with a custom implementation of + recursive dicts + `[#470] `__. +- ``from_xyz``, ``from_xy_and_orientation``, + ``from_yz_and_orientation`` and ``from_xz_and_orientation`` from + `LocalCoordinateSystem`. Use `LocalCoordinateSystem.from_axis_vectors` instead. + `[#472] `__ +- ``create_cs_from_xyz``, ``create_cs_from_xy_and_orientation``, + ``create_cs_from_yz_and_orientation`` and + ``create_cs_from_xz_and_orientation`` from + `CoordinateSystemManager`. Use `CoordinateSystemManager.create_cs_from_axis_vectors` + instead. `[#472] `__ +- ``is_column_in_matrix``, ``is_row_in_matrix``, ``to_float_array``, + ``to_list``, ``matrix_is_close``, ``vector_is_close`` and + ``triangulate_geometry`` from `weldx.util` + `[#490] `__ +- remove the ``:`` syntax from ``wx_shape`` validation + `[#537] `__ + +changes +~~~~~~~ + +- move `welding.util.sine` utility function to `weldx.welding.util` + `[#439] `__ +- `LocalCoordinateSystem` and `CoordinateSystemManager` function + parameters related to time now support all types that are also + supported by the new `Time` class + `[#448] `__ +- `LocalCoordinateSystem.interp_time` returns static systems if only + a single time value is passed or if there is no overlap between the + interpolation time range and the coordinate systems time range. This + also affects the results of some `CoordinateSystemManager` methods + (`CoordinateSystemManager.get_cs` , `CoordinateSystemManager.interp_time`) + `[#476] `__ +- `util.WeldxAccessor.time_ref` setter now raises a `TypeError` if + `None` is passed to it + `[#489] `__ +- move xarray related utility functions into `weldx.util.xarray` and + all other ones into `weldx.util.util`. Content from both submodules + can still be accessed using `weldx.util` + `[#490] `__ +- xarray implementations for the `LocalCoordinateSystem` now operate + on time as a dimension instead of coordinates + `[#486] `__ +- `WeldxFile.copy` now creates a copy to a (optional) file. Before it + just returned a dictionary + `[#504] `__. +- changed the default `pint.Unit` formatting to short notation ``:~`` + `[#519] `__. + +fixes +~~~~~ + +- `WeldxFile.show_asdf_header` prints output on console, before it + only returned the header as parsed dict and string representation. + Also tweaked efficiency by not writing binary blocks + `[#459] `__, + `[#469] `__. +- Merging and unmerging multiple `CoordinateSystemManager` instances + now correctly preserves all attached data. + `[#494] `__. +- `util.compare_nested` can compare sets + `[#496] `__ +- `WeldxFile` respects ``mode`` argument also for BytesIO and file + handles `[#539] `__. + +documentation +~~~~~~~~~~~~~ + +- added installation guide with complete environment setup (Jupyterlab + with extensions) and possible problems and solutions + `[#450] `__ +- split API documentation into user classes/functions and a full API + reference `[#469] `__. + +ASDF +~~~~ + +- all schema version numbers set to ``0.1.0`` + `[#535] `__. +- add ``time/time`` schema to support `Time` class + `[#463] `__. +- rework ASDF extension to new asdf 2.8 API + `[#467] `__ + + - move schema files to ``weldx/schemas`` + - create extension manifest in ``weldx/manifests``. The manifest + also contains tag mappings for legacy tag names for backwards + compatibility. + - 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 ``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-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 + ``weldx.asdf.types.WeldxConverter.shape_from_tagged`` + +- provide legacy schema support in + ``weldx/schemas/weldx.bam.de/legacy`` + `[#533] `__ +- 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] `__ +- add ``asdf://weldx.bam.de/weldx/schemas/unit/quantity`` and + ``asdf://weldx.bam.de/weldx/schemas/unit/unit`` schemas + `[#522] `__ +- use ``asdf://weldx.bam.de/weldx/schemas/unit/quantity`` instead + of ``tag:stsci.edu:asdf/unit/quantity-1.1.0`` `[#542] `__. +- refactor properties named ``unit`` to ``units`` and use ``unit/unit`` + tag `[#551] `__. + +deprecations +~~~~~~~~~~~~ + +dependencies +~~~~~~~~~~~~ + +0.4.1 (20.07.2021) +------------------ + +added +~~~~~ + +- ``closed_mesh`` parameter to `Geometry.spatial_data` and + `SpatialData.from_geometry_raster` + `[#414] `__ +- `TimeSeries.plot` and `measurement.Signal.plot` + `[#420] `__ +- abstract base class `time.TimeDependent` + `[#460] `__ + + +changes +~~~~~~~ + +- `TimeSeries` ``__init__`` accepts `xarray.DataArray` as ``data`` + parameter `[#429] `__ +- The `LocalCoordinateSystem.time` and `TimeSeries.time` now return + an instance of `Time` + `[#464] `__ +- Fix wrong and incomplete type-hints + `[#435] `__ + + +ASDF +~~~~ + +- sort ``List[str]`` before serialization of most `weldx` classes to + avoid random reordering in the same file and enforce consistency. + `[#430] `__ + + +deprecations +~~~~~~~~~~~~ + +- ``lcs_coords_from_ts`` will be removed in version 0.5.0 + `[#426] `__ + + +0.4.0 (13.07.2021) +------------------ + +Release ``0.4.0`` brings many new major features to `weldx` + +Highlights +~~~~~~~~~~ + +- `Quality + Standards `__: + Users can now create and integrate their own quality standards by + defining new ASDF schema definitions and loading them into weldx. It + is possible to add new definitions or modify existing schemas to + create your own flavour of the weldx standard. +- `WeldxFile `__: + Create/Load/Modify asdf files directly using `WeldxFile` with many + helpful utility functions included. +- `TimeSeries + support `__ + for `LocalCoordinateSystem`: It is now possible to define a + time-dependent `LocalCoordinateSystem` with a simple function by + passing a `TimeSeries` object with a `MathematicalExpression` as + ``coordinates``. For an example, click the link above. +- `MeasurementChain `__ + The `measurement.MeasurementChain` has been reworked to be easier and more + flexible to use. + +full changelog below: + + +added +~~~~~ + +- add support for quality standards. Further information can be found + in the corresponding new tutorial. + `[#211] `__ +- added `asdf.util.get_schema_path` helper function + `[#325] `__ +- added `util.compare_nested` to check equality of two nested data + structures. `[#328] `__ +- added `WeldxFile` wrapper to handle asdf files with history and + schemas more easily. + `[#341] `__. +- add ``"step"`` as additional method to `util.xr_interp_like` + `[#363] `__ +- add `util.dataclass_nested_eq` decorator for dataclasses with + array-like fields + `[#378] `__ +- adds a `asdf.util.dataclass_serialization_class` utility function that + automatically generates the asdf serialization class for python + dataclasses. `[#380] `__ +- Added method to set the interpolation method to the `TimeSeries` + `[#353] `__ +- Add `TimeSeries.is_discrete` and `TimeSeries.is_expression` properties to + `TimeSeries` + `[#366] `__ +- Add `measurement.MeasurementChain.output_signal` property that returns the + output signal of the `measurement.MeasurementChain` + `[#394] `__ + + +changes +~~~~~~~ + +- `WXRotation.from_euler` now accepts a `pint.Quantity` as input. + `[#318] `__ +- move tests folder to ``weldx/tests`` + `[#323] `__ +- `asdf.util.get_yaml_header` received a new option parse, which optionally + returns the parsed YAML header as ``asdf.tagged.TaggedDict``. + `[#338] `__ +- refactor ``asdf_json_repr`` into `asdf.util.view_tree` + `[#339] `__ +- `TimeSeries.interp_time` + `[#353] `__ + + - now returns a new `TimeSeries` instead of a `xarray.DataArray` + - if the data has already been interpolated before, a warning is + emitted + - `TimeSeries` supports now all interpolation methods supported by + xarray + +- The `measurement.MeasurementChain` is now internally based on a + `networkx.DiGraph`. New functions are also added to the class to + simplify its usage. + `[#326] `__ The following + additional changes were applied during the update of the + `measurement.MeasurementChain`: + + - renamed ``DataTransformation`` class to `measurement.SignalTransformation` + - renamed ``Source`` to `measurement.SignalSource` + - Added additional functionality to `measurement.Signal`, + `measurement.SignalTransformation` and ``GenericEquipment`` + - Removed ``Data`` class + - Updated asdf schemas of all modified classes and the ones that + contained references to those classes + +- allow input of string quantities in `MathematicalExpression` + parameters and a few other places + `[#402] `__ + `[#416] `__ +- `LocalCoordinateSystem` ``__init__`` now accepts a `TimeSeries` as + input. All methods of the `CoordinateSystemManager` also support + this new behavior + `[#366] `__ +- During the creation of a `WeldxFile` the path of a passed custom + schema is resolved automatically + `[#412] `__. + + +documentation +~~~~~~~~~~~~~ + +- Add new tutorial about the `measurement.MeasurementChain` + `[#326] `__ +- Updated the measurement tutorial + `[#326] `__ + + +ASDF +~~~~ + +- fix inline array serialization for new 64bit inline limit + `[#218] `__ +- add `asdf.extension.WeldxExtension.yaml_tag_handles` to ``WeldxExtension`` + `[#218] `__ +- add ``uuid-1.0.0.yaml`` schema as basic version 4 UUID implementation + `[#330] `__ +- add ``core/graph/di_node``, ``core/graph/di_edge`` & + ``core/graph/di_graph`` for implementing a generic + `networkx.DiGraph` + `[#330] `__ +- compatibility with ASDF-2.8 + `[#355] `__ +- data attached to an instance of the `CoordinateSystemManager` is now + also stored in a WelDX file + `[#364] `__ +- replace references to base asdf tags with ``-1.*`` version wildcard + `[#373] `__ +- update ``single-pass-weldx.1.0.0.schema`` to allow groove types by + wildcard `[#373] `__ +- fix attributes serialization of DataSet children + `[#384] `__. +- update ``wx_shape`` syntax in ``local_coordinate_system-1.0.0`` + `[#366] `__ +- add custom ``wx_shape`` validation to ``variable-1.0.0`` + `[#366] `__ +- remove outdated `TimeSeries` shape validation code + `[#399] `__ +- use asdf tag validation pattern for ``wx_property_tag`` + `[#410] `__ +- update `MathematicalExpression` schema + `[#410] `__ + + +fixes +~~~~~ + +- added check for symmetric key difference for mappings with + `util.compare_nested` + `[#377] `__ + + +deprecations +~~~~~~~~~~~~ + +- deprecate ``wx_tag`` validator (use default asdf uri pattern + matching) `[#410] `__ + + +0.3.3 (30.03.2021) +------------------ + +This is a bugfix release to correctly include the asdf schema files in +conda builds. `[#314] `__ + + +ASDF +~~~~ + +- fix required welding wire metadata in + ``single-pass-weldx.1.0.0.schema`` + `[#316] `__ + + +0.3.2 (29.03.2021) +------------------ + + +added +~~~~~ + +- `util.deprecated` decorator + `[#295] `__ + + +removed +~~~~~~~ + +- ``rotation_matrix_x``, ``rotation_matrix_y`` and + ``rotation_matrix_z`` + `[#317] `__ + + +dependencies +~~~~~~~~~~~~ + +- restrict ``scipy!=1.6.0,scipy!=1.6.1`` + `[#300] `__ + + +ASDF +~~~~ + +- add validators to ``rotation-1.0.0.yaml`` & + ``gas_component-1.0.0.yaml`` + `[#303] `__ +- update descriptions in ``single-pass-weldx.1.0.0.schema`` + `[#308] `__ + + +fixes +~~~~~ + +- prevent creation of `welding.groove.iso_9692_1.IsoBaseGroove` with negative parameters + `[#306] `__ + + +0.3.1 (21.03.2021) +------------------ + + +added +~~~~~ + +- plot function for `measurement.MeasurementChain` + `[#288] `__ + + +ASDF +~~~~ + +- remove the ``additionalProperties`` restriction from + ``single_pass_weld-1.0.0.schema.yaml`` + `[#283] `__ +- allow scalar ``integer`` value in ``anyOf`` of + ``time_series-1.0.0.yaml`` to fix + `#282 `__ + `[#286] `__ +- add examples to schema files + `[#274] `__ + + +changes +~~~~~~~ + +- `CoordinateSystemManager.plot_graph` now renders static and time-dependent edges + differently `[#291] `__ +- use `pint` compatible array syntax in + `welding.groove.iso_9692_1.IsoBaseGroove.to_profile` methods + `[#189] `__ +- CSM and LCS plot function get a ``scale_vectors`` parameter. It + scales the plotted coordinate system vectors when using matplotlib as + backend `[#293] `__ + + +fixes +~~~~~ + +- A warning is now emitted if a `LocalCoordinateSystem` drops a + provided time during construction. This usually happens if the + coordinates and orientation only contain a single data point. + `[#285] `__ + + +0.3.0 (12.03.2021) +------------------ + + +added +~~~~~ + +- add `CoordinateSystemManager.relabel` + function `[#219] `__ +- add `SpatialData` class for storing 3D point data with optional + triangulation `[#234] `__ +- add ``plot`` function to + `SpatialData` `[#251] `__ +- add ``plot`` function to visualize `LocalCoordinateSystem` and + `CoordinateSystemManager` instances in 3d space + `[#231] `__ +- add `weldx.welding.groove.iso_9692_1.IsoBaseGroove.cross_sect_area` + property to compute cross sectional area between the workpieces + `[#248] `__. +- add `weldx.welding.util.compute_welding_speed` function + `[#248] `__. + + +ASDF +~~~~ + +- Add possibility to store meta data and content of an external file in + an ASDF file `[#215] `__ + + - Python class: ``asdf.ExternalFile`` + - Schema: ``core/file-1.0.0.yaml`` + +- Added support for serializing generic metadata and userdata + attributes for weldx classes. + `[#209] `__ + + - the provisional attribute names are ``wx_metadata`` and + ``wx_user`` + +- `None` values are removed from the asdf tree for all `weldx` + classes. `[#212] `__ +- add ``datamodels`` directory and example + ``http://weldx.bam.de/schemas/weldx/datamodels/single_pass_weld-1.0.0.schema`` + schema `[#190] `__ + + - schemas in the ``datamodels`` directory do not define any tags and + can be referenced in other schemas and as ``custom_schema`` when + reading/writing ``ASDF``-files + - the ``single_pass_weld-1.0.0.schema`` is an example schema for a + simple, linear, single pass GMAW application + - add ``core/geometry/point_cloud-1.0.0.yaml`` schema + `[#234] `__ + +- add file schema describing a simple linear welding application + ``datamodels/single_pass_weld-1.0.0.schema`` + `[#256] `__ + + +documentation +~~~~~~~~~~~~~ + +- Simplify tutorial code and enhance plots by using newly implemented + plot functions + `[#231] `__ + `[#251] `__ +- add AWS shielding gas descriptions to documentation + `[#270] `__ + + +changes +~~~~~~~ + +- pass variable names as tuple to ``sympy.lambdify`` in + `MathematicalExpression` to prevent sympy deprecation + `[#214] `__ +- set ``conda-forge`` as primary channel in ``environment.yaml`` and + ``build_env.yaml`` + `[#214] `__ +- set minimum Python version to 3.7 + `[#220] `__ +- `geometry.Profile.rasterize` can return list of rasterized shapes + instead of flat ndarray (with setting ``stack=False``) + `[#223] `__ +- `geometry.Profile.plot` plots individual line objects for each + shape (instead of a single line object) + `[#223] `__ +- remove jinja templates and related code + `[#228] `__ +- add ``stack`` option to most `geometry` classes for rasterization + `[#234] `__ +- The graph of a `CoordinateSystemManager` is now plotted with + `CoordinateSystemManager.plot_graph` instead of `CoordinateSystemManager.plot`. + `[#231] `__ +- add custom ``wx_shape`` validation for `TimeSeries` and + `pint.Quantity` `[#256] `__ +- refactor the `transformations` and `visualization` module into + smaller files `[#247] `__ +- refactor ``weldx.utility`` into `util` + `[#247] `__ +- refactor ``weldx.asdf.utils`` into `asdf.util` + `[#247] `__ +- it is now allowed to merge a time-dependent ``timedelta`` subsystem + into another `CoordinateSystemManager` instance if the parent instance has set an + explicit reference time + `[#268] `__ + + +fixes +~~~~~ + +- don not inline time dependent `LocalCoordinateSystem.coordinates` + `[#222] `__ +- fix “datetime64” passing for “timedelta64” in `util.xr_check_coords` + `[#221] `__ +- fix `util.WeldxAccessor.time_ref_restore` not working correctly if no ``time_ref`` was + set `[#221] `__ +- fix deprecated signature in `WXRotation` + `[#224] `__ +- fix a bug with singleton dimensions in xarray interpolation/matmul + `[#243] `__ +- update some documentation formatting and links + `[#247] `__ +- fix ``wx_shape`` validation for scalar `pint.Quantity` and + `TimeSeries` objects + `[#256] `__ +- fix a case where `CoordinateSystemManager.time_union` would return with mixed + `pandas.DatetimeIndex` and `pandas.TimedeltaIndex` types + `[#268] `__ + + +dependencies +~~~~~~~~~~~~ + +- Add `PyFilesystem `__ (``fs``) + as new dependency +- Add `k3d `__ as new + dependency +- restrict ``scipy<1.6`` pending `ASDF + #916 `__ + `[#224] `__ +- set minimum Python version to 3.8 + `[#229] `__\ `[#255] `__ +- only import some packages upon first use + `[#247] `__ +- Add `meshio `__ as new dependency + `#265 `__ + + +0.2.2 (30.11.2020) +------------------ + + +added +~~~~~ + +- Added `util.ureg_check_class` class decorator to enable + `pint` dimensionality checks with ``@dataclass`` + `[#179] `__. +- Made coordinates and orientations optional for LCS schema. Missing + values are interpreted as unity translation/rotation. An empty LCS + object represents a unity transformation step. + `[#177] `__ +- added `welding.util.lcs_coords_from_ts` function + `[#199] `__ +- add a tutorial with advanced use case for combining groove + interpolation with different TCP movements and distance calculations + `[#199] `__ + + +changes +~~~~~~~ + +- refactor welding groove classes + `[#181] `__ + + - refactor groove codebase to make use of subclasses and classnames + for more generic functions + - add ``_meta`` attribute to subclasses that map class attributes + (dataclass parameters) to common names + - rework `get_groove` to make use of new class layout and parse + function arguments + +- create `welding` module (contains GMAW processes and groove + definitions) `[#181] `__ +- move ``GmawProcessTypeAsdf`` to ``asdf/tags`` folder + `[#181] `__ +- reorder module imports in ``weldx.__init__`` + `[#181] `__ +- support timedelta dtypes in ASDF ``data_array/variable`` + `[#191] `__ +- add ``set_axes_equal`` option to some geometry plot functions (now + defaults to `False`) + `[#199] `__ +- make `welding.util.sine` public function + `[#199] `__ +- switch to setuptools_scm versioning and move package metadata to + setup.cfg `[#206] `__ + + +ASDF +~~~~ + +- refactor ISO 9692-1 groove schema definitions and classes + `[#181] `__ + + - move base schema definitions in file ``terms-1.0.0.yaml`` to + ``weldx/groove`` + - split old schema into multiple files (1 per groove type) and + create folder ``iso_9692_1_2013_12`` + + +0.2.1 (26.10.2020) +------------------ + + +changes +~~~~~~~ + +- Documentation + + - Documentation is `published on + readthedocs `__ + - API documentation is now available + - New tutorial about 3 dimensional geometries + `[#105] `__ + +- `CoordinateSystemManager` + + - supports multiple time formats and can get a reference time + `[#162] `__ + - each instance can be named + - gets a `CoordinateSystemManager.plot` function to visualize the graph + - coordinate systems can be updated using `CoordinateSystemManager.add_cs` + - supports deletion of coordinate systems + - instances can now be merged and unmerged + +- `LocalCoordinateSystem` + + - `LocalCoordinateSystem` now accepts `pandas.TimedeltaIndex` and + `pint.Quantity` as time inputs when provided with a + reference `pandas.Timestamp` as ``time_ref`` + `[#97] `__ + - `LocalCoordinateSystem` now accepts `WXRotation`-objects as + ``orientation`` + `[#97] `__ + - Internal structure of `LocalCoordinateSystem` is now based on + `pandas.TimedeltaIndex` and a reference `pandas.Timestamp` instead of + `pandas.DatetimeIndex`. As a consequence, providing a reference + timestamp is now optional. + `[#126] `__ + +- `util.xr_interp_like` now accepts non-iterable scalar + inputs for interpolation. + `[#97] `__ +- add `pint` compatibility to some `geometry` classes + (**experimental**) + + - when passing quantities to constructors (and some functions), + values get converted to default unit ``mm`` and passed on as + magnitude. + - old behavior is preserved. + +- add ``weldx.utility.xr_check_coords`` function to check coordinates + of xarray object against dtype and value restrictions + `[#125] `__ +- add ``weldx.utility._sine`` to easily create sine TimeSeries + `[#168] `__ +- enable ``force_ndarray_like=True`` as default option when creating + the global `pint.UnitRegistry` + `[#167] `__ +- `util.xr_interp_like` keeps variable and coordinate attributes from + original DataArray + `[#174] `__ +- rework ``util.to_pandas_time_index`` to accept many different formats + (LCS, DataArray) + `[#174] `__ +- add utility functions for handling time coordinates to “weldx” + accessor `[#174] `__ + +ASDF extension & schemas +~~~~~~~~~~~~~~~~~~~~~~~~ + +- add ``weldx.asdf.types.WxSyntaxError`` exception for custom weldx ASDF syntax errors + `[#99] `__ + +- | add custom ``wx_tag`` validation and update ``wx_property_tag`` to + allow new syntax + `[#99] `__ + | the following syntax can be used: + + .. code:: yaml + + wx_tag: http://stsci.edu/schemas/asdf/core/software-* # allow every version + wx_tag: http://stsci.edu/schemas/asdf/core/software-1 # fix major version + wx_tag: http://stsci.edu/schemas/asdf/core/software-1.2 # fix minor version + wx_tag: http://stsci.edu/schemas/asdf/core/software-1.2.3 # fix patch version + +- add basic schema layout and `GmawProcess` class for arc welding + process implementation + `[#104] `__ + +- add example notebook and documentation for arc welding process + `[#104] `__ + +- allow optional properties for validation with ``wx_shape`` by putting + the name in brackets like + ``(optional_prop)`` `[#176] `__ + + +fixes +~~~~~ + +- fix propagating the ``name`` attribute when reading an ndarray + `TimeSeries` object back from ASDF files + `[#104] `__ +- fix `pint` regression in `TimeSeries` when mixing integer and + float values `[#121] `__ + + +0.2.0 (30.07.2020) +------------------ + + +ASDF +~~~~ + +- add ``wx_unit`` and ``wx_shape`` validators + +- add ``doc/shape-validation.md`` documentation for ``wx_shape`` + `[#75] `__ + +- add ``doc/unit-validation.md`` documentation for ``wx_unit`` + +- add unit validation to ``iso_groove-1.0.0.yaml`` + +- fixed const/enum constraints and properties in + ``iso_groove-1.0.0.yaml`` + +- add NetCDF inspired common types (``Dimension``, ``Variable``) with + corresponding asdf serialization classes + +- add asdf serialization classes and schemas for `xarray.DataArray`, + `xarray.Dataset`, `weldx.transformations.LocalCoordinateSystem` + and `weldx.transformations.CoordinateSystemManager`. + +- add test for `xarray.DataArray`, `xarray.Dataset`, + `weldx.transformations.LocalCoordinateSystem` and + `weldx.transformations.CoordinateSystemManager` serialization. + +- allow using `pint.Quantity` coordinates in + `LocalCoordinateSystem` + `[#70] `__ + +- add measurement related ASDF serialization classes: + `[#70] `__ + + - ``equipment/generic_equipment-1.0.0`` + - ``measurement/data-1.0.0`` + - ``data_transformation-1.0.0`` + - ``measurement/error-1.0.0`` + - ``measurement/measurement-1.0.0`` + - ``measurement/measurement_chain-1.0.0`` + - ``measurement/signal-1.0.0`` + - ``measurement/source-1.0.0`` + +- add example notebook for measurement chains in tutorials + `[#70] `__ + +- add support for ``sympy`` expressions with + `weldx.core.MathematicalExpression` and ASDF serialization in + ``core/mathematical_expression-1.0.0`` + `[#70] `__, + `[#76] `__ + +- add class to describe time series - `weldx.core.TimeSeries` + `[#76] `__ + +- add ``wx_property_tag`` validator + `[#72] `__ + + the ``wx_property_tag`` validator restricts **all** properties of an + object to a single tag. For example the following object can have any + number of properties but all must be of type + ``tag:weldx.bam.de:weldx/time/timestamp-1.0.0`` + + .. code:: yaml + + type: object + additionalProperties: true # must be true to allow any property + wx_property_tag: "tag:weldx.bam.de:weldx/time/timestamp-1.0.0" + + It can be used as a “named” mapping replacement instead of YAML + ``arrays``. + +- add ``core/transformation/rotation-1.0.0`` schema that implements + ``scipy.spatial.transform.Rotation`` and + `WXRotation` class to create custom tagged + ``Rotation`` instances for custom serialization. + `[#79] `__ + +- update requirements to ``asdf>=2.7`` + `[#83] `__ + +- update ``anyOf`` to ``oneOf`` in ASDF schemas + `[#83] `__ + +- add ``__eq__`` methods to `LocalCoordinateSystem` and + `CoordinateSystemManager` + `[#87] `__ + + +0.1.0 (05.05.2020) +------------------ + + +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 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 diff --git a/README.md b/README.md deleted file mode 100644 index 427d2d814..000000000 --- a/README.md +++ /dev/null @@ -1,127 +0,0 @@ -# WelDX - data and quality standards for welding research data - -[![Documentation](https://readthedocs.org/projects/weldx/badge/?version=latest)](https://weldx.readthedocs.io/en/latest/?badge=latest) -[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/BAMWelDX/weldx/master?urlpath=lab/tree/tutorials/welding_example_01_basics.ipynb) -[![Anaconda-Server Badge](https://anaconda.org/conda-forge/weldx/badges/version.svg)](https://anaconda.org/conda-forge/weldx) -[![License](https://img.shields.io/badge/License-BSD%203--Clause-orange.svg)](https://opensource.org/licenses/BSD-3-Clause) - -## Overview - -Scientific welding data covers a wide range of physical domains and timescales and are measured using various different -sensors. Complex and highly specialized experimental setups at different welding institutes complicate the exchange of -welding research data further. - -The WelDX research project aims to foster the exchange of scientific data inside the welding community by developing and -establishing a new open source file format suitable for the documentation of experimental welding data and upholding -associated quality standards. In addition to fostering scientific collaboration inside the national and international -welding community an associated advisory committee will be established to oversee the future development of the file -format. The proposed file format will be developed with regard to current needs of the community regarding -interoperability, data quality and performance and will be published under an appropriate open source license. By using -the file format objectivity, comparability and reproducibility across different experimental setups can be improved. - -The project is under active development by -the [Welding Technology](https://www.bam.de/Navigation/EN/About-us/Organisation/Organisation-Chart/President/Department-9/Division-93/division93.html) -division at Bundesanstalt für Materialforschung und -prüfung (BAM). - -## Features - -WelDX provides several Python API to perform standard tasks like experiment design, data analysis, and experimental data -archiving. - -### Planning - -- Define measurement chains with all involved devices, error sources, and metadata annotations. -- Handle complex coordinate transformations needed to describe the movement of welding robots, workpieces, and sensors. -- Planing of welding experiments. -- convenient creation of [ISO 9692-1](https://www.iso.org/standard/62520.html) welding groove types. - -### Data analysis - -- Plotting routines to inspect measurement chains, workpieces (planned and welded). -- Analysis functions for standard measurements like track energy, welding speed to fill an ISO groove, and more to come. - -### Data archiving - -The ultimate goal of this project is to store all information about the experiment in a single file. We choose the -popular [ASDF](https://en.wikipedia.org/wiki/Advanced_Scientific_Data_Format) format for this task. This enables us to -store arbitrary binary data, while maintaining a human readable text based header. All information is stored in a tree -like structure, which makes it convenient to structure the data in arbitrary complex ways. - -The ASDF format and the provided extensions for WelDX types like - -- workpiece information (used alloys, geometries) -- welding process parameters (GMAW parameters) -- measurement data -- coordinate systems (robot movement, sensors) - -enables us to store the whole experimental pipeline performed in a modern laboratory. - -## Design goals - -We seek to provide a user-friendly, well documented programming interface. All functions and classes in WelDX have -attached documentation about the involved parameters (types and explanation), -see [API docs](https://weldx.readthedocs.io/en/stable/api.html). Further we provide -rich [Jupyter notebook tutorials](https://weldx.readthedocs.io/en/stable/tutorials.html) about the handling of the basic -workflows. - -All involved physical quantities used in `weldx` (lengths, angles, voltages, currents, etc.) should be attached with a -unit to ensure automatic conversion and correct mathematical handling. Units are being used in all standard features of -WelDX and are also archived in the ASDF files. This is implemented by the popular Python library -[Pint](https://pint.readthedocs.io/en/stable/), which flawlessly handles the creation and conversion of units and -dimensions. - -## Publications - -- Recommendations for an Open Science approach to welding process research data. Fabry, C., Pittner, A., Hirthammer, V. - et al. *Weld World* (2021). https://doi.org/10.1007/s40194-021-01151-x - -## Installation - -The WelDX package can be installed using conda or mamba package manager from the :code:`conda-forge` channel. These -managers originate from the freely available [Anaconda Python stack](https://docs.conda.io/en/latest/miniconda.html). If -you do not have Anaconda or Miniconda installed yet, we ask you to install `Miniconda-3`. Documentation for the -installation procedure can be -found [here](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html#regular-installation). After -this step you have access to the conda command and can proceed to installing the WelDX package. - -```console -conda install weldx -c conda-forge -``` - -The package is also available on pypi. - -```console -pip install weldx -``` - -## Documentation - -The full documentation is published on readthedocs.org. Click on one of the following links to get to the desired -version: - -- [latest](https://weldx.readthedocs.io/en/latest/) -- [stable](https://weldx.readthedocs.io/en/stable/) - -## Funding - -This research is funded by the Federal Ministry of Education and Research of Germany under project number 16QK12. - -## Repository status - -### Continuous Integration - -[![pytest](https://github.com/BAMWelDX/weldx/workflows/pytest/badge.svg?branch=master)](https://github.com/BAMWelDX/weldx/actions?query=workflow%3Apytest+branch%3Amaster) -[![conda build](https://github.com/BAMWelDX/weldx/workflows/conda%20build/badge.svg?branch=master)](https://github.com/BAMWelDX/weldx/actions?query=workflow%3A%22conda+build%22+branch%3Amaster) - -### 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) - -### Documentation build - -[![Documentation Status](https://readthedocs.org/projects/weldx/badge/?version=latest)](https://weldx.readthedocs.io/en/latest/?badge=latest) -[![documentation](https://github.com/BAMWelDX/weldx/workflows/documentation/badge.svg?branch=master)](https://github.com/BAMWelDX/weldx/actions?query=workflow%3Adocumentation+branch%3Amaster) diff --git a/README.rst b/README.rst new file mode 100644 index 000000000..51c4564ff --- /dev/null +++ b/README.rst @@ -0,0 +1,188 @@ +============================================================ +WelDX - data and quality standards for welding research data +============================================================ + +|Documentation| |Binder| |Anaconda-Server Badge| |License| + +Overview +-------- + +Scientific welding data covers a wide range of physical domains and +timescales and are measured using various different sensors. Complex and +highly specialized experimental setups at different welding institutes +complicate the exchange of welding research data further. + +The WelDX research project aims to foster the exchange of scientific +data inside the welding community by developing and establishing a new +open source file format suitable for the documentation of experimental +welding data and upholding associated quality standards. In addition to +fostering scientific collaboration inside the national and international +welding community an associated advisory committee will be established +to oversee the future development of the file format. The proposed file +format will be developed with regard to current needs of the community +regarding interoperability, data quality and performance and will be +published under an appropriate open source license. By using the file +format objectivity, comparability and reproducibility across different +experimental setups can be improved. + +The project is under active development by the `Welding +Technology `__ +division at Bundesanstalt für Materialforschung und -prüfung (BAM). + +Features +-------- + +WelDX provides several Python API to perform standard tasks like +experiment design, data analysis, and experimental data archiving. + +Planning +~~~~~~~~ + +- Define measurement chains with all involved devices, error sources, + and metadata annotations. +- Handle complex coordinate transformations needed to describe the + movement of welding robots, workpieces, and sensors. +- Planing of welding experiments. +- convenient creation of `ISO + 9692-1 `__ welding groove + types. + +Data analysis +~~~~~~~~~~~~~ + +- Plotting routines to inspect measurement chains, workpieces (planned + and welded). +- Analysis functions for standard measurements like track energy, + welding speed to fill an ISO groove, and more to come. + +Data archiving +~~~~~~~~~~~~~~ + +The ultimate goal of this project is to store all information about the +experiment in a single file. We choose the popular +`ASDF `__ +format for this task. This enables us to store arbitrary binary data, +while maintaining a human readable text based header. All information is +stored in a tree like structure, which makes it convenient to structure +the data in arbitrary complex ways. + +The ASDF format and the provided extensions for WelDX types like + +- workpiece information (used alloys, geometries) +- welding process parameters (GMAW parameters) +- measurement data +- coordinate systems (robot movement, sensors) + +enables us to store the whole experimental pipeline performed in a +modern laboratory. + +Design goals +------------ + +We seek to provide a user-friendly, well documented programming +interface. All functions and classes in WelDX have attached +documentation about the involved parameters (types and explanation), see +`API docs `__. Further +we provide rich `Jupyter notebook +tutorials `__ +about the handling of the basic workflows. + +All involved physical quantities used in ``weldx`` (lengths, angles, +voltages, currents, etc.) should be attached with a unit to ensure +automatic conversion and correct mathematical handling. Units are being +used in all standard features of WelDX and are also archived in the ASDF +files. This is implemented by the popular Python library +`Pint `__, which flawlessly +handles the creation and conversion of units and dimensions. + +Publications +------------ + +- Recommendations for an Open Science approach to welding process + research data. Fabry, C., Pittner, A., Hirthammer, V. et al. *Weld + World* (2021). https://doi.org/10.1007/s40194-021-01151-x + +Installation +------------ + +The WelDX package can be installed using conda or mamba package manager +from the :code:``conda-forge`` channel. These managers originate from +the freely available `Anaconda Python +stack `__. If you do not +have Anaconda or Miniconda installed yet, we ask you to install +``Miniconda-3``. Documentation for the installation procedure can be +found +`here `__. +After this step you have access to the conda command and can proceed to +installing the WelDX package. + +.. code:: console + + conda install weldx -c conda-forge + +The package is also available on pypi. + +.. code:: console + + pip install weldx + +Documentation +------------- + +The full documentation is published on readthedocs.org. Click on one of +the following links to get to the desired version: + +- `latest `__ +- `stable `__ + +Funding +------- + +This research is funded by the Federal Ministry of Education and +Research of Germany under project number 16QK12. + +Repository status +----------------- + +Continuous Integration +~~~~~~~~~~~~~~~~~~~~~~ + +|pytest| |conda build| + +Code Status +~~~~~~~~~~~ + +|static analysis| |pre-commit.ci status| |Codacy Badge| |codecov| +|DeepSource| + +Documentation build +~~~~~~~~~~~~~~~~~~~ + +|Documentation Status| |documentation| + +.. |Documentation| image:: https://readthedocs.org/projects/weldx/badge/?version=latest + :target: https://weldx.readthedocs.io/en/latest/?badge=latest +.. |Binder| image:: https://mybinder.org/badge_logo.svg + :target: https://mybinder.org/v2/gh/BAMWelDX/weldx/master?urlpath=lab/tree/tutorials/welding_example_01_basics.ipynb +.. |Anaconda-Server Badge| image:: https://anaconda.org/conda-forge/weldx/badges/version.svg + :target: https://anaconda.org/conda-forge/weldx +.. |License| image:: https://img.shields.io/badge/License-BSD%203--Clause-orange.svg + :target: https://opensource.org/licenses/BSD-3-Clause +.. |pytest| image:: https://github.com/BAMWelDX/weldx/workflows/pytest/badge.svg?branch=master + :target: https://github.com/BAMWelDX/weldx/actions?query=workflow%3Apytest+branch%3Amaster +.. |conda build| image:: https://github.com/BAMWelDX/weldx/workflows/conda%20build/badge.svg?branch=master + :target: https://github.com/BAMWelDX/weldx/actions?query=workflow%3A%22conda+build%22+branch%3Amaster +.. |static analysis| image:: https://github.com/BAMWelDX/weldx/workflows/static%20analysis/badge.svg?branch=master + :target: https://github.com/BAMWelDX/weldx/actions?query=workflow%3A%22static+analysis%22+branch%3Amaster +.. |pre-commit.ci status| image:: https://results.pre-commit.ci/badge/github/BAMWelDX/weldx/master.svg + :target: https://results.pre-commit.ci/latest/github/BAMWelDX/weldx/master +.. |Codacy Badge| image:: https://api.codacy.com/project/badge/Grade/5e7ede6d978249a781e5c580ed1c813f + :target: https://www.codacy.com/gh/BAMWelDX/weldx?utm_source=github.com&utm_medium=referral&utm_content=BAMWelDX/weldx&utm_campaign=Badge_Grade +.. |codecov| image:: https://codecov.io/gh/BAMWelDX/weldx/branch/master/graph/badge.svg + :target: https://codecov.io/gh/BAMWelDX/weldx +.. |DeepSource| image:: https://static.deepsource.io/deepsource-badge-light-mini.svg + :target: https://deepsource.io/gh/BAMWelDX/weldx/?ref=repository-badge +.. |Documentation Status| image:: https://readthedocs.org/projects/weldx/badge/?version=latest + :target: https://weldx.readthedocs.io/en/latest/?badge=latest +.. |documentation| image:: https://github.com/BAMWelDX/weldx/workflows/documentation/badge.svg?branch=master + :target: https://github.com/BAMWelDX/weldx/actions?query=workflow%3Adocumentation+branch%3Amaster diff --git a/doc/changelog_link.rst b/doc/changelog_link.rst index 6876aaadf..b431f2784 100644 --- a/doc/changelog_link.rst +++ b/doc/changelog_link.rst @@ -1,2 +1,2 @@ .. py:currentmodule:: weldx -.. mdinclude:: ../CHANGELOG.md +.. include:: ../CHANGELOG.rst diff --git a/doc/conf.py b/doc/conf.py index e4d0090b9..aef094497 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -26,18 +26,18 @@ def _workaround_imports_typechecking(): """Load some packages needed for type annotations.""" - import ipywidgets - import pandas as _ - import xarray + import ipywidgets # noqa + import pandas # noqa + import xarray # noqa def _prevent_sphinx_circular_imports_bug(): # https://github.com/sphinx-doc/sphinx/issues/9243 - import sphinx.builders.html - import sphinx.builders.latex - import sphinx.builders.texinfo - import sphinx.builders.text - import sphinx.ext.autodoc + import sphinx.builders.html # noqa + import sphinx.builders.latex # noqa + import sphinx.builders.texinfo # noqa + import sphinx.builders.text # noqa + import sphinx.ext.autodoc # noqa _prevent_sphinx_circular_imports_bug() @@ -82,7 +82,6 @@ def _prevent_sphinx_circular_imports_bug(): # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - "m2r2", "sphinxcontrib.napoleon", "nbsphinx", "sphinx.ext.autodoc", @@ -140,7 +139,6 @@ def _prevent_sphinx_circular_imports_bug(): # The suffix of source filenames. source_suffix = { ".rst": "restructuredtext", - ".md": "markdown", } # The encoding of source files. diff --git a/doc/index.rst b/doc/index.rst index 32b5a2d5f..1ce93a6e6 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -1,9 +1,4 @@ -============================================================ -WelDX - data and quality standards for welding research data -============================================================ - -.. mdinclude:: ../README.md - :start-line: 8 +.. include:: ../README.rst .. toctree:: :hidden: diff --git a/doc/install.rst b/doc/install.rst index ee1c6eb66..9e2205a4c 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -15,6 +15,10 @@ The package is also available on pypi and can be installed via *pip*:: pip install weldx +As weldx currently depends on the package ``bottleneck``, which contains C/C++ code, you will need a working C/C++ compiler. +The conda package does not have this requirement as it only installs pre-compiled binaries. So if you do not know how +to install a working compiler, we strongly encourage using the conda package. + Setting up Jupyter Lab ---------------------- diff --git a/weldx/__init__.py b/weldx/__init__.py index 7a4283383..fab3c59ff 100644 --- a/weldx/__init__.py +++ b/weldx/__init__.py @@ -41,8 +41,10 @@ U_ Time TimeSeries + MathematicalExpression CoordinateSystemManager LocalCoordinateSystem + WXRotation **Geometry** @@ -120,14 +122,13 @@ # main modules import weldx.time -import weldx.util # import this first to avoid circular dependencies +import weldx.util # import this second to avoid circular dependencies import weldx.core import weldx.transformations import weldx.config import weldx.geometry import weldx.welding - # class imports to weldx namespace from weldx.config import Config from weldx.core import MathematicalExpression, TimeSeries diff --git a/weldx/asdf/file.py b/weldx/asdf/file.py index 45d207708..64cc9a5dd 100644 --- a/weldx/asdf/file.py +++ b/weldx/asdf/file.py @@ -2,10 +2,10 @@ import copy import pathlib from collections import UserDict -from collections.abc import MutableMapping +from collections.abc import MutableMapping, ValuesView from contextlib import contextmanager from io import BytesIO, IOBase -from typing import IO, Dict, List, Mapping, Optional, Union +from typing import IO, AbstractSet, Any, Dict, List, Mapping, Optional, Tuple, Union import asdf import numpy as np @@ -421,6 +421,7 @@ def sync( version: str = None, **kwargs, ): + """Get this docstring overwritten by AsdfFile.update.""" self._asdf_handle.update( all_array_storage=all_array_storage, all_array_compression=all_array_compression, @@ -453,6 +454,158 @@ def fromkeys(cls, iterable, default=None) -> "WeldxFile": tree = dict.fromkeys(iterable, default) return WeldxFile(tree=tree, mode="rw") + def values(self) -> ValuesView: + """Return a view list like object of the file content. + + Returns + ------- + ValuesView : + a view on the values. + + """ + return super().values() + + def keys(self) -> AbstractSet: + """Return a set of keys/attributes stored in this file. + + Returns + ------- + KeysView : + all keys stored at the root of this file. + """ + return super().keys() + + def clear(self): + """Remove all data from file.""" + # TODO: we do not want to delete the history, software. + super().clear() + + def get(self, key, default=None): + """Get data attached to given key from file. + + Parameters + ---------- + key : + The name of the data. + default : + The default is being returned in case the given key cannot be found. + + Raises + ------ + KeyError + Raised if the given key cannot be found and no default was provided. + """ + return super().get(key, default=default) + + def update(self, mapping: Mapping, **kwargs): + """Update this file from mapping or iterable mapping and kwargs. + + Parameters + ---------- + mapping : + a key, value paired like structure or an iterable of keys. + kwargs : + any key value pair you can think of. + + Notes + ----- + Let the mapping parameter denote E, and let the kwargs parameter denote F. + If present and has a .keys() method, does: for k in E: D[k] = E[k] + If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v + In either case, this is followed by: for k, v in F.items(): D[k] = v + + Examples + -------- + Let us update one weldx file with another one. + >>> a = WeldxFile(tree=dict(x=42), mode="rw") + >>> b = WeldxFile(tree=dict(x=23, y=0), mode="rw") + + We pass all data of ``b`` to ``a`` while adding another key value pair. + + >>> a.update(b, foo="bar") + + # remove asdf meta data for easy comparision + >>> del a["asdf_library"], a["history"] + >>> a.data + {'x': 23, 'y': 0, 'foo': 'bar'} + + Or we can update with an iterable of key, value tuples. + >>> data = [('x', 0), ('y', -1)] + >>> a.update(data) + >>> a.data + {'x': 0, 'y': -1, 'foo': 'bar'} + """ + # TODO: we do not want to manipulate the history, software. + super().update(mapping, **kwargs) + + def items(self) -> AbstractSet[Tuple[Any, Any]]: + """Return a set-like object providing a view on this files items. + + Returns + ------- + ItemsView : + view on items. + """ + return super().items() + + def setdefault(self, key, default=None): + """Set a default for given key. + + The passed default object will be returned in case the requested key + is not present in the file. + + Parameters + ---------- + key : + key name + default : + object to return in case key is not present in the file. + """ + super().setdefault(key, default=default) + + def pop(self, key, default=None) -> Any: + """Get and remove the given key from the file. + + Parameters + ---------- + key : + key name + default : + object to return in case key is not present in the file. + + Returns + ------- + object : + the object value of given key. If key was not found, return the default. + + Examples + -------- + Let us remove and store some data from a weldx file. + >>> a = WeldxFile(tree=dict(x=42, y=0), mode="rw") + >>> x = a.pop("x") + >>> x + 42 + >>> "x" not in a.keys() + True + """ + # TODO: we do not want to delete the history, software. + return super().pop(key, default=default) + + def popitem(self) -> Any: + """Remove the item that was last inserted into the file. + + Notes + ----- + In versions before 3.7, the popitem() method removes a random item. + + Returns + ------- + object : + the last item. + """ + # TODO: we do not want to delete the history, software. + return super().popitem() + def add_history_entry(self, change_desc: str, software: dict = None) -> None: """Add an history_entry to the file. @@ -507,7 +660,7 @@ def copy( The desired output file. If no file is given, an in-memory file will be created. overwrite : - If `filename_or_file_like` points to a path or filename which already + If ``filename_or_file_like`` points to a path or filename which already exists, this flag determines if it would be overwritten or not. Returns @@ -555,6 +708,7 @@ def as_attr(self) -> MutableMapping: 'Nikolai Nikolajewitsch Benardos' We can also change the data easily + >>> wfa.wx_meta.welder = "Myself" >>> wfa.wx_meta.welder 'Myself' @@ -640,11 +794,12 @@ def _ipython_display_(self): # this will be called in Jupyter Lab, but not in a plain notebook. from IPython.core.display import display - display(self.show_asdf_header(use_widgets=False, _interactive=True)) + display(self.show_asdf_header(use_widgets=True, _interactive=True)) class _HeaderVisualizer: def __init__(self, asdf_handle: AsdfFile): + # TODO: this ain't thread-safe! # take a copy of the handle to avoid side effects! copy._deepcopy_dispatch[np.ndarray] = lambda x, y: x try: @@ -693,87 +848,3 @@ def _show_interactive( @staticmethod def _show_non_interactive(buff: BytesIO): print(get_yaml_header(buff)) - - -# Methods of UserDict do not follow the NumPy doc convention. -WeldxFile.keys.__doc__ = """Return a set of keys/attributes stored in this file. -Returns -------- -keys : - all keys stored at the root of this file. -""" - -WeldxFile.clear.__doc__ = """Remove all data from file.""" - -WeldxFile.copy.__doc__ = """Copies the file.""" # TODO: interface - -WeldxFile.get.__doc__ = """Gets data attached to given key from file. - -Parameters ----------- -key : - The name of the data. -default : - The default is being returned in case the given key cannot be found. - -Raises ------- -KeyError - Raised if the given key cannot be found and no default was provided. -""" - -WeldxFile.update.__doc__ = """Update D from mapping/iterable E and F. - -Parameters ----------- -mapping : - -F: - -Notes ------ -If E present and has a .keys() method, does: for k in E: D[k] = E[k] -If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v -In either case, this is followed by: for k, v in F.items(): D[k] = v -""" - - -WeldxFile.items.__doc__ = """Returns a set-like object providing a view on this files items. - -Returns -------- -dict_items : - view on items. -""" - -WeldxFile.setdefault.__doc__ = """Sets a default for given name. - -The passed default object will be returned in case the requested key is not present -in the file. - -Parameters ----------- -key : - key name -default : - object to return in case key is not present in the file. -""" - -WeldxFile.pop.__doc__ = """Get and remove the given key from the file. - -Parameters ----------- -key : - key name -default : - object to return in case key is not present in the file. -""" - -WeldxFile.popitem.__doc__ = """Removes the item that was last inserted into the file. - -Notes ------ -In versions before 3.7, the popitem() method removes a random item. -""" - -WeldxFile.values.__doc__ = """Returns a view list like object of the file content.""" diff --git a/weldx/transformations/__init__.py b/weldx/transformations/__init__.py index 14d251878..aa3e45c9d 100644 --- a/weldx/transformations/__init__.py +++ b/weldx/transformations/__init__.py @@ -19,21 +19,7 @@ "vector_points_to_left_of_vector", ] +from ..util import _patch_mod_all # noqa -def _patch_mod_all(): - """Hack the __module__ attribute of __all__ members to the current module. - - This is needed as Sphinx currently does not respect the all variable and ignores - the contents. By simulating that the "all" attributes are belonging here, we work - around this situation. Can be removed up this is fixed: - https://github.com/sphinx-doc/sphinx/issues/2021 - """ - import sys - - this_mod = sys.modules[__name__] - for name in __all__: - obj = getattr(this_mod, name) - obj.__module__ = __name__ - - -_patch_mod_all() +_patch_mod_all("weldx.transformations") +del _patch_mod_all diff --git a/weldx/util/__init__.py b/weldx/util/__init__.py index 0c74a0029..49f1105ae 100644 --- a/weldx/util/__init__.py +++ b/weldx/util/__init__.py @@ -1,4 +1,11 @@ """Contains utility functions and classes.""" from .util import * +from .util import __all__ as _util_all from .xarray import * +from .xarray import __all__ as _util_xarray + +__all__ = _util_all + _util_xarray +del _util_all, _util_xarray + +_patch_mod_all("weldx.util") # noqa diff --git a/weldx/util/util.py b/weldx/util/util.py index 60e53223f..1e57a177c 100644 --- a/weldx/util/util.py +++ b/weldx/util/util.py @@ -23,6 +23,18 @@ from weldx.constants import WELDX_UNIT_REGISTRY as ureg from weldx.time import Time +__all__ = [ + "WeldxDeprecationWarning", + "deprecated", + "ureg_check_class", + "inherit_docstrings", + "dataclass_nested_eq", + "compare_nested", + "is_jupyterlab_session", + "is_interactive_session", + "_patch_mod_all", +] + class WeldxDeprecationWarning(DeprecationWarning): """Deprecation warning type.""" @@ -385,3 +397,22 @@ def is_jupyterlab_session() -> bool: """ return any(re.search("jupyter-lab", x) for x in psutil.Process().parent().cmdline()) + + +def _patch_mod_all(module_name: str): + """Hack the __module__ attribute of __all__ members to the given module. + + Parameters + ---------- + module_name : + the fully qualified module name. + + This is needed as Sphinx currently does not respect the all variable and ignores + the contents. By simulating that the "all" attributes are belonging here, we work + around this situation. Can be removed up this is fixed: + https://github.com/sphinx-doc/sphinx/issues/2021 + """ + this_mod = sys.modules[module_name] + for name in getattr(this_mod, "__all__", ()): + obj = getattr(this_mod, name) + obj.__module__ = module_name diff --git a/weldx/util/xarray.py b/weldx/util/xarray.py index ed0bbc7f3..329134991 100644 --- a/weldx/util/xarray.py +++ b/weldx/util/xarray.py @@ -18,6 +18,21 @@ from weldx.constants import WELDX_UNIT_REGISTRY as ureg from weldx.time import Time, types_time_like, types_timestamp_like +__all__ = [ + "WeldxAccessor", + "mat_vec_mul", + "xr_3d_matrix", + "xr_3d_vector", + "xr_check_coords", + "xr_fill_all", + "xr_interp_coordinates_in_time", + "xr_interp_like", + "xr_interp_orientation_in_time", + "xr_is_orthogonal_matrix", + "xr_matmul", + "xr_transpose_matrix_data", +] + def mat_vec_mul(a, b) -> np.ndarray: """Matrix, Vector multiplication using matmul with newaxis for correct broadcasting. @@ -409,6 +424,7 @@ def xr_check_coords(dax: xr.DataArray, ref: dict) -> bool: Examples -------- + >>> import numpy as np >>> import pandas as pd >>> import xarray as xr >>> import weldx as wx