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

Add a method get_idx() to group #568

Closed
jinningwang opened this issue Sep 30, 2024 · 0 comments
Closed

Add a method get_idx() to group #568

jinningwang opened this issue Sep 30, 2024 · 0 comments

Comments

@jinningwang
Copy link
Member

Is your feature request related to a problem? Please describe.
N/A

Describe the solution you'd like
A method GroupBase.get_idx(), it returns all existing idxes in a group.

Better cross group indexing for users/AMS

Describe alternatives you've considered
Below method returns an available idx for new devices.

andes/andes/models/group.py

Lines 352 to 356 in 5ab784b

def get_next_idx(self, idx=None, model_name=None):
"""
Get a no-conflict idx for a new device.
Use the provided ``idx`` if no conflict.
Generate a new one otherwise.

Additional context
Move following AMS's implementation to ANDES:
https://github.com/CURENT/ams/blob/8bc9504a8281c16236c73decd8e7365b682c706c/ams/models/group.py#L22-L29

@jinningwang jinningwang changed the title Add a method find_idx() to group Add a method get_idx() to group Oct 4, 2024
@jinningwang jinningwang mentioned this issue Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant