AOtools / aotools

A useful set of tools for Adaptive Optics in Python
GNU Lesser General Public License v3.0
109 stars 42 forks source link

Zernike.py pulling non-existant dependancies `emath` #98

Open CJonesANU opened 2 months ago

CJonesANU commented 2 months ago

Problem

Importing aotools in python12, on windows fails.

Cause

Within aotools\functions\zernike.py , zernikeRadialFunc calls numpy.emath.factorial which I believe was depreciated a while back.

Solution

Temporary Solution

I was able to monkey patch it in my loca environment by importing math and swapping references to numpy.math.factorial to math.factorial

Long term solution

I was going to try issue a pull request, but issues with verssioner.py are preventing me from installing it locally. (I think this is a different issue lol)

If you could make the changes that would be an easy fix to get windows users up and running.

Cheers Cam

matthewtownson commented 2 months ago

Thanks for sorting this, I haven't tested aotools with the latest numpy or Python version properly. It's something I'm hoping to do this week.