Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "feature/build fixes" #1047

Closed
wants to merge 1 commit into from
Closed

Conversation

Jammy2211
Copy link
Collaborator

Reverts #1044

These changes have led to the aggregator unit tests breaking on other projects:

test_autolens/aggregator/test_aggregator_fit_interferometer.py:123:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../PyAutoFit/autofit/database/aggregator/aggregator.py:255: in map
    yield func(fit)
../PyAutoFit/autofit/aggregator/base.py:161: in func_gen
    return [
../PyAutoFit/autofit/aggregator/base.py:162: in <listcomp>
    self.object_via_gen_from(
autolens/aggregator/fit_interferometer.py:167: in object_via_gen_from
    return _fit_interferometer_from(
autolens/aggregator/fit_interferometer.py:59: in _fit_interferometer_from
    dataset_list = _interferometer_from(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

fit = <Fit 4a97077027d1440b43bbd2c47aa20e12>, real_space_mask = None

    def _interferometer_from(
        fit: af.Fit,
        real_space_mask: Optional[aa.Mask2D] = None,
    ) -> List[aa.Interferometer]:
        """
        Returns a list of `Interferometer` objects from a `PyAutoFit` sqlite database `Fit` object.

        The results of a model-fit can be stored in a sqlite database, including the following attributes of the fit:

        - The interferometer visibilities data as a .fits file (`dataset/data.fits`).
        - The visibilities noise-map as a .fits file (`dataset/noise_map.fits`).
        - The uv wavelengths as a .fits file (`dataset/uv_wavelengths.fits`).
        - The real space mask defining the grid of the interferometer for the FFT (`dataset/real_space_mask.fits`).
        - The settings of the `Interferometer` data structure used in the fit (`dataset/settings.json`).

        Each individual attribute can be loaded from the database via the `fit.value()` method.

        This method combines all of these attributes and returns a `Interferometer` object, including having its
        settings updated to the values used by the model-fit.

        If multiple `Interferometer` objects were fitted simultaneously via analysis summing, the `fit.child_values()`
        method is instead used to load lists of the data, noise-map, PSF and mask and combine them into a list of
        `Interferometer` objects.

        Parameters
        ----------
        fit
            A `PyAutoFit` `Fit` object which contains the results of a model-fit as an entry in a sqlite database.
        """

        fit_list = [fit] if not fit.children else fit.children

        dataset_list = []

        for fit in fit_list:
            data = aa.Visibilities(
>               visibilities=fit.value(name="dataset.data").data.astype("float")
            )
E           AttributeError: 'NoneType' object has no attribute 'data'

../PyAutoGalaxy/autogalaxy/aggregator/interferometer/interferometer.py:44: AttributeError
--------------------------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------------------------
2024-09-06 17:16:59,545 - autofit.non_linear.search.abstract_search - INFO - Starting non-linear search with 1 cores.
2024-09-06 17:16:59,548 - autolens.interferometer.model.analysis - INFO - PRELOADS - Setting up preloads, may take a few minutes for fits using an inversion.
2024-09-06 17:16:59,548 - autogalaxy.analysis.analysis.dataset - INFO - PRELOADS - Setting up preloads, may take a few minutes for fits using an inversion.
2024-09-06 17:16:59,565 - autolens.analysis.preloads - INFO - PRELOADS - Traced grid of planes (for inversion) preloaded for this model-fit.
2024-09-06 17:16:59,572 - root - INFO - The output path of this fit is /mnt/c/Users/Jammy/Code/PyAuto/PyAutoLens/test_autolens/output/db_fit_interferometer/4a97077027d1440b43bbd2c47aa20e12
2024-09-06 17:16:59,572 - root - INFO - Outputting pre-fit files (e.g. model.info, visualization).
2024-09-06 17:16:59,666 - root - INFO - Removing search internal folder.
2024-09-06 17:16:59,667 - root - INFO - Removing all files except for .zip file
2024-09-06 17:16:59,678 - root - INFO - Search complete, returning result
Aggregator loading search_outputs... could take some time.

 A total of 1 search_outputs and results were found.
2024-09-06 17:16:59,763 - autofit.database.aggregator.scrape - INFO - Scraping directory /mnt/c/Users/Jammy/Code/PyAuto/PyAutoLens/test_autolens/output/db_fit_interferometer
2024-09-06 17:16:59,764 - autofit.database.aggregator.scrape - INFO - 1 searches found
2024-09-06 17:17:00,006 - autofit.database.aggregator.scrape - INFO - Creating fit for: db_fit_interferometer None  4a97077027d1440b43bbd2c47aa20e12
2024-09-06 17:17:00,039 - autofit.database.aggregator.scrape - WARNING - Failed to load latent variables for 4a97077027d1440b43bbd2c47aa20e12
2024-09-06 17:17:00,166 - autofit.database.aggregator.aggregator - INFO - 1 fit(s) found matching query
---------------------------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------------------------
INFO     autofit.non_linear.search.abstract_search:abstract_search.py:576 Starting non-linear search with 1 cores.
INFO     autolens.interferometer.model.analysis:analysis.py:119 PRELOADS - Setting up preloads, may take a few minutes for fits using an inversion.
INFO     autogalaxy.analysis.analysis.dataset:dataset.py:109 PRELOADS - Setting up preloads, may take a few minutes for fits using an inversion.
INFO     autolens.analysis.preloads:preloads.py:182 PRELOADS - Traced grid of planes (for inversion) preloaded for this model-fit.
INFO     root:abstract_search.py:654 The output path of this fit is /mnt/c/Users/Jammy/Code/PyAuto/PyAutoLens/test_autolens/output/db_fit_interferometer/4a97077027d1440b43bbd2c47aa20e12
INFO     root:abstract_search.py:661 Outputting pre-fit files (e.g. model.info, visualization).
INFO     root:abstract_search.py:840 Removing search internal folder.
INFO     root:abstract_search.py:846 Removing all files except for .zip file
INFO     root:abstract_search.py:617 Search complete, returning result
INFO     autofit.database.aggregator.scrape:scrape.py:66 Scraping directory /mnt/c/Users/Jammy/Code/PyAuto/PyAutoLens/test_autolens/output/db_fit_interferometer
INFO     autofit.database.aggregator.scrape:scrape.py:67 1 searches found
INFO     autofit.database.aggregator.scrape:scrape.py:69 Creating fit for: db_fit_interferometer None  4a97077027d1440b43bbd2c47aa20e12
WARNING  autofit.database.aggregator.scrape:scrape.py:158 Failed to load latent variables for 4a97077027d1440b43bbd2c47aa20e12
INFO     autofit.database.aggregator.aggregator:aggregator.py:376 1 fit(s) found matching query
=============================================================================================== warnings summary ===============================================================================================
../../../../../../../home/jammy/venvs/PyAuto/lib/python3.10/site-packages/numpy/core/getlimits.py:542
  /home/jammy/venvs/PyAuto/lib/python3.10/site-packages/numpy/core/getlimits.py:542: UserWarning: Signature b'\x00\xd0\xcc\xcc\xcc\xcc\xcc\xcc\xfb\xbf\x00\x00\x00\x00\x00\x00' for <class 'numpy.longdouble'> does not match any known type: falling back to type probe function.
  This warnings indicates broken support for the dtype!
    machar = _get_machar(dtype)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

@Jammy2211 Jammy2211 closed this Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants