Autostronomy / AstroPhot

A fast, flexible, automated, and differentiable astronomical image 2D forward modelling tool for precise parallel multi-wavelength photometry
https://astrophot.readthedocs.io
GNU General Public License v3.0
79 stars 9 forks source link

vector functions handle empty tuples #132

Closed ConnorStoneAstro closed 8 months ago

ConnorStoneAstro commented 8 months ago

If all the sub parameters are locked then a model may encounter an empty tuple when trying to construct the vector representation. Since torch.concatenate doesn't handle empty tuples we include a condition to return an empty tensor.

codecov[bot] commented 8 months ago

Codecov Report

Merging #132 (0f32cb2) into main (471ce08) will increase coverage by 0.09%. The diff coverage is 97.36%.

@@            Coverage Diff             @@
##             main     #132      +/-   ##
==========================================
+ Coverage   78.03%   78.12%   +0.09%     
==========================================
  Files          80       80              
  Lines        6970     6999      +29     
==========================================
+ Hits         5439     5468      +29     
  Misses       1531     1531              
Files Coverage Δ
astrophot/param/parameter.py 97.58% <97.36%> (+0.20%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

ConnorStoneAstro commented 8 months ago

This should close #133 now as well. In the case that uncertainty is None for both vector_uncertainty and vector_set_uncertainty it should catch the None and make an appropriate tensor for the uncertainty.