Closed alexandergagliano closed 2 years ago
A git pull
should fix this.
@Jammy2211 I've done a fresh install and a fresh pull of this repo and now am getting five errors (they look related to the original 3). I should mention that this is after pip installing the package and then running the code tests from this repo. If the pypi release and the repo are at different versions, that might be the cause?
E AttributeError: module 'autogalaxy.profiles.light_profiles.light_profiles_linear_operated' has no attribute 'EllSersic'
imaging/test_fit_imaging.py:208: AttributeError
E AttributeError: 'FitImaging' object has no attribute 'plane_linear_light_profiles_to_light_profiles'
imaging/test_fit_imaging.py:587: AttributeError
E AssertionError: assert not True
E + where True = isinstance(EllSersic\ncentre: (0.0, 0.0)\nelliptical_comps: (0.0, 0.0)\nintensity: 1.0\neffective_radius: 0.6\nsersic_index: 4.0, <class 'autogalaxy.profiles.light_profiles.light_profiles_linear.LightProfileLinear'>)
E + where EllSersic\ncentre: (0.0, 0.0)\nelliptical_comps: (0.0, 0.0)\nintensity: 1.0\neffective_radius: 0.6\nsersic_index: 4.0 = Redshift: 0.5\nLight Profiles:\nEllSersic\ncentre: (0.0, 0.0)\nelliptical_comps: (0.0, 0.0)\nintensity: 1.0\neffective_radius: 0.6\nsersic_index: 4.0.bulge
E + and <class 'autogalaxy.profiles.light_profiles.light_profiles_linear.LightProfileLinear'> = <module 'autogalaxy.profiles.light_profiles.light_profiles_linear' from '/Users/alexgagliano/miniconda3/lib/python3.9/site-packages/autogalaxy/profiles/light_profiles/light_profiles_linear.py'>.LightProfileLinear
E + where <module 'autogalaxy.profiles.light_profiles.light_profiles_linear' from '/Users/alexgagliano/miniconda3/lib/python3.9/site-packages/autogalaxy/profiles/light_profiles/light_profiles_linear.py'> = ag.lp_linear
imaging/model/test_result_imaging.py:58: AssertionError
E AttributeError: module 'autogalaxy.profiles.light_profiles' has no attribute 'EllMoffat'
profiles/light_profiles/test_light_profiles.py:229: AttributeError
E assert 9.0 < Array2D(2.89827085)
E + where Array2D(2.89827085) = <autoarray.dataset.imaging.Imaging object at 0x7fe5beee66a0>.signal_to_noise_max
profiles/light_profiles/test_snr_light_profiles.py:40: AssertionError
Ok yes, the issue is that the pip install and master branch are out of sync (as one would expect).
If you are to run the tests you should also run the PyAutoGalaxy source code cloned from the repo (and will possibly need the parent projects cloned as well):
https://pyautogalaxy.readthedocs.io/en/latest/installation/source.html
A few errors in PyAutoArray after following the instructions in "Build All Projects" here. It looks like these are all coming from similar functions:
===================================================================================== short test summary info ====================================================================================== FAILED test_autoarray/inversion/inversion/test_factory.py::testinversion_imaging__via_regularizations - AttributeError: module 'autoarray.util.nn.nn_py' has no attribute 'natural_interpolatio... FAILED test_autoarray/inversion/linear_eqn/test_leq_util.py::TestCurvatureMatrixImaging::testcurvature_matrix_via_preload_imaging - assert False FAILED test_autoarray/inversion/mappers/test_voronoi.py::testpix_indexes_for_sub_slim_index__matches_util - AttributeError: module 'autoarray.util.nn.nn_py' has no attribute 'natural_interpol... FAILED test_autoarray/structures/grids/test_grid_2d_pixelizations.py::TestGrid2DVoronoi::testinterpolated_array_from - AttributeError: module 'autoarray.util.nn.nn_py' has no attribute 'natur... FAILED test_autoarray/util/test_nn.py::test__returning_weights_correct - AttributeError: module 'autoarray.util.nn.nn_py' has no attribute 'natural_interpolation_weights' FAILED test_autoarray/util/test_nn.py::test__nn_interpolation_correct - AttributeError: module 'autoarray.util.nn.nn_py' has no attribute 'natural_interpolation' ====================================================================== 6 failed, 835 passed, 15 warnings in 154.93s (0:02:34) ======================================================================
PyAutoArray testing re-done from scratch in a new conda environment and fails the same tests.
Yeah these tests require an optional C library, I hadnt really considered we put some tests that depend on it.
Will look into fixing them by removing the dependency.
Pushed what I think is a fix, feel free to reopn this issue if theres still failing tests.
Confirming that, yes, the fix works and all tests pass.
When running pytest, the code catches 3 test failures across 2 files --
test_autogalaxy/imaging/test_fit_imaging.py
andtest_autogalaxy/profiles/light_profiles/test_light_profiles.py
. The error messages are:and
and
Related to #4475.