Skip to content

Bump rhino3dm from 8.0.0b2 to 8.0.0b3, remove python 3.10 & 3.11 restriction for rhino extra #337

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

Merged
merged 5 commits into from
Oct 11, 2023
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
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ poetry install
Install with the `rhino` and `cad` extras:

```shell
poetry install --all-extras
poetry install --extras "dxf rhino"
```

You can now run an interactive Python session, or the command-line interface:
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Install with the ``rhino`` and ``cad`` extras:

.. code:: shell

poetry install --all-extras
poetry install --extras "dxf rhino"

You can now run an interactive Python session, or the command-line interface:

Expand Down
3 changes: 0 additions & 3 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,3 @@ To install ``sectionproperties`` with the above functionality, use the ``dxf`` a

pip install sectionproperties[dxf]
pip install sectionproperties[rhino]

Note that the ``rhino`` option only supports python ``3.9`` due to incomplete wheel
coverage of ``rhino3dm``.
6 changes: 3 additions & 3 deletions docs/user_guide/geometry.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ Various CAD files can be imported to creating ``sectionproperties`` geometries.
installation. To install ``sectionproperties`` with CAD import functionality, use
the ``dxf`` and/or ``rhino`` options:

.. code-block:: shell
.. code-block:: shell

pip install sectionproperties[dxf]
pip install sectionproperties[rhino]
pip install sectionproperties[dxf]
pip install sectionproperties[rhino]

.. _label-geometry-dxf:

Expand Down
18 changes: 10 additions & 8 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,9 @@ def tests(session: Session) -> None:
Args:
session: Nox session
"""
# provide only dxf dependencies if python version is 3.10 or 3.11
if session.python == "3.9":
session.run_always("poetry", "install", "--all-extras", external=True)
else:
session.run_always("poetry", "install", "--extras", "dxf", external=True)
session.run_always(
"poetry", "install", "--only", "main", "--extras", "dxf rhino", external=True
)

# install relevant tooling
session.install("coverage[toml]", "pytest", "pygments", "pytest-check")
Expand All @@ -161,7 +159,7 @@ def tests(session: Session) -> None:
"-m",
"pytest",
"-m",
"not benchmark",
"not benchmark_suite",
*session.posargs,
)
finally:
Expand Down Expand Up @@ -197,7 +195,9 @@ def docs_build(session: Session) -> None:
if not session.posargs and "FORCE_COLOR" in os.environ:
args.insert(0, "--color")

session.run_always("poetry", "install", "--all-extras", external=True)
session.run_always(
"poetry", "install", "--only", "main", "--extras", "dxf rhino", external=True
)
session.install(
"furo",
"ipykernel",
Expand Down Expand Up @@ -226,7 +226,9 @@ def docs(session: Session) -> None:
session: Nox session
"""
args = session.posargs or ["--open-browser", "docs", "docs/_build"]
session.run_always("poetry", "install", "--all-extras", external=True)
session.run_always(
"poetry", "install", "--only", "main", "--extras", "dxf rhino", external=True
)
session.install(
"furo",
"ipykernel",
Expand Down
32 changes: 17 additions & 15 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ rich = "^13.6.0"
click = "^8.1.7"
more-itertools = "^10.1.0"
cad-to-shapely = { version = "^0.3.1", optional = true }
rhino-shapley-interop = { version = "^0.0.4", python = ">=3.9.0,<3.10", optional = true }
rhino3dm = { version = "==8.0.0b2", python = ">=3.9.0,<3.10", optional = true }
rhino-shapley-interop = { version = "^0.0.4", optional = true }
rhino3dm = { version = "==8.0.0b3", optional = true }

[tool.poetry.dev-dependencies]
[tool.poetry.group.dev.dependencies]
black = "^23.9.1"
coverage = { extras = ["toml"], version = "^7.3.2" }
darglint = "^1.8.1"
Expand Down Expand Up @@ -115,6 +115,7 @@ lines_after_imports = 2

[tool.pytest.ini_options]
markers = [
"benchmark_suite: entire benchmark test suite (select with '-m benchmark_suite')",
"benchmark_geom: geometry benchmark tests (select with '-m benchmark_geom')",
"benchmark_mesh: mesh benchmark tests (select with '-m benchmark_mesh')",
"benchmark_analysis: analysis benchmark tests (select with '-m benchmark_analysis')",
Expand Down
12 changes: 6 additions & 6 deletions tests/benchmarks/test_benchmark_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from sectionproperties.analysis import Section


@pytest.mark.benchmark
@pytest.mark.benchmark_suite
@pytest.mark.benchmark_analysis
@pytest.mark.parametrize("elements", [50, 500, 5000])
def test_create_section(benchmark, analysis_geometry, elements):
Expand All @@ -18,7 +18,7 @@ def create_section():
benchmark(create_section)


@pytest.mark.benchmark
@pytest.mark.benchmark_suite
@pytest.mark.benchmark_analysis
@pytest.mark.parametrize("elements", [50, 500, 5000])
def test_geometric_analysis(benchmark, analysis_geometry, elements):
Expand All @@ -32,7 +32,7 @@ def geometric_analysis():
benchmark(geometric_analysis)


@pytest.mark.benchmark
@pytest.mark.benchmark_suite
@pytest.mark.benchmark_analysis
def test_plastic_analysis(benchmark, analysis_geometry):
"""Benchmark test for conducting a plastic analysis.
Expand All @@ -49,7 +49,7 @@ def plastic_analysis():
benchmark(plastic_analysis)


@pytest.mark.benchmark
@pytest.mark.benchmark_suite
@pytest.mark.benchmark_analysis
@pytest.mark.parametrize("elements", [50, 500, 5000])
def test_warping_analysis(benchmark, analysis_geometry, elements):
Expand All @@ -64,7 +64,7 @@ def warping_analysis():
benchmark(warping_analysis)


@pytest.mark.benchmark
@pytest.mark.benchmark_suite
@pytest.mark.benchmark_analysis
@pytest.mark.parametrize("elements", [50, 500, 5000])
def test_frame_analysis(benchmark, analysis_geometry, elements):
Expand All @@ -78,7 +78,7 @@ def frame_analysis():
benchmark(frame_analysis)


@pytest.mark.benchmark
@pytest.mark.benchmark_suite
@pytest.mark.benchmark_analysis
@pytest.mark.parametrize("elements", [50, 500, 5000])
def test_stress_analysis(benchmark, analysis_geometry, elements):
Expand Down
6 changes: 3 additions & 3 deletions tests/benchmarks/test_benchmark_geom.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
from sectionproperties.pre.library import circular_hollow_section, rectangular_section


@pytest.mark.benchmark
@pytest.mark.benchmark_suite
@pytest.mark.benchmark_geom
def test_create_simple_geometry(benchmark):
"""Benchmark test for creating rectangular geometry."""
benchmark(rectangular_section, d=100, b=50)


@pytest.mark.benchmark
@pytest.mark.benchmark_suite
@pytest.mark.benchmark_geom
def test_create_intermediate_geometry(benchmark):
"""Benchmark test for creating CHS geometry."""
benchmark(circular_hollow_section, d=100, t=3, n=128)


@pytest.mark.benchmark
@pytest.mark.benchmark_suite
@pytest.mark.benchmark_geom
def test_create_complex_geometry(benchmark, concrete_column_with_hole):
"""Benchmark test for creating concrete geometry."""
Expand Down
6 changes: 3 additions & 3 deletions tests/benchmarks/test_benchmark_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest


@pytest.mark.benchmark
@pytest.mark.benchmark_suite
@pytest.mark.benchmark_mesh
@pytest.mark.parametrize("ms", [0.0, 50.0, 5.0])
def test_create_simple_mesh(benchmark, rect_geom, ms):
Expand All @@ -12,7 +12,7 @@ def test_create_simple_mesh(benchmark, rect_geom, ms):
benchmark(geom.create_mesh, ms)


@pytest.mark.benchmark
@pytest.mark.benchmark_suite
@pytest.mark.benchmark_mesh
@pytest.mark.parametrize("ms", [0.0, 1.0, 0.3])
def test_create_intermediate_mesh(benchmark, chs_geom, ms):
Expand All @@ -21,7 +21,7 @@ def test_create_intermediate_mesh(benchmark, chs_geom, ms):
benchmark(geom.create_mesh, ms)


@pytest.mark.benchmark
@pytest.mark.benchmark_suite
@pytest.mark.benchmark_mesh
@pytest.mark.parametrize("ms", [0.0, 100.0, 20.0])
def test_create_complex_mesh(benchmark, concrete_column_with_hole, ms):
Expand Down
5 changes: 0 additions & 5 deletions tests/geometry/test_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from __future__ import annotations

import json
import sys
from pathlib import Path

import pytest
Expand Down Expand Up @@ -480,7 +479,6 @@ def test_geometry_from_dxf():
assert sp_geom.Geometry.from_dxf(section_holes_dxf).geom.wkt == poly


@pytest.mark.skipif(sys.version_info >= (3, 10), reason="requires python 3.9")
def test_geometry_from_3dm_file_simple():
"""Tests loading geometry from a simple .3dm file."""
section = Path(__file__).parent.absolute() / "3in x 2in.3dm"
Expand All @@ -489,7 +487,6 @@ def test_geometry_from_3dm_file_simple():
assert (test.geom - exp).is_empty


@pytest.mark.skipif(sys.version_info >= (3, 10), reason="requires python 3.9")
def test_geometry_from_3dm_file_complex():
"""Tests loading geometry from a complex .3dm file."""
section_3dm = Path(__file__).parent.absolute() / "complex_shape.3dm"
Expand All @@ -501,7 +498,6 @@ def test_geometry_from_3dm_file_complex():
assert (test.geom - exp).is_empty


@pytest.mark.skipif(sys.version_info >= (3, 10), reason="requires python 3.9")
def test_geometry_from_3dm_file_compound():
"""Tests loading compound geometry from a .3dm file."""
section_3dm = Path(__file__).parent.absolute() / "compound_shape.3dm"
Expand All @@ -513,7 +509,6 @@ def test_geometry_from_3dm_file_compound():
assert (MultiPolygon([ii.geom for ii in test.geoms]) - MultiPolygon(exp)).is_empty


@pytest.mark.skipif(sys.version_info >= (3, 10), reason="requires python 3.9")
def test_geometry_from_3dm_encode():
"""Tests loading compound geometry from a .json file."""
section_3dm = Path(__file__).parent.absolute() / "rhino_data.json"
Expand Down