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

Close Does Not Work #718

Closed
williams13 opened this Issue Sep 26, 2014 · 11 comments

Comments

Projects
None yet
2 participants
@williams13
Contributor

williams13 commented Sep 26, 2014

I use x.close to clear. It closes the canvas but the image is still there when I plot the second image.

import vcs, cdms2, time, datetime

Open data file:

cdmsfile = cdms2.open( 'clt.nc' )

Extract a 3 dimensional data set

data = cdmsfile('clt')

x=vcs.init()
p=x.plot(data)
x.close()
x.plot(data[4][1:89])

@aashish24

This comment has been minimized.

Contributor

aashish24 commented Sep 27, 2014

Definately a bug.. thanks for finding it.

@aashish24

This comment has been minimized.

Contributor

aashish24 commented Sep 29, 2014

@williams13 Shouldn't close exit the graphis altogether? Normally close mean you are done with the graphics and you want to release resources. I am trying to understand the concept here before I touch the code

@aashish24

This comment has been minimized.

Contributor

aashish24 commented Sep 29, 2014

Okay I looked into the code and I think I know what should happen and based on your script, I think the correct behavior is to create another plot which we do currently but not in a correct way. Will push a fix with a test

@williams13

This comment has been minimized.

Contributor

williams13 commented Sep 29, 2014

Thanks… Can't wait to test this out. :-)

From: Aashish Chaudhary <notifications@github.commailto:notifications@github.com>
Reply-To: UV-CDAT/uvcdat <reply@reply.github.commailto:reply@reply.github.com>
Date: Monday, September 29, 2014 6:16 AM
To: UV-CDAT/uvcdat <uvcdat@noreply.github.commailto:uvcdat@noreply.github.com>
Cc: Dean Williams <williams13@llnl.govmailto:williams13@llnl.gov>
Subject: Re: [uvcdat] Close Does Not Work (#718)

Okay I looked into the code and I think I know what should happen and based on your script, I think the correct behavior is to create another plot which we do currently but not in a correct way. Will push a fix with a test


Reply to this email directly or view it on GitHubhttps://github.com//issues/718#issuecomment-57158467.

@aashish24

This comment has been minimized.

Contributor

aashish24 commented Sep 29, 2014

git fetch
git checkout 718_vcs_fix_close
cd build directory
rm -rf CDAT-prefix
make CDAT -jN
source the setup script
Run the test (ctest -R "vcs_test_close")
or Run the script that Dean posted above.

@williams13

This comment has been minimized.

Contributor

williams13 commented Sep 29, 2014

[naomi 6] ~/work/uvcdata/uvcdat > ctest -R "vcs_test_close"
Test project /Users/williams13/work/uvcdata/uvcdat
No tests were found!!!
[06:48 - 0.700.770.76]
[naomi 7] ~/work/uvcdata/uvcdat >

I will use my script to test.
-Dean

From: Aashish Chaudhary <notifications@github.commailto:notifications@github.com>
Reply-To: UV-CDAT/uvcdat <reply@reply.github.commailto:reply@reply.github.com>
Date: Monday, September 29, 2014 6:31 AM
To: UV-CDAT/uvcdat <uvcdat@noreply.github.commailto:uvcdat@noreply.github.com>
Cc: Dean Williams <williams13@llnl.govmailto:williams13@llnl.gov>
Subject: Re: [uvcdat] Close Does Not Work (#718)

ctest -R "vcs_test_close"

@williams13

This comment has been minimized.

Contributor

williams13 commented Sep 29, 2014

This is working much better, but it still slows down after 70 or so plots. But it is faster. Can we try the "clear" as well?

From: Aashish Chaudhary <notifications@github.commailto:notifications@github.com>
Reply-To: UV-CDAT/uvcdat <reply@reply.github.commailto:reply@reply.github.com>
Date: Monday, September 29, 2014 6:31 AM
To: UV-CDAT/uvcdat <uvcdat@noreply.github.commailto:uvcdat@noreply.github.com>
Cc: Dean Williams <williams13@llnl.govmailto:williams13@llnl.gov>
Subject: Re: [uvcdat] Close Does Not Work (#718)

git fetch
git checkout 718_vcs_fix_close
cd build directory
rm -rf CDAT-prefix
make CDAT -jN
source the setup script
Run the test (ctest -R "vcs_test_close")
or Run the script that Dean posted above.


Reply to this email directly or view it on GitHubhttps://github.com//issues/718#issuecomment-57160486.

@aashish24

This comment has been minimized.

Contributor

aashish24 commented Sep 29, 2014

@williams13 I am not sure if I understand. The slowness is a separate issue. The bug here was something diffirent.

@aashish24

This comment has been minimized.

Contributor

aashish24 commented Sep 29, 2014

Please elaborate more if you can. Also, if this branch looks good to you, I would like to have it merged.

@williams13

This comment has been minimized.

Contributor

williams13 commented Sep 29, 2014

The close ("x.close") worked fine. I think is behaving properly now.

The clear ("x.clear"), removes all drawings on the canvases, but does not remove the canvas. It just makes it as if it was a clean slate.

From: Aashish Chaudhary <notifications@github.commailto:notifications@github.com>
Reply-To: UV-CDAT/uvcdat <reply@reply.github.commailto:reply@reply.github.com>
Date: Monday, September 29, 2014 7:24 AM
To: UV-CDAT/uvcdat <uvcdat@noreply.github.commailto:uvcdat@noreply.github.com>
Cc: Dean Williams <williams13@llnl.govmailto:williams13@llnl.gov>
Subject: Re: [uvcdat] Close Does Not Work (#718)

Please elaborate more if you can. Also, if this branch looks good to you, I would like to have it merged.


Reply to this email directly or view it on GitHubhttps://github.com//issues/718#issuecomment-57168182.

@aashish24

This comment has been minimized.

Contributor

aashish24 commented Sep 29, 2014

I see. But I think that is the right behavior. Typically the tools I use, I would expect that clear will just clean my slate and will not destroy the canvas I created. glClear call is an example of such.

@aashish24 aashish24 closed this Sep 29, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment