Jammy2211 / PyAutoGalaxy

PyAutoGalaxy: Open-Source Multiwavelength Galaxy Structure & Morphology
https://pyautogalaxy.readthedocs.io/
MIT License
26 stars 13 forks source link

Feature/iterate refactor #164

Closed Jammy2211 closed 3 months ago

Jammy2211 commented 3 months ago

Oversampling evaluates a light or mass profile with high precision, where an iterative grid may be used which increases the sub_size until a threshold precision is met.

This was previously implemented using a Grid2DIterate object. However, this led to a lot of code repetition with the Grid2D object and an unclear API in terms of how over sampling is performed.

This PR removes the Grid2DIterate object and moves the functionality into an OverSampleIterate object, which can be passed into a Grid2D in order to perform iterative oversampling.

This also led me to refactor the dataset package, removing Settings objects which wrapped the Grid2DIterate object in awkward ways, cleaning up the code even more!

A follow up PR will add a second OverSample object, which performs the normal over sampling which currently occur if the Grid2D does not have an over_sample object. This has the bold goal of removing the sub_size from all Mask and data structure objects, would has the potential to make the source code way cleaner. Wish me luck!