Skip to content

Commit 578646a

Browse files
linter and changelog
1 parent c28568e commit 578646a

File tree

11 files changed

+57
-185
lines changed

11 files changed

+57
-185
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
* Separated routines for `starting_point`.
13+
1214
### Changed
1315

16+
* Updated `Analysis` object and optimization routines to work with the new infrastructure.
17+
1418
### Removed
1519

20+
* Removed modules `.diagrams`, `.shape`. TNO is meant to operate with `compas_tna` classes.
21+
* Removed module`.viewer`. New viewer is in `compas_masonnry`.
22+
* Removed `MATLAB` convex optimization to simplify installation
23+
* Removed unused solvers such as `MMA` and `PyOpt`. New focus is on `slsqp` and `ipopt`.
24+
* Made `ipopt` optional to simplify base installation.
1625

1726
## [0.2.2] 2023-09-03
1827

src/compas_tno/problems/constraints.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def constr_wrapper(variables: npt.NDArray, M: "Problem") -> npt.NDArray:
4848
lambdh = 1.0
4949
delta = 0.0
5050
thk: float = M.thk # type: ignore
51-
min_lb: float = M.min_lb # type: ignore
5251

5352
if "xyb" in M.variables:
5453
xyb = variables[check : check + 2 * nb]

src/compas_tno/problems/problems.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def initialise_problem_general(form: FormDiagram) -> Problem:
306306
z[i] = vertex.get("z")
307307
px[i] = vertex.get("px", 0)
308308
py[i] = vertex.get("py", 0)
309-
pz[i] = vertex.get("pz", 0) # + pz_fill + pz_ext
309+
pz[i] = vertex.get("pz", 0) # + pz_fill + pz_ext
310310
s[i] = vertex.get("target", 0) # used for bestfit
311311
if abs(s[i]) < 1e-6:
312312
s[i] = 0.0
@@ -448,8 +448,6 @@ def adapt_problem_to_fixed_diagram(
448448
449449
"""
450450
ind = []
451-
tol_old_ind = 1e-3
452-
453451
start_time = time.time()
454452

455453
# Independent and dependent branches

src/compas_tno/problems/setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ def set_up_general_optimisation(analysis: "Analysis"):
5353
optimiser = analysis.optimiser
5454

5555
printout = optimiser.settings.get("printout", True)
56-
plot = optimiser.settings.get("plot", False)
5756
axis_symmetry = optimiser.settings.get("axis_sym", None)
5857
sym_loads = optimiser.settings.get("sym_loads", False)
5958
fjac = optimiser.settings.get("jacobian", False)

src/compas_tno/solvers/cvxpy.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def run_loadpath_from_form_CVXPY(form, problem=None, find_inds=False, solver_con
5050
find_inds : bool, optional
5151
Whether or not independents must be computed before the analysis, by default False
5252
solver_convex : str, optional
53-
Solver to use, by default CLARABEL. Options are "CLARABEL", "MOSEK" or "CVXOPT".
53+
Solver to use, by default CLARABEL. Options are "CLARABEL", "MOSEK" or "CVXOPT".
5454
Note: "MOSEK" and "CVXOPT" are not available in the default installation of TNO.
5555
printout : bool, optional
5656
Whether or not print results, by default False
@@ -82,7 +82,7 @@ def call_and_output_CVXPY(form, problem, solver_convex="CLARABEL", printout=Fals
8282
problem : ::class:: Problem
8383
The Problem with relevant matrices and vectors
8484
solver_convex : str, optional
85-
Solver to use, by default CLARABEL. Options are "CLARABEL", "MOSEK" or "CVXOPT".
85+
Solver to use, by default CLARABEL. Options are "CLARABEL", "MOSEK" or "CVXOPT".
8686
Note: "MOSEK" and "CVXOPT" are not available in the default installation of TNO.
8787
printout : bool, optional
8888
Whether or not print results, by default False
@@ -156,7 +156,7 @@ def call_cvxpy(problem, solver_convex="CLARABEL", printout=False):
156156
problem : ::class:: Problem
157157
The Problem with relevant matrices and vectors`
158158
solver_convex : str, optional
159-
Solver to use, by default CLARABEL. Options are "CLARABEL", "MOSEK" or "CVXOPT".
159+
Solver to use, by default CLARABEL. Options are "CLARABEL", "MOSEK" or "CVXOPT".
160160
Note: "MOSEK" and "CVXOPT" are not available in the default installation of TNO.
161161
printout : bool, optional
162162
Whether or not print results, by default False
@@ -230,7 +230,7 @@ def call_cvxpy_ind(problem, solver_convex="CLARABEL", printout=False):
230230
problem : ::class:: Problem
231231
The Problem with relevant matrices and vectors
232232
solver_convex : str, optional
233-
Solver to use, by default CLARABEL. Options are "CLARABEL", "MOSEK" or "CVXOPT".
233+
Solver to use, by default CLARABEL. Options are "CLARABEL", "MOSEK" or "CVXOPT".
234234
Note: "MOSEK" and "CVXOPT" are not available in the default installation of TNO.
235235
printout : bool, optional
236236
Whether or not print results, by default False

src/compas_tno/solvers/ipopt.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,7 @@ def run_nlopt_ipopt(analysis: "Analysis"):
114114
raise ImportError("IPOPT is not installed. Please install it using `pip install cyipopt`")
115115

116116
optimiser = analysis.optimiser
117-
118-
constraints = optimiser.settings["constraints"]
119-
objective = optimiser.settings["objective"]
120117
printout = optimiser.settings.get("printout", False)
121-
gradients = optimiser.settings.get("gradient", False)
122-
variables = optimiser.settings["variables"]
123118
callback = optimiser.callback
124119

125120
bounds = optimiser.bounds

src/compas_tno/solvers/post_process.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22

33
if TYPE_CHECKING:
44
from compas_tna.diagrams import FormDiagram
5-
from compas_tna.envelope import Envelope
65
from compas_tno.analysis import Analysis
76
from compas_tno.optimisers import Optimiser
87
from compas_tno.problems import Problem
98

10-
from compas_tna.envelope import Envelope
119
from compas_tno.algorithms import compute_reactions
1210
from compas_tno.algorithms import q_from_variables
1311
from compas_tno.algorithms import xyz_from_q
@@ -30,14 +28,13 @@ def post_process_general(analysis: "Analysis"):
3028

3129
form: "FormDiagram" = analysis.formdiagram
3230
optimiser: "Optimiser" = analysis.optimiser
33-
envelope: "Envelope" = analysis.envelope
34-
# shape: "Shape" = analysis.shape
31+
# envelope: "Envelope" = analysis.envelope
3532

3633
problem: "Problem" = optimiser.problem
3734
summary = optimiser.settings.get("summary", False)
3835
printout = optimiser.settings.get("printout", True)
39-
thickness_type = optimiser.settings.get("thickness_type", "constant")
40-
features = optimiser.settings.get("features", [])
36+
# thickness_type = optimiser.settings.get("thickness_type", "constant")
37+
# features = optimiser.settings.get("features", [])
4138
save_iterations = optimiser.settings.get("save_iterations", False)
4239
show_force_diagram = optimiser.settings.get("save_force_diagram", True)
4340

@@ -177,9 +174,10 @@ def post_process_general(analysis: "Analysis"):
177174
if "n" in problem.variables:
178175
print("Value of N:", n)
179176
n = -1 * fopt
180-
shape.intrados = shape.intrados.offset_mesh(n=n, direction="up")
181-
shape.extrados = shape.extrados.offset_mesh(n=n, direction="down")
182-
form.apply_envelope_from_shape(shape)
177+
pass
178+
# shape.intrados = shape.intrados.offset_mesh(n=n, direction="up")
179+
# shape.extrados = shape.extrados.offset_mesh(n=n, direction="down")
180+
# form.apply_envelope_from_shape(shape)
183181

184182
if "tub" in problem.variables:
185183
for i, key in enumerate(form.vertices()):

src/compas_tno/solvers/scipy.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
import numpy as np
1010
from scipy.optimize import fmin_slsqp
1111

12-
from .post_process import post_process_general
13-
1412
if TYPE_CHECKING:
1513
from compas_tno.analysis import Analysis
1614
from compas_tno.optimisers import Optimiser

src/compas_tno/utilities/__init__.py

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,43 @@
1-
from .constraints import (assign_cracks, check_envelope_constraints, distance_target, rectangular_smoothing_constraints, rollers_on_openings, set_b_constraint,
2-
set_rollers_constraint)
3-
from .form import (displacement_map_4parabolas, displacement_map_parabola, displacement_map_paraboloid, fix_mesh_boundary, fix_mesh_corners, form_add_lines_support,
4-
form_parabolic_slide, mesh_remove_two_valent_nodes, move_pattern_inwards, move_pattern_outwards, move_pattern_to_origin, shuffle_diagram, slide_diagram,
5-
slide_pattern_inwards, split_intersection_lines, store_inds)
1+
from .constraints import (
2+
assign_cracks,
3+
check_envelope_constraints,
4+
distance_target,
5+
rectangular_smoothing_constraints,
6+
rollers_on_openings,
7+
set_b_constraint,
8+
set_rollers_constraint,
9+
)
10+
from .form import (
11+
displacement_map_4parabolas,
12+
displacement_map_parabola,
13+
displacement_map_paraboloid,
14+
fix_mesh_boundary,
15+
fix_mesh_corners,
16+
form_add_lines_support,
17+
form_parabolic_slide,
18+
mesh_remove_two_valent_nodes,
19+
move_pattern_inwards,
20+
move_pattern_outwards,
21+
move_pattern_to_origin,
22+
shuffle_diagram,
23+
slide_diagram,
24+
slide_pattern_inwards,
25+
split_intersection_lines,
26+
store_inds,
27+
)
628
from .functions import dome, paraboloid
729
from .interpolation import create_mesh_from_topology_and_basemesh, create_mesh_from_topology_and_pointcloud, interpolate_from_pointcloud, mesh_from_pointcloud
830
from .json import update_json
931
from .stiffness import compute_average_edge_stiffness, compute_edge_stiffness, compute_form_initial_lengths
10-
from .symmetry import (apply_radial_symmetry, apply_symmetry_from_axis, build_symmetry_matrix, build_symmetry_matrix_supports, build_symmetry_transformation,
11-
build_vertex_symmetry_transformation, find_sym_axis_in_rect_patterns)
32+
from .symmetry import (
33+
apply_radial_symmetry,
34+
apply_symmetry_from_axis,
35+
build_symmetry_matrix,
36+
build_symmetry_matrix_supports,
37+
build_symmetry_transformation,
38+
build_vertex_symmetry_transformation,
39+
find_sym_axis_in_rect_patterns,
40+
)
1241

1342
__all__ = [
1443
"apply_radial_symmetry",

src/compas_tno/viewer/__init__.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)