WPI-SurfMet-Lab / Multiscale-Statistical-Analysis

Multiscale regression/discrimination analysis software, which uses multiscale area data exported from MountainsMap®.
https://www.surfacemetrology.org/
MIT License
2 stars 0 forks source link

ImportUtils.find_mountains_map() needs to be OS independent #135

Open MatthewSpofford opened 2 years ago

MatthewSpofford commented 2 years ago

Currently find_mountains_map() is written solely for a Windows OS. This is due to the fact that it uses the winreg module (which can be used to search through the Windows Registery) to find the path of the MountainsMap executable.

So, this function needs to be modified to support other operating systems. This would involve adding some sort of conditional check at the top of the function to determine which OS the tool is currently running (many options on how to do this).

The winreg implementation should then ONLY be run for Windows systems, while some new implementation should be run for MacOS or Linux systems. This new implementation could involve calling the which command to find MountainsMap, or just some other means of finding the MountainsMap executable.

NOTE: MountainsMap may not even be supported by other OSs but Windows, and so you may end up having to just return a MountainsNotFound value (defined in ImportUtils.py) immediately after determining Windows is not being used.

ANOTHER NOTE: I'm not sure what I was thinking with making MountainsNotFound a subtype of str that could then be returned. If you would like to change this to an exception, I think that would still be fair to consider it in the scope of this issue.