slf-dot-ch / snowmicropyn

A python package to read, export and post process data (*.pnt files) recorded by SnowMicroPen, a snow penetration probe for scientific applications developed at SLF.
https://www.slf.ch/en/services-and-products/research-instruments/snowmicropen-r-smp4-version.html
GNU General Public License v3.0
10 stars 12 forks source link

Introduce „SnowPit“ layer of abstraction #12

Open reisecker opened 1 year ago

reisecker commented 1 year ago

Currently there is a bit of a clash between object oriented data classes and a more functional style of programming for the Physics. This is natural for GUIs controlling data output. Still, there is a bit of a backlog from the times snowmicropyn seemed to mainly have been for displaying the SMP forces. Issues can usually be worked around because the structure is generally good, but there is some overhead, loss of clarity, and loss of elegancy (e. g. by having to put instructions in locations that feel out of place).

This gap is partly bridged by the Document class, which holds a profile and some derived values (e. g. drift fit), but it is GUI oriented and does not do all that much. In fact this is now where the AI stuff is called from, because it cannot be done from Profile or CAAML for logical reasons (attempts rightfully fail in circular includes). It works out, but in the CAAML unit test for example we have to include something from pyngui even though it has nothing to do with the GUI.

Instead of or in addition to this Document class for the GUI I propose a new class Pit which holds a) the profile and b) meta data including several derived properties (if we want full backwards compatibility we may need to just keep and extend the existing Document).

Depending on how much time is spent this could have a big reach:

Apart from the always looming refactoring in open source projects this point could be tackled separately while still having great overall ramifications. However, it is not a quick fix at all.

Just my 2 cents!