Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change get_channel_group_id to return channel id if no group_id is set #681

Merged
merged 3 commits into from
Jun 4, 2024

Conversation

lpyras
Copy link
Collaborator

@lpyras lpyras commented May 27, 2024

This PR changes the function get_channel_group_id to return the channel id if no group id is set. The group_ids describe antennas are set for antennas with the same positions. Looping over the group_ids instead of the channel_ids and assign a quantity to several station ids can therefore be faster. The channel_id is more specific, therefore returning the channel id if no group id is set should not cause problems.

@@ -967,10 +967,10 @@ def get_channel_group_id(self, station_id, channel_id):
"""
res = self.__get_channel(station_id, channel_id)
if 'channel_group_id' not in res.keys():
logger.warning(
'Channel group ID not set for channel {} in station {}, returning -1'.format(
logger.info(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree with you that warning is a bit much, but maybe info is too little? Not sure. I think STATUS would be optimal actually, as that would still show up in the logs by default in the new system. Though for that we need to wait until the new logging is done :)

cg-laser
cg-laser previously approved these changes May 28, 2024
Copy link
Collaborator

@cg-laser cg-laser left a comment

Choose a reason for hiding this comment

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

looks good. I thought we already had this implemented. (Maybe I only did it on the refactor branch)

I would not even log an info method. This is a robust way for writing modules that work with antenna group and without, so we don't want to get flushed with log messages for an expected behaviour.

@lpyras lpyras force-pushed the change_return_ch_group_id branch from 8491a4d to d001c03 Compare June 3, 2024 11:47
@lpyras lpyras merged commit 372813a into develop Jun 4, 2024
5 checks passed
@lpyras lpyras deleted the change_return_ch_group_id branch June 4, 2024 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants