These are chat archives for glue-viz/glue-vispy-viewers

2nd
May 2016
Penny Qian
@PennyQ
May 02 2016 16:17
(newvispy)➜ glue glue -v
INFO:glue:Input arguments: ['/Users/penny/anaconda/envs/newvispy/bin/glue', '-v']
INFO:glue:Dill library not installed. Falling back to cPickle
INFO:glue:Loading external plugins using setuptools==20.7.0
INFO:glue:Loading plugin vispy_isosurface failed (Exception: No module named 'vispy')
INFO:glue:Loading plugin vispy_volume failed (Exception: No module named 'vispy')
INFO:glue:Loading plugin vispy_scatter failed (Exception: No module named 'vispy')
INFO:glue:Loading plugin ginga_viewer failed (Exception: ginga is required)
INFO:glue:Loading plugin image_viewer succeeded
INFO:glue:Loading plugin scatter_viewer succeeded
INFO:glue:Loading plugin spectrum_tool succeeded
INFO:glue:Loading plugin dendro_viewer failed (Exception: No module named 'astrodendro')
INFO:glue:Loading plugin export_d3po succeeded
INFO:glue:Loading plugin histogram_viewer succeeded
INFO:glue:Loading plugin coordinate_helpers succeeded
INFO:glue:Loading plugin export_plotly succeeded
INFO:glue:Loading plugin pv_slicer succeeded
WARNING:glue:Failed to load plugin configuration
INFO:glue.core.hub:Subscribing DataCollection (0 data sets)
to DataAddComponentMessage
INFO:glue:Loading external plugins using setuptools==20.7.0
INFO:glue:Loading plugin vispy_isosurface failed (Exception: No module named 'vispy')
INFO:glue:Loading plugin vispy_volume failed (Exception: No module named 'vispy')
INFO:glue:Loading plugin vispy_scatter failed (Exception: No module named 'vispy')
INFO:glue:Loading plugin ginga_viewer failed (Exception: ginga is required)
INFO:glue:Plugin image_viewer already loaded
INFO:glue:Plugin scatter_viewer already loaded
INFO:glue:Plugin spectrum_tool already loaded
INFO:glue:Loading plugin dendro_viewer failed (Exception: No module named 'astrodendro')
INFO:glue:Plugin export_d3po already loaded
INFO:glue:Plugin histogram_viewer already loaded
INFO:glue:Plugin coordinate_helpers already loaded
INFO:glue:Plugin export_plotly already loaded
INFO:glue:Plugin pv_slicer already loaded
WARNING:glue:Failed to load plugin configuration
INFO:glue.core.hub:Subscribing <glue.core.qt.data_collection_model.DataCollectionModel object at 0x118e3cdc8> to DataCollectionDeleteMessage
INFO:glue.core.hub:Subscribing <glue.core.qt.data_collection_model.DataCollectionModel object at 0x118e3cdc8> to SubsetDeleteMessage
INFO:glue.core.hub:Subscribing <glue.core.qt.data_collection_model.DataCollectionModel object at 0x118e3cdc8> to DataCollectionAddMessage
INFO:glue.core.hub:Subscribing <glue.core.qt.data_collection_model.DataCollectionModel object at 0x118e3cdc8> to SubsetCreateMessage
WARNING:root:Message signing is disabled. This is insecure and not recommended!
Thomas Robitaille
@astrofrog
May 02 2016 16:45
glue-viz/glue-3d-viewer#114
depth_test
vispy/vispy#1166
scatter.set_gl_state(depth_test=True, blend=True, blend_func=('src_alpha', 'one_minus_src_alpha'))
depth_test=True
Thomas Robitaille
@astrofrog
May 02 2016 16:51
from glue.config import settings
settings.BACKGROUND_COLOR = 'black'
glue_vispy_viewers. BACKGROUND_COLOR
gluevispyviewers/__init.py
glue_vispy_viewers/__init__.py
BACKGROUND_COLOR = 'black'
VispyDataViewer
init()
Thomas Robitaille
@astrofrog
May 02 2016 16:57
glue/config.py
Thomas Robitaille
@astrofrog
May 02 2016 20:31
@PennyQ - I'm around for the next hour, so let me know if you need any help with finishing up glue-viz/glue-3d-viewer#128
Penny Qian
@PennyQ
May 02 2016 20:35
@astrofrog I am not sure which parts in the CHANGES.md should I remove?
Take a look at the diff in the pull request:
any of the lines in green shouldn't be there in CHANGES.md
e.g.
+<<<<<<< HEAD
 +=======
Do you see those?
Penny Qian
@PennyQ
May 02 2016 20:36
Yeah I noticed it
I am often confused about which part should I discard when this conflict happened, I should keep the HEAD part or the master part...
Thomas Robitaille
@astrofrog
May 02 2016 20:37
In principle you will sometimes need to keep a bit of both :)
Because normally those areas show bits where there is a conflict, so there are changes in both parts that might be important
Penny Qian
@PennyQ
May 02 2016 20:38
I feel I make a mess when I keep mess, it’s like Github wants me to make a choice between them :(
both, typo~
Thomas Robitaille
@astrofrog
May 02 2016 20:38
Right you shouldn't keep both as-is, you need to combine them into a single block of code that combines the changes from both - then you should get rid of the <<<, === and >>>
So to take a simple example, say that you have a chunk of code that is:
a = 1
Now let's say I change it so that a is now called b, and then I push to master. However, you are working on a version that is older than master and you change 1 to 2
Penny Qian
@PennyQ
May 02 2016 20:40
yeah, in this case we can’t keep both
Thomas Robitaille
@astrofrog
May 02 2016 20:40
You will then need to rebase and you will get a conflict:
<<<
b = 1
===
a = 2
>>>
so then you have to understand what was changed in master, and how it relates to your changes, and replace the whole block with
b = 2
Does that make sense?
Penny Qian
@PennyQ
May 02 2016 20:42
yeah, I need to choose which I want in some cases, so here it’s ok for me just remove those symbols coz I want to keep what’s from the master branch
Thomas Robitaille
@astrofrog
May 02 2016 20:42
Yep!
Penny Qian
@PennyQ
May 02 2016 20:42
:) happy to learn more~
another thing is the squash when rebase
I treated as discard the commit I don’t want
but it seems like combine several commits into one...
Thomas Robitaille
@astrofrog
May 02 2016 20:44

To combine several into one, you should replace e.g:

pick ab4121a blah blah
pick adfc441 blah blah
pick a114d3a blah blah
pick cc433aa blah blah

by

pick ab4121a blah blah
squash adfc441 blah blah
squash a114d3a blah blah
squash cc433aa blah blah

(the first should be pick)

Penny Qian
@PennyQ
May 02 2016 20:45
yeah~
Thomas Robitaille
@astrofrog
May 02 2016 20:45
Then once you do that it will ask you later for a commit message, and it will show all 3 or 4, delete all the commit messages and keep only one or make a new one
Does that seem to work?
Penny Qian
@PennyQ
May 02 2016 20:47
ha, let me see, I found this will change the commit history, but the code is still there…so it’s not discarding the commit I squash, but combine them into a new commit to make the history more clear?
Thomas Robitaille
@astrofrog
May 02 2016 20:48
yes, the code will be identical but in a single commit
it makes the commit history more clean and will basically get rid of the large icon in the history because it is now replaced by the smaller icon
Penny Qian
@PennyQ
May 02 2016 20:49
hmmm, this makes more sense to me, thanks and I will try the new PR :)
Thomas Robitaille
@astrofrog
May 02 2016 20:49
You don't need to open a new PR
Just force push to the existing branch
git push -f origin icon_rotate_view
that will update the existing PR
Penny Qian
@PennyQ
May 02 2016 20:50
oh yeah, I will try, did you meet the case that you really want to get rid of one specific commit, after you already push it to the remote reposority ?
Thomas Robitaille
@astrofrog
May 02 2016 20:50
Yes, you can do that too with rebasing
Penny Qian
@PennyQ
May 02 2016 20:50
I used rebase to do that before but that’s a lot of pain :(
Thomas Robitaille
@astrofrog
May 02 2016 20:51
In that case, when you rebase, just remove the line with that commit from the list of commits
Penny Qian
@PennyQ
May 02 2016 20:51
even not squash?
Thomas Robitaille
@astrofrog
May 02 2016 20:51
no, not squash
if you want to remove the changes, just remove the line

E.g change

pick ab4121a blah blah
pick adfc441 blah blah
pick a114d3a blah blah
pick cc433aa blah blah

to

pick ab4121a blah blah
pick adfc441 blah blah
pick cc433aa blah blah
squash keeps the changes but combines the changes with the previous commit
removing the commit actually deletes the changes
Penny Qian
@PennyQ
May 02 2016 20:52
ok, got it, this will be complex when there are conflicts after deleting it?
Thomas Robitaille
@astrofrog
May 02 2016 20:53
If you remove a commit and that commits after that depended on that commit then yes it will make a mess
Penny Qian
@PennyQ
May 02 2016 20:53
and those conflicts are quite hard to solve...
Thomas Robitaille
@astrofrog
May 02 2016 20:53
yes
but if you remove a commit and that nothing else after changed the same parts of the file, then it should be fine
Penny Qian
@PennyQ
May 02 2016 20:53
yeah… I met once before and wants to kill the Github...
Thomas Robitaille
@astrofrog
May 02 2016 20:54
hehe yeah
Penny Qian
@PennyQ
May 02 2016 20:54
any easier solutions for that case?
Thomas Robitaille
@astrofrog
May 02 2016 20:54
well, if everything goes wrong, I just start a new clean branch from the upstream master and copy and paste the changes into the new branch manually ;)
Did the rebase work? (I have a backup of your branch in case anything goes wrong)
Penny Qian
@PennyQ
May 02 2016 20:55
:) :) :) good to know this, ha
trying~
Penny Qian
@PennyQ
May 02 2016 21:00
I feel I don’t need to squash...
pick d8183b3 Make sure the 3D viewer is updated if the zorder is set manually. This happens for example when adding a subset to a viewer manually.
pick 50bacf9 Added changelog entry
pick e7dfea5 Raise an explicit warning in 3D volume viewer if PyOpenGL is not present
pick e6bca37 remove conflicts marks in changes log
Thomas Robitaille
@astrofrog
May 02 2016 21:01
Why not?
Penny Qian
@PennyQ
May 02 2016 21:01
which one?
Oh yeah… it’s a long history...
Thomas Robitaille
@astrofrog
May 02 2016 21:01
wait
Yes you can just squash them all - e7dfea5 is not yours, but it doesn't matter, the commit will basically be empty since that change is already in master
so change pick to squash for the second, third and fourth
the reason we need to squash here is not because there are 4 commits (that's not a problem) but because e7dfea5 is not related to this PR (it's already in master) and e6bca37 is not a real change, just fixing conflicts
Penny Qian
@PennyQ
May 02 2016 21:03
ok got it
Thomas Robitaille
@astrofrog
May 02 2016 21:08
(I'm confused about where e7dfea5 came from, I don't see it on GitHub. Did you do a merge before starting the rebase?)
Any luck with the squashing?
Penny Qian
@PennyQ
May 02 2016 21:23
sorry I got some friends in my office right now, keep trying now ;)
yeah I merged from the master before the rebase
Thomas Robitaille
@astrofrog
May 02 2016 21:24
Ok, you don't need to do the merging before rebase - if you do that, you will have to deal with conflicts twice
just rebase, and it automatically puts your branch on top of all the existing master commits, so it's also merging at the same time
anyway, for this time it's fine to continue with the rebase, I just mean to save you time in future
I basically never merge
Penny Qian
@PennyQ
May 02 2016 21:28
really? even don’t need to check the updates from the upstream and merge into current working branch?
Thomas Robitaille
@astrofrog
May 02 2016 21:28

you do need to fetch the changes but not merge, so I do:

git fetch upstream
git rebase -i upstream/master

and you don't need a merge

Penny Qian
@PennyQ
May 02 2016 21:29
wow, this is helpful to me!!
Thomas Robitaille
@astrofrog
May 02 2016 21:29
np :)
I used to merge and rebase, and had to fix conflicts TWICE
Penny Qian
@PennyQ
May 02 2016 21:32
yeah there are some conflicts after I squash those commits

Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: glue_vispy_viewers/common/vispy_widget.py

Unmerged paths:
(use "git reset HEAD <file>..." to unstage)
(use "git add <file>..." to mark resolution)
both modified: glue_vispy_viewers/scatter/scatter_toolbar.py

Thomas Robitaille
@astrofrog
May 02 2016 21:34
so currently is it asking you to resolve the conflicts?
Penny Qian
@PennyQ
May 02 2016 21:34
yeah, it’s strange that the .png figure is also gone
Thomas Robitaille
@astrofrog
May 02 2016 21:34
what does `git diff return?
Penny Qian
@PennyQ
May 02 2016 21:35
diff --cc glue_vispy_viewers/scatter/scatter_toolbar.py
index a994e7d,eb139a1..0000000
--- a/glue_vispy_viewers/scatter/scatter_toolbar.py
+++ b/glue_vispy_viewers/scatter/scatter_toolbar.py
@@@ -84,5 -103,5 +84,10 @@@ class ScatterSelectionToolbar(VispyData # np.append(layer_data, np.array([layer[x_att], layer[y_att], layer[z_att]]).transpose(), axis=0)
tr = visual.get_transform(map_from='visual', map_to='canvas')
data = tr.map(layer_data)
++<<<<<<< HEAD
  • data /= data[:, 3:] # normalize with homogeneous coordinates
  • return data[:, :2]
    ++=======
    • data /= data[:, 3:]
    • return data[:, :2]
      ++>>>>>>> da9862e... add back the fov=60
      (END)
:( it’s so mess to put code here...
Thomas Robitaille
@astrofrog
May 02 2016 21:35
huh those are pretty old changes
ah here's a trick for pasting code
press command-/
and it will switch to multi-line mode - in that mode you can put lines of text inside triple backticks `
and to send a message, command-enter
for the rebase, just fix the commit the way you think it should be, at least it's only a small conflict - once you've fixed it, you can do git add glue_vispy_viewers/scatter/scatter_toolbar.py and then git rebase --continue
If you are stuck, I can take you through step by step, just let me know
I can do it on my computer at the same time
Penny Qian
@PennyQ
May 02 2016 21:43
ok, let me try one more time, I am sorry that my friends are here so I replied so slowly
Thomas Robitaille
@astrofrog
May 02 2016 21:43
not a problem!! and we can also do it tomorrow if easier :)
Penny Qian
@PennyQ
May 02 2016 21:52
That would be great, thanks a lot, I think I need more time that it’s still a mess now ~
Thomas Robitaille
@astrofrog
May 02 2016 21:53
Ok - and I can take you through it step by step too if you need