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

from a cube, retrieve a list of maps able to be loaded #41

Open
albireox opened this issue Nov 2, 2016 · 5 comments
Open

from a cube, retrieve a list of maps able to be loaded #41

albireox opened this issue Nov 2, 2016 · 5 comments
Assignees
Labels
enhancement indicates a new feature or functionality to be added priority-science

Comments

@albireox
Copy link
Member

albireox commented Nov 2, 2016

Issue by havok2063
Monday Oct 24, 2016 at 07:13 GMT
Originally opened as https://github.com/marvin-manga/marvin/issues/85


From a Marvin Cube, we should be able to get a list of maps associated with that cube. Either that are able to be loaded (locally from files or db), or potential maps (list all)? Often I forget what maps I have and I want to quickly find out from a Marvin Cube.

@albireox albireox added this to the DR14 milestone Nov 2, 2016
@albireox albireox added the enhancement indicates a new feature or functionality to be added label Nov 2, 2016
@albireox
Copy link
Member Author

albireox commented Nov 4, 2016

This is not difficult to do and quite a lot of people will ask for it, so let's aim for this to be done for the Beta release or soon afterwards.

Let's define how this should work. I can see it working in two different ways:

  • You have a Marvin Cube cube and you do cube.get_all_maps() and get a list of Marvin Maps objects already instantiated. This is convenient but over the API it may be a bit slow.
  • You do cube.list_available_maps() and get a list of string or ad-hoc object that basically tell you the bintype and stellar library combinations available. You could yo something like
>>> av_maps = cube.list_available_maps()
>>> av_maps
['ALL-GAU-MILESHC', 'SPX-GAU-MILESHC']
>>> type(av_maps[0])
MarvinClassNameTBD
>>> maps = av_maps[0].load()

Comments?

@albireox albireox modified the milestones: DR14, Marvin Beta Nov 4, 2016
@havok2063
Copy link
Collaborator

I like the 2nd option that provides a simple string list of what is available. Then the user can decide what they want to instantiate. Option 1 might be too slow and demanding on the server.

I was just thinking of a string list, and we may not need anything fancier. They could do

>>> av_maps = cube.list_available_maps()
>>> av_maps
['ALL-GAU-MILESHC', 'SPX-GAU-MILESHC']
>>> cube.getMaps(avmaps[0])

but your way could work too.

@albireox
Copy link
Member Author

albireox commented Nov 4, 2016

I like that. It would require reworking the cube.getMaps a bit but it should not be too hard, and it's useful for getMaps itself. I'll implement that.

@albireox
Copy link
Member Author

albireox commented Nov 4, 2016

Another subtle issue. Should we provide a list of all possible maps (that would always be the same list of 4 maps for MPL-5 and 9 for MPL-4) and use the normal loading logic in Maps (i.e., first will try to use the same mode as the cube, but if it fails it will revert to remote mode); or should we only show the list of maps available for that mode. The latter would mean that if you open a cube from a file it would only show the maps for which you have the file, and the same with the DB.

@albireox albireox modified the milestones: Marvin Beta, Post-Beta Nov 10, 2016
@havok2063
Copy link
Collaborator

I like the idea of only showing the list of maps that are actually available. In principle, it should be all of them anyways, at least remotely, but doesn't have to be in local mode. But then that does require you to always search the filesystem for those maps. I guess it's not so bad if we restrict it to the maps location in the SAS directory.

@albireox albireox modified the milestones: Post-Beta, 2.1 Dec 2, 2016
@albireox albireox modified the milestone: 2.1 Jan 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement indicates a new feature or functionality to be added priority-science
Projects
None yet
Development

No branches or pull requests

3 participants