Skip to content

EUCLID: include the new parameter linking_parameter in the method get_spectrum#3543

Open
cosmoJFH wants to merge 1 commit intoastropy:mainfrom
esdc-esac-esa-int:ESAC_Euclid_EUCLIDSWRQ-226_include_linking_parameter
Open

EUCLID: include the new parameter linking_parameter in the method get_spectrum#3543
cosmoJFH wants to merge 1 commit intoastropy:mainfrom
esdc-esac-esa-int:ESAC_Euclid_EUCLIDSWRQ-226_include_linking_parameter

Conversation

@cosmoJFH
Copy link
Contributor

@cosmoJFH cosmoJFH commented Feb 27, 2026

Dear astroquery team,

we would like to update the method get_spectrum so that the spectra can be searched by a source_id (present implementation) or by a sourcepatch_id. To carry out this, we introduce the parameter linking_parameter that provides the meaning to the input id of the source.

Note that we have changed the input parameter source_id to id.

cc @esdc-esac-esa-int
jira: EUCLIDSWR-226

@cosmoJFH cosmoJFH force-pushed the ESAC_Euclid_EUCLIDSWRQ-226_include_linking_parameter branch from 33ae3e7 to dc87904 Compare February 27, 2026 19:05
@cosmoJFH cosmoJFH force-pushed the ESAC_Euclid_EUCLIDSWRQ-226_include_linking_parameter branch from d189304 to 8ea8818 Compare February 27, 2026 19:16
@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 81.25000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.67%. Comparing base (20487dc) to head (21bf2c1).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
astroquery/esa/euclid/core.py 80.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3543      +/-   ##
==========================================
+ Coverage   72.66%   72.67%   +0.01%     
==========================================
  Files         219      219              
  Lines       20478    20493      +15     
==========================================
+ Hits        14880    14893      +13     
- Misses       5598     5600       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bsipocz bsipocz added this to the 0.4.12 milestone Feb 27, 2026
Copy link
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good, but the argument rename will need to go through a deprecation. (it should be straightforward with the decorator though).

This also needs a changelog entry.

return files

def get_spectrum(self, *, source_id, schema='sedm', retrieval_type="ALL", output_file=None, verbose=False):
def get_spectrum(self, *, id, schema='sedm', retrieval_type="ALL", linking_parameter='SOURCE_ID',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this needs to be done through an argument rename deprecation

(see usage of @deprecated_renamed_argument in e.g. the simbad module)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right. We have included it

@deprecated_renamed_argument('source_id', 'id',since='0.4.12')

----------
source_id : str, mandatory, default None
source id for the spectrum
id : str or int, mandatory
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any change that this method will be able to handle multiple IDs at the same time? I'm just asking as get_datalinks below can and as we already rename the argument we can make it a bit more self consistent and call this one ids, too.

Copy link
Contributor Author

@cosmoJFH cosmoJFH Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we have a task to update this method to handle multiple IDs at the same time, but this will part of our next sprint. So, would it be convenient to to change source_id by ids now. instead of of id? Or better to do it in the PR where the changes would be implemented?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say it's better to change it now, so we don't need to change it again when the functionality is extended.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have changed the parameter source_id to ids.

@cosmoJFH cosmoJFH force-pushed the ESAC_Euclid_EUCLIDSWRQ-226_include_linking_parameter branch 2 times, most recently from c3e9660 to 50c7ae2 Compare February 28, 2026 09:45
@cosmoJFH cosmoJFH force-pushed the ESAC_Euclid_EUCLIDSWRQ-226_include_linking_parameter branch from 27e4336 to 21bf2c1 Compare March 4, 2026 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants