Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.6.2 #822

Merged
merged 8 commits into from
Nov 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ci:
for more information, see https://pre-commit.ci
autofix_prs: false
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
autoupdate_schedule: monthly
skip: []
submodules: false
exclude: '.*.weldx$|.*.wx$|.*.asdf$'
Expand Down Expand Up @@ -41,6 +41,7 @@ repos:
rev: 5.10.1
hooks:
- id: isort
additional_dependencies: ["toml"]
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
###############

********************
0.6.2 (tba)
0.6.2 (07.11.2022)
********************

Release ``0.6.2`` comes with new and updated tutorials and some minor fixes and code improvements.

added
=====

Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# YAML 1.2
---
title: weldx
version: 0.6.1
date-released: 2022-05-19
version: 0.6.2
date-released: 2022-11-07
authors:
- affiliation: "Bundesanstalt für Materialforschung und -prüfung (BAM)"
email: [email protected]
Expand Down
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A short primer in the steps needed to release a new version of the `weldx` packa
- [ ] create a PR that finalizes the code for the next version
- [ ] name the PR according to the version `vX.Y.Z` and add the `release`
tag ([example here](https://github.com/BAMWelDX/weldx/pull/419))
- [ ] make sure `CHANGELOG.rst` is up to date and enter current date to the release version
- [ ] make sure `CHANGELOG.rst` is up-to-date and enter current date to the release version
- [ ] add summarized release highlights where appropriate
- [ ] update the `CITATION.cff` version number and date
- [ ] search the project for `deprecated` and remove deprecated code
Expand Down
11 changes: 8 additions & 3 deletions weldx/core/generic_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ def __eq__(self, other):
return False
return self.data_array.identical(other._obj)

def __hash__(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are there any performance implications for this change? This will trigger equality comparisons for set and dict operations.

I've seen deepsource complaining about this. But can't we redirect the hash function to XArray (if they offer one)?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, mutable objects shouldn't be hashable at all. But there is a feature request for XArray to implement this any ways. pydata/xarray#4738

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the way I see it this should have been the implicit behavior anyway (because we implement __eq__) but somehow deepsource didn't pick it up

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if the equality operator is defined, and the hash method is just being derived, the object will still be hashable. So this is not just a cosmetic change to satisfy a linter.
Prior 0.6.2 this raised:

import weldx
x = weldx.core.MathematicalExpression("3*x")
gs = weldx.core.GenericSeries(x)
hash(gs)

TypeError: __hash__ method should return an integer

"""Implement as not hashable."""
return None

def _init_discrete(
self,
data: Union[pint.Quantity, xr.DataArray],
Expand Down Expand Up @@ -314,7 +318,7 @@ def _init_get_updated_units(

def _init_expression(
self,
expr: Union[str, MathematicalExpression],
expr: Union[str, MathematicalExpression, sympy.Expr],
dims: dict[str, str],
parameters: dict[str, Union[str, pint.Quantity, xr.DataArray]],
units: dict[str, pint.Unit],
Expand Down Expand Up @@ -775,9 +779,10 @@ def __add__(self, other):
return NotImplemented

@staticmethod
# skipcq: PYL-W0613
def interp_like(
obj: Any, dimensions: list[str] = None, accessor_mappings: dict = None
obj: Any, # skipcq: PYL-W0613
dimensions: list[str] = None, # skipcq: PYL-W0613
accessor_mappings: dict = None, # skipcq: PYL-W0613
) -> GenericSeries:
"""Interpolate using the coordinates of another object.

Expand Down
52 changes: 14 additions & 38 deletions weldx/welding/groove/iso_9692_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -1678,18 +1678,18 @@ def get_groove(
groove_type :
String specifying the Groove type:

- VGroove_
- UGroove_
- IGroove_
- UVGroove_
- VVGroove_
- HVGroove_
- HUGroove_
- DVGroove_
- DUGroove_
- DHVGroove_
- DHUGroove_
- FFGroove_
- VGroove
- UGroove
- IGroove
- UVGroove
- VVGroove
- HVGroove
- HUGroove
- DVGroove
- DUGroove
- DHVGroove
- DHUGroove
- FFGroove
workpiece_thickness :
workpiece thickness (Default value = None)
workpiece_thickness2 :
Expand Down Expand Up @@ -1759,8 +1759,6 @@ def get_groove(
are in Quantity values from pint and related units are accepted.
Required Groove attributes:

.. _IGroove:

IGroove:
t: workpiece_thickness
The workpiece thickness is a length Quantity, e.g.: "mm".
Expand All @@ -1769,8 +1767,6 @@ def get_groove(
The root gap is the distance of the 2 workpieces.
It can be 0 or None.

.. _VGroove:

VGroove:
t: workpiece_thickness
The workpiece thickness is a length Quantity, e.g.: "mm".
Expand All @@ -1785,8 +1781,6 @@ def get_groove(
The root face is the length of the Y-Groove which is not
part of the V. It can be 0.

.. _UGroove:

UGroove:
t: workpiece_thickness
The workpiece thickness is a length Quantity, e.g.: "mm".
Expand All @@ -1804,8 +1798,6 @@ def get_groove(
c: root_face
The root face is the height of the part below the U-segment.

.. _UVGroove:

UVGroove:
t: workpiece_thickness
The workpiece thickness is a length Quantity, e.g.: "mm".
Expand All @@ -1826,8 +1818,6 @@ def get_groove(
h: root_face
The root face is the height of the V-segment.

.. _VVGroove:

VVGroove:
t: workpiece_thickness
The workpiece thickness is a length Quantity, e.g.: "mm".
Expand All @@ -1848,8 +1838,6 @@ def get_groove(
This root face is the height of the part of the lower V-segment
and the root face c.

.. _HVGroove:

HVGroove:
t: workpiece_thickness
The workpiece thickness is a length Quantity, e.g.: "mm".
Expand All @@ -1863,8 +1851,6 @@ def get_groove(
c: root_face
The root face is the height of the part below the V-segment.

.. _HUGroove:

HUGroove:
t: workpiece_thickness
The workpiece thickness is a length Quantity, e.g.: "mm".
Expand All @@ -1882,8 +1868,6 @@ def get_groove(
c: root_face
The root face is the height of the part below the U-segment.

.. _DVGroove:

DVGroove:
t: workpiece_thickness
The workpiece thickness is a length Quantity, e.g.: "mm".
Expand All @@ -1906,8 +1890,6 @@ def get_groove(
The root face is the height of the lower V-segment.
Only c is needed.

.. _DUGroove:

DUGroove:
t: workpiece_thickness
The workpiece thickness is a length Quantity, e.g.: "mm".
Expand Down Expand Up @@ -1938,22 +1920,16 @@ def get_groove(
The root face is the height of the lower U-segment.
Only c is needed.

.. _DHVGroove:

DHVGroove:
This is a special case of the DVGroove_. The values of the angles are
This is a special case of the DVGroove. The values of the angles are
interpreted here as bevel angel. So you have only half of the size.
Accordingly the inputs beta1 (bevel angle) and beta2 (bevel angle 2)
are used.

.. _DHUGroove:

DHUGroove:
This is a special case of the DUGroove_.
This is a special case of the DUGroove.
The parameters remain the same.

.. _FFGroove:

FFGroove:
These grooves are identified by their code number. These correspond to the
key figure numbers from the standard. For more information, see the
Expand Down