Skip to content

Commit

Permalink
Merge branch 'master' into gs_var_doc
Browse files Browse the repository at this point in the history
  • Loading branch information
vhirtham authored Mar 16, 2022
2 parents f2a98bc + 0ba03fc commit 34e8e57
Show file tree
Hide file tree
Showing 7 changed files with 439 additions and 435 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ repos:
- --convention=numpy
# ----- Jupyter Notebooks -----
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.3.0
rev: 1.3.1
hooks:
- id: nbqa-black
- id: nbqa-isort
Expand Down
9 changes: 6 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
added
=====

- `DynamicShapeSegment` [:pull:`713`]

- `SpatialSeries` and `DynamicTraceSegment` [:pull:`699`]

- first draft of the ``multi_pass_weld`` schema for WelDX files [:pull:`667`]
Expand Down Expand Up @@ -42,8 +44,7 @@ changes
- `WeldxFile.custom_schema` now accepts an optional tuple with the first element being a schema to validate upon read,
the second upon writing the data. [:pull:`697`]

- Weldx now works with Python-3.10. [:pull:`696`]

- Reshape `SpatialData` coordinates to ``(-1, 3)`` before exporting with ``meshio`` for compatibility. [:pull:`723`]

fixes
=====
Expand Down Expand Up @@ -80,6 +81,8 @@ deprecations
dependencies
============

- ``weldx`` now works with Python-3.10. [:pull:`696`]

- bump to ``asdf >=2.8.2`` [:pull:`668`]

- add ``pint-xarray`` dependency [:pull:`518`]
Expand All @@ -92,7 +95,7 @@ dependencies

- add ``bidict`` dependency [:pull:`618`]

- set ``networkx <2.7`` for plotting compatibility (for now) [:pull:`714`]
- set ``networkx !=2.7`` for plotting compatibility (for now) [:pull:`714`, :pull:`722`]

********************
0.5.2 (18.11.2021)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ install_requires =
bottleneck >=1.3.3
boltons
bidict
networkx >=2,<2.7
networkx >=2,!=2.7.0
matplotlib >=3
fs
ipywidgets
Expand Down
6 changes: 6 additions & 0 deletions weldx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
ArcSegment
Geometry
DynamicBaseSegment
DynamicShapeSegment
LineSegment
LinearHorizontalTraceSegment
Profile
Expand Down Expand Up @@ -150,6 +152,8 @@
from weldx.geometry import (
ArcSegment,
Geometry,
DynamicBaseSegment,
DynamicShapeSegment,
LineSegment,
LinearHorizontalTraceSegment,
Profile,
Expand Down Expand Up @@ -179,6 +183,8 @@
"CoordinateSystemManager",
"Geometry",
"GmawProcess",
"DynamicBaseSegment",
"DynamicShapeSegment",
"LineSegment",
"LocalCoordinateSystem",
"Profile",
Expand Down
9 changes: 2 additions & 7 deletions weldx/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import numpy as np
import pandas as pd
import pint
import sympy
import xarray as xr
from bidict import bidict

Expand All @@ -19,7 +20,6 @@

if TYPE_CHECKING: # pragma: no cover
import matplotlib.pyplot
import sympy
from xarray.core.coordinates import DataArrayCoordinates

from weldx.types import UnitLike
Expand Down Expand Up @@ -48,8 +48,6 @@ def __init__(
expression.
"""
import sympy

if not isinstance(expression, sympy.Expr):
expression = sympy.sympify(expression)
self._expression = expression
Expand Down Expand Up @@ -778,9 +776,6 @@ def __post_init__(self):
if not isinstance(self.values, (pint.Quantity, xr.DataArray)):
self.values = Q_(self.values)

if self.symbol is not None and len(self.symbol) > 1:
raise ValueError(f"Cannot use symbol {self.symbol}")

if not isinstance(self.values, (pint.Quantity, xr.DataArray)):
raise ValueError(f"Cannot set parameter as {self.values}")

Expand Down Expand Up @@ -1020,7 +1015,7 @@ def __init__(
if dims is not None and not isinstance(dims, list):
raise ValueError(f"Argument 'dims' must be list of strings, not {dims}")
self._init_discrete(obj, dims, coords)
elif isinstance(obj, (MathematicalExpression, str)):
elif isinstance(obj, (MathematicalExpression, str, sympy.Expr)):
if dims is not None and not isinstance(dims, dict):
raise ValueError(f"Argument 'dims' must be dict, not {dims}")
self._init_expression(obj, dims, parameters, units)
Expand Down
Loading

0 comments on commit 34e8e57

Please sign in to comment.