ptiede / Comrade.jl

MIT License
47 stars 7 forks source link

Complete refactor and rewrite of instrument modeling #346

Closed ptiede closed 4 months ago

ptiede commented 5 months ago

This PR will serve as the staging ground for the Comrade instrument modeling refactor. The goal is to completely rewrite how instrument modeling is organized and tremendously simplify the user-facing interface. The new interface will look like it will be broken into three parts:

  1. Users define the Jones matrix parameterization.
  2. Users specify the Jones matrix priors abstractly.
  3. The array used for the observations is set, and everything is initialized.

We also are moving away from design matrices. Instead, the data layout will be managed by a set of arrays of indices that map from site-specific vectors to baseline-specific vectors. This allows me to handle everything much more efficiently and effectively construct the instrument model in a single loop, rather than multiple sparse matrix vector multiplications and broadcasting, which allocated more and did more computation. Additionally, in future releases, we can probably re-organize the data to be maximally cache-friendly due to some abstractions.

TO DO

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 93.32322% with 88 lines in your changes are missing coverage. Please review.

Project coverage is 92.55%. Comparing base (1fe951e) to head (92e06e3).

Files Patch % Lines
src/instrument/site_array.jl 90.19% 10 Missing :warning:
src/visualizations/data.jl 93.54% 10 Missing :warning:
src/inference/posteriorsamples.jl 87.14% 9 Missing :warning:
src/inference/inference.jl 84.78% 7 Missing :warning:
src/instrument/instrument_transforms.jl 91.07% 5 Missing :warning:
src/observations/abstract.jl 79.16% 5 Missing :warning:
src/observations/datums.jl 76.47% 4 Missing :warning:
src/instrument/instrument.jl 62.50% 3 Missing :warning:
src/instrument/jonesmatrices.jl 92.85% 3 Missing :warning:
src/instrument/model.jl 97.34% 3 Missing :warning:
... and 12 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #346 +/- ## ========================================== + Coverage 8.55% 92.55% +84.00% ========================================== Files 20 30 +10 Lines 1883 1571 -312 ========================================== + Hits 161 1454 +1293 + Misses 1722 117 -1605 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.