bogumilchilinski / dgeometry

MIT License
3 stars 0 forks source link

Refactoring of .solution method of GeometricalCase class #3

Closed bogumilchilinski closed 1 year ago

bogumilchilinski commented 1 year ago

GeometricalCase class provides method .solution which provides the interface for solution caching and/or returning. It can be overridden in child class (1st approach) or ._solution method can be provided (2nd approach).

Second approach enables to cache the solved cased in order to avoid unwanted iterations of the same cases. It seems to be good idea to use ._solution instead .solution wherever it's possible. In order to do it, basically the method name .solution has to be changed to ._solution as explained. However, there are particular classes which contains "manual" caching mechanism directly in body of .solution method eg.

https://github.com/bogumilchilinski/dgeometry/blob/b3a37d6d129ece94899732211f6cf7eb1ddfc861/cases/pyramids.py#L62-L77

It has to be checked and removed if occurring.

amvdek commented 1 year ago

prisms done, rotations done, ShapeOnPlane needs check lines 938-939, basics done, pyramids done, shapes done, ShapeOnPlane needs check