Skip to content

Commit

Permalink
Merge pull request #704 from jdegenstein/numpy2
Browse files Browse the repository at this point in the history
Upgrade build123d to numpy >=2, <3
  • Loading branch information
jdegenstein authored Oct 10, 2024
2 parents 6452e1b + 24b8d03 commit e2434d7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ A procedure for avoiding this issue is to install in a conda environment, which
conda activate <YOUR ENVIRONMENT NAME>
conda install -c cadquery -c conda-forge cadquery=master
pip install svgwrite svgpathtools anytree scipy ipython trianglesolver \
ocp_tessellate webcolors==1.12 numpy numpy-quaternion cachetools==5.2.0 \
ocp_tessellate webcolors==1.12 "numpy>=2,<3" cachetools==5.2.0 \
ocp_vscode requests orjson urllib3 certifi py-lib3mf \
"svgpathtools>=1.5.1,<2" "svgelements>=1.9.1,<2" "ezdxf>=1.1.0,<2"
pip install --no-deps build123d ocpsvg
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ classifiers = [
dependencies = [
"cadquery-ocp >= 7.7.0",
"typing_extensions >= 4.6.0, <5",
"numpy >= 1.24.1, <2",
"numpy >= 2, <3",
"svgpathtools >= 1.5.1, <2",
"anytree >= 2.8.0, <3",
"ezdxf >= 1.1.0, < 2",
Expand Down
4 changes: 1 addition & 3 deletions src/build123d/importers.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,7 @@ def import_svg_as_buildline_code(file_name: str) -> tuple[str, str]:
for curve in path:
class_name = type(curve).__name__
if class_name == "Arc":
values = [
(curve.__dict__["center"].real, curve.__dict__["center"].imag)
]
values = [curve.__dict__["center"]]
values.append(curve.__dict__["radius"].real)
values.append(curve.__dict__["radius"].imag)
start, end = sorted(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_exporters3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def test_export_step_assembly(self):
os.remove("assembly.step")
self.assertNotEqual(step_data.find("DRAUGHTING_PRE_DEFINED_COLOUR('red')"), -1)
self.assertNotEqual(step_data.find("DRAUGHTING_PRE_DEFINED_COLOUR('blue')"), -1)
self.assertEqual(len(re.findall("[\(\,]25.4[\,\)]", step_data)), 45)
self.assertEqual(len(re.findall("[(,]25.4[,)]", step_data)), 45)
self.assertNotEqual(step_data.find("PRODUCT('sphere',"), -1)
self.assertNotEqual(step_data.find("PRODUCT('box',"), -1)
self.assertNotEqual(step_data.find("PRODUCT('assembly',"), -1)
Expand Down

0 comments on commit e2434d7

Please sign in to comment.