ENIGMA icon indicating copy to clipboard operation
ENIGMA copied to clipboard

[FIX] issue #29

Open Katterrina opened this issue 1 year ago • 2 comments

I had the same problem as mentioned here. According to NumPy 1.20.0 Release Notes, changing np.float to float should work.

I think it is better to change every occurrence of np.float (and also np.int, np.bool and np.object, because they are also deprecated) in the package, not only mesh_elements.py, because it will cause problems in the other places as well. I went through all the occurrences and tried to do the changes.

I was not sure about some decisions base.py. In this file, np.float is always used as dtype in np.loadtxt function. It is not necessary to specify dtype=float in this function because it is the default option (https://numpy.org/doc/stable/reference/generated/numpy.loadtxt.html), but it might be useful for readability, so I changed np.float to float everywhere in this file. There are also occurrences of np.loadtxt function with dtype='str'. I did not want to mix two types of dtype settings (string and python type) and this is the only place using string, so I changed dtype='str' to dtype=str.

Katterrina avatar Feb 06 '24 12:02 Katterrina

I wanted to test my changes using pytest --doctest-modules enigmatoolbox as mentioned in contributing guidelines, but I always got ModuleNotFoundError: No module named 'vtk'. When I tried to install vtk using pip, it said Requirement already satisfied, so I am not sure what is wrong and I was not able to run the tests properly.

Katterrina avatar Feb 06 '24 12:02 Katterrina

This PR fixes is quite a reoccuring and annoying issue. Will be great if its merged. Thanks!

kaurao avatar Apr 05 '24 17:04 kaurao

Done! Apologies for the delay & thanks for contributing.

saratheriver avatar Apr 08 '24 16:04 saratheriver