oda-hub / oda_api

API client to access some of the MMODA resources: INTEGRAL, POLAR, ANTARES, LIGO/Virgo, SDSS
Other
2 stars 2 forks source link

Log to fits hdu function #203

Closed burnout87 closed 1 year ago

burnout87 commented 1 year ago

How do you see having a setter and a getter property for the name attribute? @dsavchenko

It is now applied to the class NumpyDataUnit, but can be easily extended to the other classes

codecov[bot] commented 1 year ago

Codecov Report

Merging #203 (4c81ef9) into master (8634e66) will increase coverage by 0.54%. The diff coverage is 95.23%.

@@            Coverage Diff             @@
##           master     #203      +/-   ##
==========================================
+ Coverage   54.16%   54.70%   +0.54%     
==========================================
  Files          20       20              
  Lines        4036     4056      +20     
==========================================
+ Hits         2186     2219      +33     
+ Misses       1850     1837      -13     
Impacted Files Coverage Δ
oda_api/data_products.py 60.99% <94.11%> (+2.07%) :arrow_up:
tests/test_data_products.py 99.00% <100.00%> (+0.04%) :arrow_up:

... and 2 files with indirect coverage changes

dsavchenko commented 1 year ago

The idea of #200 was that the product should have no name unless explicitly set (otherwise, either this default name was substituting the name of the variable or should have been explicitly reset in the plugin)

Therefore, no need to change it in other products. The NumpyDataUnit is special case, it represents fits extension, which should always have name (and it is not used as a product by itself).

burnout87 commented 1 year ago

The idea of #200 was that the product should have no name unless explicitly set (otherwise, either this default name was substituting the name of the variable or should have been explicitly reset in the plugin)

Therefore, no need to change it in other products. The NumpyDataUnit is special case, it represents fits extension, which should always have name (and it is not used as a product by itself).

Ok then, the changes I included assign table as name in the case this is None, ONLY for NumpyDataUnit objects.

I also extended an extended test that verifies that this is set