ericmandel / pyds9

Python connection to SAOimage DS9 via XPA
76 stars 41 forks source link

Open multiple instances of ds9 #62

Closed montefra closed 6 years ago

montefra commented 6 years ago

This PR resolves issue #61 It makes sure that ds9_openlist can handle multiple ds9 instances, even if they have the same name.

To test it:

  1. start 3 ds9 instances

    ~> ds9& ~> ds9& ~> ds9 -title test&

  2. in a python interpreter

    import pyds9 pyds9.ds9_targets() ['DS9:ds9 /tmp/.xpa/DS9_ds9.26689', 'DS9:ds9 /tmp/.xpa/DS9_ds9.26811', 'DS9:test /tmp/.xpa/DS9_test.26936'] ds9s = pyds9.ds9_openlist() [[i.target, i.id] for i in ds9s] [['/tmp/.xpa/DS9_ds9.26689', '/tmp/.xpa/DS9_ds9.26689'], ['/tmp/.xpa/DS9_ds9.26811', '/tmp/.xpa/DS9_ds9.26811'], ['DS9:test', '/tmp/.xpa/DS9_test.26936']]

ericmandel commented 6 years ago

@montefra Sorry ... can you please remind me how to install your test version in Python? I cloned it and tried:

CC=clang python -m pip install --user ./pyds9

but I still get the old 'too many ds9 instances for target: DS9:ds9' error, so I assume I have not really installed it. I only think about Python when we work together, so ...

montefra commented 6 years ago

You can get it with:

CC=clang python -m pip install git+https://github.com/montefra/pyds9.git@openlist#egg=pyds9

I just tested it (except the CC=clang and it works). I suggest to use a clean virtual or conda environent that then you can throw away.

ericmandel commented 6 years ago

OK, thanks! I'll have to spend some time figuring out how to do all of this ... might not be this week, which looks pretty booked.

montefra commented 6 years ago

You're welcome.

might not be this week,

No problem

ericmandel commented 6 years ago

@montefra I've now tested this in miniconda on a Mac and it looks like it works just fine. Nicely done.

montefra commented 6 years ago

Great, then I'll merge the PR

montefra commented 6 years ago

@ericmandel : by any chanche do you have any button to mark this PR as reviewed? Here is some explanation